1
votes

Currently I have a AWS Codecommit repository and an AWS Elastic Beanstalk enviroment in which I upload updates with the EB CLI, using eb deploy.

I have some config files that are ignored in .gitignore, I want to establish a AWS CodePipeline so when I push changes to repository, automatically run the test functions and upload the changes directly to Elastic Beanstalk

I tried implementing a simple pipeline where I push code to CodeCommit and Deploys to Elastic Beantstalk but I get the following error:

2019-09-09 11:51:45 UTC-0500 ERROR "option_settings" in one of the configuration files failed validation. More details to follow.

2019-09-09 11:51:45 UTC-0500 ERROR You cannot remove an environment from a VPC. Launch a new environment outside the VPC.

2019-09-09 11:51:45 UTC-0500 ERROR Failed to deploy application.

This is the *.config file that isn't in Codecommit

option_settings:
  aws:ec2:vpc:
    VPCId: vpc-xxx
    Subnets: 'subnet-xxx'
  aws:elasticbeanstalk:environment:
    EnvironmentType: SingleInstance
    ServiceRole: aws-xxxx
  aws:elasticbeanstalk:container:python:
    WSGIPath: xxx/wsgi.py
  aws:elasticbeanstalk:healthreporting:system:
    SystemType: enhanced
  aws:elasticbeanstalk:application:environment:
    DJANGO_SETTINGS_MODULE: xxxxsettings
    SECRET_KEY: xxxx
    DB_NAME: xxxx
    DB_USER: xxxx
    DB_PASSWORD: xxxx
    DB_HOST: xxx
    DB_PORT: xxxx
  aws:autoscaling:launchconfiguration:
    SecurityGroups: sg-xxx
3
Edit: I think from what I have been reading is that I should not commit my config files, but add them in CodeBuild so it generates the .zip file that would be deployed to ElasticBeanstalk.josefeer157

3 Answers

0
votes

I noticed some syntax that is a little different from the above:

Subnets: value has '' around them, could this be causing the issue and if you have this here, are '' supposed to be around the other values ?

0
votes

From the config file it's look like that you are using single instance. For Single instance you don't need to specify autoscaling launch configuration. Just remove the last two line it will work fine.

0
votes

I think from what I have been reading is that I should not commit my config files, but add them in CodeBuild so it generates the .zip file that would be deployed to ElasticBeanstalk.