shinesolutions / ruby_aem_aws

Ruby client for Shine Solutions Adobe Experience Manager (AEM) Platform on AWS
Apache License 2.0
3 stars 8 forks source link

Change the AWS region default constant to read the value from the env… #28

Closed odysseas closed 4 years ago

odysseas commented 4 years ago

I ran into an issue where inspec-aem-aws would not pass the region variable to ruby_aem_aws, causing it to fallback to ap-southeast-1. Because the deployment was on a different region, things like check-readiness-test and Jenkins acceptance tests would file.

I believe reading the region value from the environment before falling back to the hardcoded value, would help customization at earlier deployment steps.

mbloch1986 commented 4 years ago

@odysseas

Thank you very much for the PR.

Were you able to test the changes successful by testing it in a different AWS Region ?

Cheers Michael

odysseas commented 4 years ago

Hi Michael,

Yes, I was able to deploy a full set in eu-west-1 successfully by building a gem with the change in the pull request. For the acceptance tests I passed the AWS_DEFAULT_REGION environment variable in the docker extra arguments parameter of the Jenkins job. For the readiness test I had to change the SSM document running on the orchestrator to first set the environment variable with aws configure get region before running the test. I can submit a pull request for that as well if you like.

Also if you can suggest a better workaround I would be happy to test it.

Thank you for reviewing this.

mbloch1986 commented 4 years ago

For the readiness test I had to change the SSM document running on the orchestrator to first set the environment variable with aws configure get region before running the test. I can submit a pull request for that as well if you like.

@odysseas would this still be necessary once the PR is merged and the new version of ruby_aem_aws is released and integrated in OpenCloud ? If you think so I'm happy to have a look into the possible code changes.

odysseas commented 4 years ago

Hi @mbloch1986 ,

Many thanks for merging the pull request and sorry for the late reply. The SSM document change would still be needed because while ruby_aem_aws will be set the read the region from the environment variable, it still has to be set somehow before running the SSM document on the orchestrator.

Another option maybe would be to change inspec_aem_aws to read a region variable from the user config tarball, pass it to ruby_aem_aws and then change the relevant Makefile to pass the correct configuration file. This would be a bigger change as it requires changing multiple components.

In any case I will submit a PR with the SSM doc change in case you want to review it.