20
20
- [ Bootstrapping Recommendations] ( #bootstrapping-recommendations )
21
21
- [ Pipelines] ( #pipelines )
22
22
- [ Pipeline Parameters] ( #pipeline-parameters )
23
- - [ Using CodeStar Connections for Bitbucket, GitHub, or GitHub
24
- Enterprise ] ( #using-codestar-connections -for-bitbucket-github-or-github-enterprise )
25
- - [ Using GitHub with an OAuth token ] ( #using-github-with-an-oauth-token )
23
+ - [ Using AWS CodeConnections for Bitbucket, GitHub, or
24
+ GitLab ] ( #using-aws-codeconnections -for-bitbucket-github-or-gitlab )
25
+ - [ AWS CodeStar Connection ] ( #aws-codestar-connection )
26
26
- [ Chaining Pipelines] ( #chaining-pipelines )
27
27
- [ Service Control Policies] ( #service-control-policies )
28
28
- [ Tagging Policies] ( #tagging-policies )
@@ -282,7 +282,8 @@ SCPs or CloudFormation templates that ADF will apply.
282
282
The Deployment Account is the gatekeeper for all deployments throughout an
283
283
Organization. Once the baselines have been applied to your accounts via the
284
284
bootstrapping process, the Deployment account connects the dots by taking
285
- source code and resources from a repository _(e.g. GitHub, CodeCommit or S3)_
285
+ source code and resources from a repository _(e.g. CodeCommit, S3, or external
286
+ via AWS CodeConnections or an AWS CodeStar Connection)_
286
287
and into the numerous target accounts and regions as defined in the deployment
287
288
map files via AWS CodePipeline.
288
289
@@ -557,15 +558,15 @@ pipelines:
557
558
558
559
Here is an example of passing in a parameter to a pipeline to override the
559
560
default branch that is used to trigger the pipeline from, this time using
560
- a CodeStar Connection to Bitbucket, GitHub, or GitHub Enterprise as a source
561
- _(No need for `source_account_id`)_.
561
+ an AWS CodeConnections link to Bitbucket, GitHub, or GitLab as a
562
+ source _(No need for `source_account_id`)_.
562
563
563
564
` ` ` yaml
564
565
pipelines:
565
566
- name: vpc # The GitHub repo would have this name
566
567
default_providers:
567
568
source:
568
- provider: codestar
569
+ provider: codeconnections
569
570
properties:
570
571
branch: dev/feature
571
572
# Optional, name property will be used if repository is not specified
@@ -580,7 +581,7 @@ pipelines:
580
581
# It is recommended to add a Tag like CreatedBy with the user that
581
582
# created it. So it is clear this parameter is not managed by ADF
582
583
# itself.
583
- codestar_connection_path : /adf/my_codestar_connection_param
584
+ code_connection_path : /adf/my_aws_codeconnections_param
584
585
targets:
585
586
- /security # Shorthand example
586
587
` ` `
@@ -629,50 +630,63 @@ globally unique we need some way to define which bucket we want to deploy our
629
630
` output.zip` into at a stage level. The way we accomplish this is we can pass
630
631
in `properties` in the form of `key/value` into the stage itself.
631
632
632
- # ### Using CodeStar Connections for Bitbucket, GitHub, or GitHub Enterprise
633
+ # ### Using AWS CodeConnections for Bitbucket, GitHub, or GitLab
633
634
634
- **Please note:** This is the preferred method to setup GitHub as your source
635
- provider.
635
+ **Please note:** This is the preferred method to setup external sources.
636
+ If you have configured an AWS CodeStar Connection before and wonder how-to
637
+ set it up again, please read the [AWS CodeStar Connection
638
+ steps](#aws-codestar-connection).
636
639
637
- **Prerequisite:** To enable CodeStar Connections to be used the following step
638
- is required :
640
+ **Prerequisite:** To enable AWS CodeConnections to be used the following steps
641
+ are required :
639
642
640
- - Rename file `example-global-iam.yml` to `global-iam.yml` in the following
641
- path `aws-deployment-framework-bootstrap/adf-bootstrap/deployment/` and
642
- ensure the CloudFormation resources `CodeStarConnectionPolicy` is no longer
643
- commented out.
644
- **Please note:** the use of `deployment` at the end)
643
+ - Navigate to the `aws-deployment-framework-bootstrap` repository, specifically
644
+ the `/adf-bootstrap/deployment/` folder (notice the `deployment` OU folder at
645
+ the end).
646
+ - There should be a `global-iam.yml` file in that folder. If not, please rename
647
+ or copy the `example-global-iam.yml` file to `global-iam.yml` to proceed.
648
+ - Inside the `global-iam.yml` file ensure the CloudFormation resources
649
+ named `CodeConnectionsPolicy` is no longer commented out.
645
650
646
- **Important note**: `CodeStarConnectionPolicy ` IAM policy is a sample.
651
+ **Important note**: `CodeConnectionsPolicy ` IAM policy is a sample.
647
652
Please make sure you update this policy and scope it properly for the use cases
648
653
you want to support.
649
654
650
- In order for a pipeline to be connected to Bitbucket, GitHub, or GitHub
651
- Enterprise you will need to setup an CodeStar Connection first.
655
+ In order for a pipeline to be connected to Bitbucket, GitHub, or GitLab
656
+ you will need to setup AWS CodeConnections first.
652
657
Please follow the [steps as described in the AWS Developer Tools
653
658
documentation](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections.html)
654
- on how-to setup a new Connection with your code repository.
659
+ on how-to setup a new connection with your code repository.
655
660
656
661
Once the connection is created you can store the Connection ARN into
657
662
the Deployment Account with AWS Systems Manager Parameter Store.
658
663
664
+ Before you proceed, please check the Connection ARN of the connection you
665
+ configured. Depending on the method and creation time of the connection it
666
+ might have created a CodeStar Connection instead. If it did, the ARN will
667
+ include the `codestar` keyword. If so, please proceed with the steps described
668
+ in the [AWS CodeStar Connection](#aws-codestar-connection) first before you
669
+ continue.
670
+
659
671
Please use the `/adf/` prefix for this parameter. For example :
660
672
` /adf/my_source_connection_param`
661
673
As ADF has read access to parameters that start with `/adf/`.
662
674
663
- Once the values are stored, you can create the Repository in GitHub as per
664
- normal. Once its created you no further steps are required on GitHub's side,
665
- just update your [deployment map](user-guide.md#deployment-map) to use the new
666
- source type and push to the deployment account. Here is an example of a
667
- deployment map with a single pipeline from GitHub, in this case the repository
668
- on GitHub must be named 'vpc'.
675
+ Once the values are stored, you can create the Repository in your external
676
+ source provider (Bitbucket, GitHub, or GitLab) as per normal.
677
+ Once the repository is ready, no further steps are required on the external
678
+ source provider's side, just update your
679
+ [deployment map](user-guide.md#deployment-map) to use the new source type and
680
+ push to the deployment account. Here is an example of a
681
+ deployment map with a single pipeline from an external source provider, in this
682
+ case the external repository must be named 'vpc'.
669
683
670
684
` ` ` yaml
671
685
pipelines:
672
686
- name: vpc
673
687
default_providers:
674
688
source:
675
- provider: github
689
+ provider: codeconnections
676
690
properties:
677
691
# Optional, name property will be used if repository is not specified
678
692
repository: example-vpc
@@ -688,56 +702,57 @@ pipelines:
688
702
# itself.
689
703
#
690
704
# Example content of the parameter, plain ARN as a simple string:
691
- # arn:aws:codestar-connections :eu-west-1:111111111111:connection/11111111-2222-3333-4444-555555555555
692
- codestar_connection_path : /adf/my_github_connection_arn_param
705
+ # arn:aws:codeconnections :eu-west-1:111111111111:connection/11111111-2222-3333-4444-555555555555
706
+ codeconnections_param_path : /adf/my_github_connection_arn_param
693
707
targets:
694
708
- /security
695
709
` ` `
696
710
697
- # ### Using GitHub With An OAuth Token
698
-
699
- **Important note:** Before you continue. It is important to understand that
700
- this method is not advised to be used by CodePipeline. Instead, please follow
701
- the instructions to setup a CodeStar connection to pull the code from GitHub.
702
- Please read the [Using CodeStar Connections for Bitbucket, GitHub, or GitHub
703
- Enterprise section](#using-codestar-connections-for-bitbucket-github-or-github-enterprise).
704
-
705
- In order for a pipeline to be connected to GitHub you will need to create a
706
- Personal Access Token in GitHub that allows its connection to AWS CodePipeline.
707
- You can read more about creating a Token
708
- [here](https://docs.aws.amazon.com/codepipeline/latest/userguide/GitHub-rotate-personal-token-CLI.html).
709
- Once the token has been created you can store that in AWS Secrets Manager on
710
- the Deployment Account. The Webhook Secret is a value you define and store in
711
- AWS Secrets Manager with a path of `/adf/my_teams_token`. By Default, ADF only
712
- has read access to Secrets with a path that starts with `/adf/`.
713
-
714
- Once the values are stored, you can create the Repository in GitHub as per
715
- normal. Once its created you do not need to do anything else on GitHub's side
716
- just update your [deployment map](user-guide.md#deployment-map) to use the new
717
- source type and push to the deployment account. Here is an example of a
718
- deployment map with a single pipeline from GitHub, in this case the repository
719
- on GitHub must be named 'vpc'.
720
-
721
- ` ` ` yaml
722
- pipelines:
723
- - name: vpc
724
- default_providers:
725
- source:
726
- provider: github
727
- properties:
728
- # Optional, name property will be used if repository is not specified
729
- repository: example-vpc
730
- owner: bundyfx
731
- # The path in AWS Secrets Manager that holds the GitHub Oauth token,
732
- # ADF only has access to /adf/ prefix in Secrets Manager
733
- oauth_token_path: /adf/github_token
734
- # The field (key) name of the json object stored in AWS Secrets
735
- # Manager that holds the Oauth token.
736
- # e.g. {"token": "123"}
737
- json_field: token
738
- targets:
739
- - /security
740
- ` ` `
711
+ # ### AWS CodeStar Connection
712
+
713
+ **Please note:** Only proceed with the steps in this document if you have an
714
+ existing AWS CodeStar Connection you like to maintain. With the [announcement
715
+ of the AWS CodeStar Connection to AWS CodeConnections name
716
+ change](https://aws.amazon.com/about-aws/whats-new/2024/03/aws-codeconnections-formerly-codestar-connections/)
717
+ the preferred method to link GitHub, GitLab, Bitbucket, and other sources is
718
+ AWS CodeConnections. You do not need to replace the AWS CodeStar Connection
719
+ with an AWS CodeConnections resource if you have one already. According to the
720
+ service documentation it will continue to be supported via the new AWS
721
+ CodeConnections API without requiring further changes in ADF's config or the
722
+ deployment maps.
723
+
724
+ If you are about to setup a new connection to an external source code provider,
725
+ please consider following the [AWS CodeConnections
726
+ steps](#using-aws-codeconnections-for-bitbucket-github-or-gitlab)
727
+ instead.
728
+
729
+ **Prerequisite:** To enable an AWS CodeStar Connection to be used the following
730
+ steps are required :
731
+
732
+ - Navigate to the `aws-deployment-framework-bootstrap` repository, specifically
733
+ the `/adf-bootstrap/deployment/` folder (notice the `deployment` OU folder at
734
+ the end).
735
+ - There should be a `global-iam.yml` file in that folder. If not, please rename
736
+ or copy the `example-global-iam.yml` file to `global-iam.yml` to proceed.
737
+ - Inside the `global-iam.yml` file ensure the CloudFormation resources
738
+ named `CodeConnectionsPolicy` is no longer commented out.
739
+ - Also make sure the CodeStar actions are no longer commented out.
740
+
741
+ **Important note**: `CodeConnectionsPolicy` IAM policy is a sample.
742
+ Please make sure you update this policy and scope it properly for the use cases
743
+ you want to support. We recommend that you leave this policy name as
744
+ ` CodeConnectionsPolicy` , even though you are setting up a
745
+ ` CodeStar Connection` . This will make it easier to detect required updates if
746
+ these would-be introduced by future ADF versions.
747
+
748
+ The remaining steps are the same as configuring an AWS CodeConnections
749
+ setup. So please follow the next steps as documented in the
750
+ [Using AWS CodeConnections for Bitbucket, GitHub, or GitLab
751
+ section](#using-aws-codeconnections-for-bitbucket-github-or-gitlab).
752
+
753
+ **Please note: While the AWS CodeConnections source provider name is
754
+ ` codeconnections` , if the configured connection ARN refers to an AWS CodeStar
755
+ Connection it will set that up instead.
741
756
742
757
# ### Chaining Pipelines
743
758
0 commit comments