Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use partition pseudo variable for compatibility with gov-cloud #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeremygiberson-at-privoro
Copy link

@jeremygiberson-at-privoro jeremygiberson-at-privoro commented Oct 12, 2020

When deploying into AWS GovCloud, the ARN uses a different partition value. I believe this is also true for china regions as well.
When trying to create alarm resources, cloudformation update will fail with one of the event errors being:

Invalid partition aws specified. Only aws-us-gov is supported. (Service: AmazonCloudWatch; Status Code: 400; Error Code: ValidationError; Request ID: 50120a93-12b8-40cb-bd3b-65266f0491f9; Proxy: null)

In order to accommodate deployments to these special regions you should use the AWS::Partition cloud formation pseudo parameters instead. The appropriate value will be filled in.

Before the change:

"AlarmActions": [
          {
            "Fn::Join": [
              "",
              [
                "arn:aws:sns:us-gov-east-1:",
                {
                  "Ref": "AWS::AccountId"
                },
                ":undefined"
              ]
            ]
          }
        ],

After the change

"AlarmActions": [
          {
            "Fn::Join": [
              "",
              [
                "arn:", 
               {
                  "Ref": "AWS::Partition"
                },
                ,":sns:us-gov-east-1:",
                {
                  "Ref": "AWS::AccountId"
                },
                ":undefined"
              ]
            ]
          }
        ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant