Skip to content

Instantly share code, notes, and snippets.

@cupuyc
Last active May 26, 2021 11:22
Show Gist options
  • Save cupuyc/8855d0e958d977ef9d6928542e35a886 to your computer and use it in GitHub Desktop.
Save cupuyc/8855d0e958d977ef9d6928542e35a886 to your computer and use it in GitHub Desktop.
# From https://gist.github.com/cupuyc/8855d0e958d977ef9d6928542e35a886
set -e
mkdir -p .ebextensions
# Define instance type to use
tee -a .ebextensions/ec2-settings.config > /dev/null <<EOT
option_settings:
aws:autoscaling:launchconfiguration:
InstanceType: t3.small
EOT
# Define HTTPS certificate to use. Certificate should be created in us-east-1 region
tee -a .ebextensions/securelistener-alb.config > /dev/null <<EOT
option_settings:
aws:elbv2:listener:443:
ListenerEnabled: 'true'
Protocol: HTTPS
SSLCertificateArns: arn:aws:acm:us-east-1:208767765858:certificate/fe8ef0f7-ffc0-4d80-a6b6-d33ad1553429
EOT
# Redirect EB logs to CloudWatch
tee -a .ebextensions/cloudwatch-logs.config > /dev/null <<EOT
option_settings:
aws:elasticbeanstalk:cloudwatch:logs:
StreamLogs: true
EOT
# Create EB ignore file, similar to .dockerignore
tee -a .ebignore > /dev/null <<EOT
dist
node_modules
EOT
# Define file upload limit
mkdir -p .platform/nginx/conf.d
tee -a .platform/nginx/conf.d/proxy.conf > /dev/null <<EOT
client_max_body_size 60M;
EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment