Problem
When using the integration_s3_bucket_policy data source in AWS GovCloud, the policy generated by the data source only seems to support the AWS commercial partition (aws). The policy generated by this data source always contains a bucket resource with "arn:aws:s3::..."
As a result, Terraform will error with a "api error MalformedPolicy: Policy has invalid resource" error.
Example usage
data "orcasecurity_integration_s3_bucket_policy" "this" {
arn_or_url = "arn:aws-us-gov:s3:::my-bucket-name"
}
Example Result
NOTE: In resource ARN, the "aws-us-gov" partition has been replaced by "aws".
{
"Action": [
"s3:PutObject",
"s3:PutObjectAcl"
],
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control"
}
},
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws-us-gov:iam::247207723357:role/integrations_s3_uploader"
},
"Resource": "arn:aws:s3:::my-bucket-name/*"
}
Expected Result
"Statement": [
{
"Action": [
"s3:PutObject",
"s3:PutObjectAcl"
],
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control"
}
},
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws-us-gov:iam::247207723357:role/integrations_s3_uploader"
},
"Resource": "arn:aws-us-gov:s3:::my-bucket-name/*"
}
Problem
When using the integration_s3_bucket_policy data source in AWS GovCloud, the policy generated by the data source only seems to support the AWS commercial partition (aws). The policy generated by this data source always contains a bucket resource with "arn:aws:s3::..."
As a result, Terraform will error with a "api error MalformedPolicy: Policy has invalid resource" error.
Example usage
Example Result
NOTE: In resource ARN, the "aws-us-gov" partition has been replaced by "aws".
Expected Result