Closed mbennettcanada closed 10 months ago
Similarly, we are building out a multi-region CodePipeline and it demands the use of an 'artifact_stores' block, which does not exist in the provider.
Error: [ERROR] Error updating CodePipeline (<name>): ValidationException: Your pipeline contains actions in more than one region. Use 'pipeline.artifactStores' instead of 'pipeline.artifactStore' to declare an artifact store, such as an artifact bucket, for each region where you have an action.
There are no region configs set aside from the action performing the ECS CodeDeploy (blue/green) in another account with a different region.
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform version: 0.14.8 Aws provider version: 3.32.0
Affected Resource(s)
aws_codepipeline
Terraform Configuration Files
Debug Output
https://gist.github.com/mbennettcanada/244d884fb238b994ebc0780206448997
Expected Behavior
Terraform should have created a single-region codepipeline with two artifact stores
Actual Behavior
Plan executed just fine, but the apply errored out with the message:
Error: region must be set for a cross-region CodePipeline
Steps to Reproduce
terraform apply
Important Factoids
All of theses resources are being created in the same region. There are no multi-region bits whatsoever. The part of the code I suspect is the issue is here: https://github.com/hashicorp/terraform-provider-aws/blob/main/aws/resource_aws_codepipeline.go#L251
It looks to me (Not proficient at go so feel free to throw down on me here) as if the config is being expanded and each artifact store region is being appended to an array of regions. Then the logic checks on the length of the array instead of how many unique regions there are in said array. @gdavison Initially added this bit and may know if there are any downstream unintended consequences to changing. I can try to hack together a pr and learn go at the same time but it isn't gonna be pretty.
0000