I'm trying to create a Elastic Bean Enviromnemnt with a RDS database attached to it. I'm using a command like this:
aws elasticbeanstalk create-environment --application-name $AWS_APP_NAME \
--environment-name $AWS_APP_ENV_NAME \
--tier Name=WebServer,Type=Standard \
--solution-stack-name "64bit Amazon Linux 2 v3.2.3 running Docker" \
--option-settings "Namespace=aws:rds:dbinstance,OptionName=DBAllocatedStorage,Value=10" \
"Namespace=aws:rds:dbinstance,OptionName=DBDeletionPolicy,Value=Snapshot" \
"Namespace=aws:rds:dbinstance,OptionName=DBEngine,Value=postgres" \
"Namespace=aws:rds:dbinstance,OptionName=DBEngineVersion,Value=12.5" \
"Namespace=aws:rds:dbinstance,OptionName=DBInstanceClass,Value=db.t2.micro" \
"Namespace=aws:rds:dbinstance,OptionName=DBUser,Value=devsensei" \
"Namespace=aws:rds:dbinstance,OptionName=DBPassword,Value=$DB_PASSWORD" \
"Namespace=aws:rds:dbinstance,OptionName=DBSnapshotIdentifier,Value=" \
--region eu-west-1
The environment gets created, without any hint of an error. However, not RDS database is created. In the AWS Elastic Beans Web Console the configuration for the Database stays empty:
I've found existing StackOverflow questions, with a similar issue, like this one.
One suggestion is to configure the RDS database via a .ebextensions/01-database.conf
configuration in the application. Also the official AWS Elasticbeanstalk documentation (bottom of page) seems to suggest that.
I added a .ebextensions/01-database.conf
to my app. Without any success. The app deploys, I see not error, but there is no RDS instance created.
option_settings:
aws:rds:dbinstance:
DBAllocatedStorage: 10
DBDeletionPolicy: Snapshot
DBEngine: postgres
DBEngineVersion: 12.5
DBInstanceClass: db.t2.micro
DBUser: devuser
DBPassword: hello-fun-4
I could configure other things with the aws elasticbeanstalk create-environment
. I can create the RDS instance with the AWS Elasticbeans web console. I'm only failing to create it via the command line in an automated fashion.