Home > Back-end >  aws cloudformation wordpress updates
aws cloudformation wordpress updates

Time:02-11

I have a wordpress app that I need to install to aws with a cloudformation template, I initially created it using some sample template from AWS cloudformation, but when AWS rebuilds the system some changes are lost,

in particular I need to set the httpd.conf file so that:

<Directory "/var/www">
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

and everytime aws rebuilds (they do it a few times a week) I lose this.

also I need to add a few environment variables to the elasticbeanstalk instance so that other changes will be picked up as well.

I currently have a few env variables like:

RDS_DB_NAME, RDS_HOSTNAME, RDS_PASSWORD, RDS_PORT, RDS_USERNAME

I'm not sure where they are configured in the cloudformation template, I think I remember adding them manually to the elasticbean instance configuration. I now need to add a bunch to these, like:

AUTH_KEY
SECURE_AUTH_KEY
LOGGED_IN_KEY
NONCE_KEY
AUTH_SALT
SECURE_AUTH_SALT
LOGGED_IN_SALT
NONCE_SALT

I'm not sure how to get around to do that.

I also need to configure the cloudformation so that my wordpress has also an SSL certificate (which I have available as arn) and is accessible via https.

I think if I add it to the autoscaling configuration, then updating the stack will just recreate the autoscaling resource and reinstall the vanilla version of wordpress,

I have wordpress in an application on elasticbean stalk, I'm not sure in this case how to make it install the latest version, instead of the vanilla one.

here's my entire cloudformation yaml template: https://justpaste.it/481a7

CodePudding user response:

Any such changes to your EB env, should be provided with your application as explained in section "Reverse proxy configuration" of

This includes any changes to httpd or nginx. This will ensure that they are always applied when you autoscale or re-upload your EB application.

CodePudding user response:

For me it was easier to create only the instance in an auto scaling group with CloudFormation and deploy the wordpress itself via CodeDeploy for example from a git repository or just folder/zip file. Then you can have there also the httpd.conf an you copy it to its location when CodeDeploy runs. Does not solve media content, but there is a wordpress plugin which stores media in s3. Or you can back it up on regular bases and sync up with the CodeDeploy script. Or EFS. There are many options. Doing it only via instance UserData is tricky and hard to debug.

  • Related