-
Notifications
You must be signed in to change notification settings - Fork 151
[sdlf-cicd] extract create_repository into new file, add API-support gitlab #543
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
Conversation
21a8543 to
d2eb1ad
Compare
d2eb1ad to
1ea4c74
Compare
docs/constructs/cicd.md
Outdated
|
|
||
| - `/SDLF/GitLab/Url` :: secure-string :: GitLab URL **with** trailing `/` | ||
| - `/SDLF/GitLab/AccessToken` :: secure-string :: User access token | ||
| - `/SDLF/GitLab/NamespaceId` :: string :: User/Enterprise namespace ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be secure-string
| - `/SDLF/GitLab/Url` :: secure-string :: GitLab URL **with** trailing `/` | ||
| - `/SDLF/GitLab/AccessToken` :: secure-string :: User access token | ||
| - `/SDLF/GitLab/NamespaceId` :: string :: User/Enterprise namespace ID | ||
| - `/SDLF/GitLab/CodeConnection` :: string :: CodeConnections ARN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this now be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need to connection to the codepipeline. I did not remove it to ensure the pipeline can read the gitlab repo as source (search for "{{resolve:ssm:/SDLF/${pGitPlatform}/CodeConnection}}" in the code)
7dfe0b5 to
e092b9c
Compare
| - !Sub "{{resolve:ssm:/SDLF/KMS/${pTeamName}/InfraKeyId:1}}" | ||
| - !Sub "{{resolve:ssm:/SDLF/KMS/${pTeamName}/DataKeyId:1}}" | ||
| - !Sub "{{resolve:ssm:/SDLF2/KMS/KeyArn:1}}" | ||
| - "{{resolve:ssm:/SDLF2/KMS/KeyArn:1}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is nothing to replace using Sub, it should just resolve the SSM name. In the other 2 SSM params we are replacing pTeamName using Sub
| ssm = boto3.client("ssm", endpoint_url=ssm_endpoint_url) | ||
| codecommit_endpoint_url = "https://codecommit." + os.getenv("AWS_REGION") + ".amazonaws.com" | ||
| codecommit = boto3.client("codecommit", endpoint_url=codecommit_endpoint_url) | ||
| cloudformation_endpoint_url = "https://cloudformation." + os.getenv("AWS_REGION") + ".amazonaws.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - is this needed? wouldn't the default endpoint be the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the same way of defining endpoints are before, you can check sdlf-cicd/lambda/domain-cicd/src/lambda_function.py
Issue #, if available:
The CloudFormation resources for GitLab projects have some limitations and require hardcoded names for the namespaces/users.
Description of changes:
Refactored the lambda_function that creates the team repositories: moved creation logic outside of the lambda_handler file. Created a function for each git provider. In the GitLab provider, added API-first approach.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.