nhs-england-tools / terraform-aws-opennext

🧱 💻 ☁️ A Terraform module for deploying a Next.js application built with OpenNext to AWS
MIT License
75 stars 10 forks source link

Assuming current aws account ID when deploying to different account #10

Open copyPasteNinja opened 9 months ago

copyPasteNinja commented 9 months ago

Is there an existing issue for this?

Current Behavior

I have Jenkins as CI/CD that executes my terraform code. When my pipeline does execute terraform, the aws_iam_policy_document being attached to aws_kms_key is adopting the account ID where Jenkins currently lives while I want the infrastructure to be created in different account, therefore giving me a permission error. Curios enough this only happens in modules/cloudfront-logs yet modules/opennext-revalidation-queue is using the same method to retrieve account ID.

Note: Unless I am doing something wrong... I do have a possible solution I would like to contribute.

Expected Behavior

I would expect the all resources being created by terraform to be created in the account I specify.

Steps To Reproduce

No response

Output

No response

Code of Conduct

Sensitive Information Declaration