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

feat(aws-codepipeline): Pipeline now accepts existing IAM role #2587

Merged
merged 4 commits into from
May 21, 2019
Merged

feat(aws-codepipeline): Pipeline now accepts existing IAM role #2587

merged 4 commits into from
May 21, 2019

Conversation

AlexChesters
Copy link
Contributor

@AlexChesters AlexChesters commented May 20, 2019

Originally submitted as #2573, only this time without a horrible git history 😄

Fixes #2572.

Pull Request Checklist

  • [N/A] Testing
    • As this feature is very similar to the existing pattern of artifacts bucket, which isn't unit tested as far as I can see, I didn't add, modify or remove any existing unit tests.
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
    • Design: For significant features, design document added to design folder
  • Title and Description
    • Change type: title prefixed with fix, feat and module name in parens, which will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • [N/A] Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

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

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

Please add a test as well.

* The IAM role to be assumed by this Pipeline.
* If not specified, a new IAM role will be created.
*/
readonly role?: iam.Role;
Copy link
Contributor

Choose a reason for hiding this comment

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

IRole

@@ -68,6 +68,12 @@ export interface PipelineProps {
*/
readonly artifactBucket?: s3.IBucket;

/**
* The IAM role to be assumed by this Pipeline.
* If not specified, a new IAM role will be created.
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a @default marker in the docs to indicate the default behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rix0rrr do you have an example of the @default format that's expected? I'm not familiar with it, and I can't see where this is used anywhere else in this file

Copy link
Contributor

Choose a reason for hiding this comment

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

Here is an example:

https://github.com/awslabs/aws-cdk/blob/master/packages/@aws-cdk/aws-lambda/lib/function.ts#L115

I would not copy the second line "Both supplied and generated...". That feature is a pattern all over the library that can be assumed and doesn't have to be documented in every location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, done that. How does it look?

@rix0rrr rix0rrr changed the title feat(aws-codepipeline): #2572 allow IAM Role to be passed to Pipeline feat(aws-codepipeline): Pipeline now accepts existing IAM role May 20, 2019
@rix0rrr rix0rrr self-assigned this May 20, 2019
@AlexChesters
Copy link
Contributor Author

AlexChesters commented May 20, 2019

Please add a test as well.

@rix0rrr sure 😄 - anything in particular that you'd want to be covered by this test? I'd copy from something like artifactBucket but that doesn't appear to be tested currently

@rix0rrr
Copy link
Contributor

rix0rrr commented May 20, 2019

@rix0rrr sure smile - anything in particular that you'd want to be covered by this test

Yes, that if a role is passed in, it is referenced by the pipeline.

@AlexChesters
Copy link
Contributor Author

@rix0rrr cool, I'll get on that - thanks!

@AlexChesters
Copy link
Contributor Author

@rix0rrr I've added a test, mind having a look over and seeing what you think? I didn't think it fit into any of the existing test files so I created a new one

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.

CodePipeline should allow you to pass an IAM Role
2 participants