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

fix(synthetics): default execution role breaks in non aws partitions #12096

Merged
merged 4 commits into from
Jan 21, 2021
Merged

fix(synthetics): default execution role breaks in non aws partitions #12096

merged 4 commits into from
Jan 21, 2021

Conversation

Khufu-I
Copy link
Contributor

@Khufu-I Khufu-I commented Dec 15, 2020

Canary default execution role should be partition aware instead of hardcoding aws.

Fixes #12094


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Dec 15, 2020

@github-actions github-actions bot added the @aws-cdk/aws-synthetics Related to Amazon CloudWatch Synthetics label Dec 15, 2020
Canary default execution role should be partition aware instead of
hardcoding aws.

Fixes #12094
@Khufu-I
Copy link
Contributor Author

Khufu-I commented Jan 5, 2021

Is there anything else that needs to be done to get this merged?

@Khufu-I
Copy link
Contributor Author

Khufu-I commented Jan 13, 2021

@NetaNir could we get this fix merged?

@@ -309,6 +309,7 @@ export class Canary extends cdk.Resource {
* Returns a default role for the canary
*/
private createDefaultRole(prefix?: string): iam.IRole {
const { partition } = cdk.Stack.of(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stack.of returns the encompassing stack, not the partition. This should be:

cdk.Stack.of(this).partition

Was this change successfully deployed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using object destructuring to only select the partition from the returned stack object similar to this code. I've run the tests successfully but I've not deployed this exact CR to AWS Cloudformation. Could we merge without doing a deployment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How were you able to update the integ.canary.expected.json file without deploying it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the update based on similar changes I made to my Cloudformation project and deployed to AWS. I'm new to this Github repository so I'm not sure how to reference an unpublished version of AWS CDK from Github and deploy to my AWS account.

Copy link
Contributor

@NetaNir NetaNir Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file needs to be updated by executing the integration test - not manually. The stack defined integ.canary.ts will be deployed and if successful the expectation file will be updated.

From the @aws-cdk/aws-synthetics folder, executing:

yarn integ integ.canary.js

Will deploy the stack and afterward update the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for walking me through the process. I successfully deployed the changes to my AWS account and the integration test passed succesfully

gitpod /workspace/aws-cdk/packages/@aws-cdk/aws-synthetics $ yarn integ integ.canary.js      
  yarn run v1.22.5            
    $ cdk-integ integ.canary.js                  
      Synthesizing integ.canary.js.                        
        Selected stack: canary-one                              
          Deploying integ.canary.js...                                    
            Deployment succeeded, updating snapshot.
Cleaning up.
Done in 129.24s.

There were no additional changes after the snapshot was updated.

@mergify mergify bot dismissed NetaNir’s stale review January 20, 2021 06:43

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Jan 21, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 806f5f9
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jan 21, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit c01272c into aws:master Jan 21, 2021
mohanrajendran pushed a commit to mohanrajendran/aws-cdk that referenced this pull request Jan 24, 2021
…ws#12096)

Canary default execution role should be partition aware instead of hardcoding aws.

Fixes aws#12094


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-synthetics Related to Amazon CloudWatch Synthetics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(synthetics): Default role breaks in non aws partitions
3 participants