-
Notifications
You must be signed in to change notification settings - Fork 232
feat: AWS CodeCommit support #2035
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
Open
taraspos
wants to merge
1
commit into
fluxcd:main
Choose a base branch
from
taraspos:taras/aws-codecommit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -245,6 +245,7 @@ used for authentication purposes. | |||||||||||
| Supported options are: | ||||||||||||
|
|
||||||||||||
| - `generic` | ||||||||||||
| - `aws` | ||||||||||||
| - `azure` | ||||||||||||
| - `github` | ||||||||||||
|
|
||||||||||||
|
|
@@ -254,6 +255,64 @@ mechanisms using `spec.secretRef` are used for authentication. | |||||||||||
| For a complete guide on how to set up authentication for cloud providers, | ||||||||||||
| see the integration [docs](/flux/integrations/). | ||||||||||||
|
|
||||||||||||
| #### AWS | ||||||||||||
|
|
||||||||||||
| The `aws` provider can be used to authenticate to | ||||||||||||
| [AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) | ||||||||||||
| repositories using IAM credentials sourced from the controller runtime identity. | ||||||||||||
|
|
||||||||||||
| **Note:** When the `aws` provider is used, `.spec.url` must be an AWS | ||||||||||||
| CodeCommit HTTPS endpoint in the format | ||||||||||||
| `https://git-codecommit.<region>.amazonaws.com/v1/repos/<repository-name>`. | ||||||||||||
| For a full list of available regions and their endpoints, see the | ||||||||||||
| [AWS CodeCommit regions documentation](https://docs.aws.amazon.com/codecommit/latest/userguide/regions.html#regions-git). | ||||||||||||
|
|
||||||||||||
| ##### Pre-requisites | ||||||||||||
|
|
||||||||||||
| - An EKS cluster with either | ||||||||||||
| [EKS Pod Identity](https://fluxcd.io/flux/integrations/aws/#with-eks-pod-identity) | ||||||||||||
| or | ||||||||||||
| [IAM Roles for Service Accounts (IRSA)](https://fluxcd.io/flux/integrations/aws/#with-oidc-federation) | ||||||||||||
| configured. | ||||||||||||
| - An IAM role with the `codecommit:GitPull` permission for the target | ||||||||||||
| repository. | ||||||||||||
|
|
||||||||||||
| ##### Configure Flux controller | ||||||||||||
|
|
||||||||||||
| 1. Configure authentication using your preferred method - https://fluxcd.io/flux/integrations/aws/#authentication. | ||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
|
||||||||||||
| Example IAM role policy: | ||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
|
||||||||||||
| ```json | ||||||||||||
| { | ||||||||||||
| "Version": "2012-10-17", | ||||||||||||
| "Statement": [ | ||||||||||||
| { | ||||||||||||
| "Effect": "Allow", | ||||||||||||
| "Action": "codecommit:GitPull", | ||||||||||||
| "Resource": "arn:aws:codecommit:<region>:<account-id>:<repository-name>" | ||||||||||||
| } | ||||||||||||
| ] | ||||||||||||
| } | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| 2. Configure AWS CodeCommit `GitRepository` | ||||||||||||
|
|
||||||||||||
| ```yaml | ||||||||||||
| --- | ||||||||||||
| apiVersion: source.toolkit.fluxcd.io/v1 | ||||||||||||
| kind: GitRepository | ||||||||||||
| metadata: | ||||||||||||
| name: codecommit-repository | ||||||||||||
| namespace: flux-system | ||||||||||||
| spec: | ||||||||||||
| interval: 5m0s | ||||||||||||
| provider: aws | ||||||||||||
| url: https://git-codecommit.<region>.amazonaws.com/v1/repos/<repository-name> | ||||||||||||
|
Comment on lines
+310
to
+311
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| ref: | ||||||||||||
| branch: main | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| #### Azure | ||||||||||||
|
|
||||||||||||
| The `azure` provider can be used to authenticate to Azure DevOps repositories | ||||||||||||
|
|
||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 section needs a bit more color like the Azure one. Doesn't need too much detail, though, as those docs should be mostly pointing at https://fluxcd.io/flux/integrations/ by now
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.
@taraspos I don't see any pointers to the integrations docs
Uh oh!
There was an error while loading. Please reload this page.
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, sorry. Had to switch to something else and didn't finish the doc. Just push updated and simplified version.
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.
@matheuscscp I didn't have a chance to test object level workload identity yet.
I will try to find time to do so tomorrow, and then we can merge this.