Skip to content

Instantly share code, notes, and snippets.

@tony-gutierrez
tony-gutierrez / aws_eb_cron.js
Last active Aug 5, 2021
AWS Elastic Beanstalk master instance nodejs cron.
View aws_eb_cron.js
const logger = require('./logger'),
AWS = require('aws-sdk'),
CronJob = require('cron').CronJob;
AWS.config.update({region: 'us-east-1'}); // change to your region
var opts = {
credentials: new AWS.EC2MetadataCredentials()// default to use the credentials for the ec2 instance
};
var elasticbeanstalk = new AWS.ElasticBeanstalk(opts);
@tony-gutierrez
tony-gutierrez / AWS_Single_LetsEncrypt.yaml
Last active Aug 19, 2021
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
View AWS_Single_LetsEncrypt.yaml
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443