awslabs / landing-zone-accelerator-on-aws

Deploy a multi-account cloud foundation to support highly-regulated workloads and complex compliance requirements.
https://aws.amazon.com/solutions/implementations/landing-zone-accelerator-on-aws/
Apache License 2.0
532 stars 421 forks source link

Change HOME_REGION in global config but AWSAccelerator pipeline still get stuck with us-east-1 at Account stage #140

Closed quangchustudy closed 1 year ago

quangchustudy commented 1 year ago

Describe the bug image

To Reproduce Use the Region selector in the console navigation bar to choose "ap-southeast-1" to deploy the cloud formation template file from the beginning. Take a look at codepipeline at the Account stage

Expected behavior Expect successfully with using "ap-southeast-1" not us-east-1

Please complete the following information about the solution:

SO0199-pipeline

Screenshots image

Additional context Add any other context about the problem here.

gavinying commented 1 year ago

I had exactly the same issue, thanks for raising it.

awsclemj commented 1 year ago

Hello, and thank you for your interest in Landing Zone Accelerator on AWS!

There are some API calls for global services that must be completed in us-east-1, specifically AWS Organizations API calls in this solution. The Accounts stage is always deployed to us-east-1 for this reason.

us-east-1 is bootstrapped when the solution is installed. If you have any SCPs or region deny that block actions in us-east-1, it’s possible the region may not have been bootstrapped properly. You should see a CDKToolkit stack in that region once the pipeline has completed. If you do not, can you verify you do not have any region deny settings in place for us-east-1 and run the Installer CodePipeline again? The Install stage in that pipeline should bootstrap us-east-1 for you.

More info on regional endpoints for AWS Organizations: https://docs.aws.amazon.com/general/latest/gr/ao.html

Thank you! Please let us know of this resolves your issue.

quangchustudy commented 1 year ago

Hi @awsclemj , @gavinying

Issue already resolved and you're right for "The Accounts stage is always deployed to us-east-1". I got stuck with this problem since I did a clean-up (including s3 bucket cdk-accel-assets-xxxxxxx-us-east-1 but still keep the cloudformation of CDKToolkit stack on us-east-1) for the last deployed in wrong region us-east-1 while I setup landing zone with control tower as https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/prerequisites.html => error happened at Account Stage.

And I solved as following:

Thank you.

gavinying commented 1 year ago

@awsclemj @quangchustudy Unfortunately, I still have this issue.

My question is,

2023-05-08_11-50 2023-05-08_11-52 2023-05-08_11-54

awsclemj commented 1 year ago

Hello @gavinying,

us-east-1 is bootstrapped during the Install stage of AWSAccelerator-Installer pipeline. I’d suggested manually releasing that pipeline once again if you have recently made edits to your region deny settings and do not see the stack created.

Thanks!

gavinying commented 1 year ago

Hi @awsclemj , I have re-run the AWSAccelerator-Installer pipeline just now, it completed without error, but I still didn't see any messages about creating stacks in us-east-1 region in the logs. I have attached logs for your reference. log.txt Any other suggestion? thanks.

awsclemj commented 1 year ago

Based on this log message, it appears your global region has been modified:

Container] 2023/05/09 00:42:17 Running command if ! aws cloudformation describe-stacks --stack-name AWSAccelerator-CDKToolkit --region ap-southeast-1; then BOOTSTRAPPED_GLOBAL="no"; fi

The global region is defined here in our installer template, so it must have been modified externally. We strongly advise against modifying the source code of LZA, as it may lead to unexpected failures of the core engine. I would suggest updating your Installer stack using an unmodified template so us-east-1 is bootstrapped.

Thanks!

gavinying commented 1 year ago

@awsclemj Awesome, you saved my day, thank you so much!

SennaSemakula commented 9 months ago

@awsclemj Do you know why this is not part of https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/prerequisites.html. I hit this issue whilst using Control Tower setup by using us-east-2 and denying us-east-1 for regions. The pre-requisites should clearly state that us-east-1 is required