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

Ability to use codestar sources in deployment map #312

Merged
merged 3 commits into from
Apr 9, 2021

Conversation

ivan-aws
Copy link
Contributor

Issue #, if available:

Description of changes:
Added the ability to use AWS Codestar as the source for pipelines defined in the deployment map.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Collaborator

@sbkok sbkok left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution!
I've reviewed the code, a few small changes are required to get this merged.

properties:
repository: my-ecs-app # Optional, above name property will be used if this is not specified
owner: github-enterprise-team-org
codestar_connection_path: /ghes/connection1/arn # The path in AWS Systems Manager Parameter Store that holds the AWS CodeStar Connection arn
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like a path used in an organization. Can you make it easier to read so people will understand they can change the value to their own preference? In its current form it looks like I cannot change it, while you can, am I right?

Choose a reason for hiding this comment

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

yes, this is path is arbitrary. will update it to /path/to/parameter

owner: github-enterprise-team-org
codestar_connection_path: /ghes/connection1/arn # The path in AWS Systems Manager Parameter Store that holds the AWS CodeStar Connection arn
params:
notification_endpoint: [email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

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

To prevent spam and mixing different email examples in our code base, can you change this to [email protected]?

params:
notification_endpoint: [email protected]
targets:
- [ /ecoin/testing, /ephone/testing ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, can you change this to be more generic?

try:
response = ssm_client.get_parameter(Name=codestar_connection_path)
except Exception as e:
print(f"No parameter found at {codestar_connection_path}. Check the path/value.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you change this print to use the logger instead. Like we do here? But using error instead.

@@ -436,6 +436,10 @@ Resources:
Resource:
- !Sub arn:aws:codepipeline:${AWS::Region}:${AWS::AccountId}:webhook:adf-webhook-*
- !Sub arn:aws:codepipeline:${AWS::Region}:${AWS::AccountId}:${PipelinePrefix}*
- Effect: Allow
Action:
- "codestar-connections:*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you change this to list the actions that it really needs, instead of all?

- Effect: Allow
Sid: "AllowCodeStarConnections"
Action:
- "codestar-connections:*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, please list the exact actions this policy will need.

The AWS CodeStar connection needs to already exist and be in the "Available" Status. To use the AWS CodeStar Connection with ADF, its arn needs to be stored in AWS Systems Manager Parameter Store in the deployment account's main region (see details below). Read the CodePipeline documentation for more [information on how to setup the connection](https://docs.aws.amazon.com/dtconsole/latest/userguide/getting-started-connections.html).

Provider type: `codestar`.
#### Properties
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a newline above the Properties title here?

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@sbkok sbkok left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for updating the PR and submitting these changes!

@sbkok sbkok added this to the v3.2.0 milestone Mar 11, 2021
@sbkok sbkok added the enhancement New feature or request label Mar 11, 2021
Copy link

@deltagarrett deltagarrett left a comment

Choose a reason for hiding this comment

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

LGTM and thanks for this contribution @ivan-aws !

@sbkok sbkok merged commit aeedc8e into awslabs:master Apr 9, 2021
@ivan-aws ivan-aws deleted the github_enterprise branch December 28, 2021 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants