1

I'm working off of the Cloudformation stack from this tutorial:

https://aws.amazon.com/blogs/compute/continuous-deployment-for-serverless-applications/

It creates a pipeline with a CodeCommit repository as a source. I'd like to switch this to a Github repository. Here's the code that is defining this resource:

 Pipeline:
        Type: AWS::CodePipeline::Pipeline
        Properties:
            ArtifactStore: 
                Location: !Ref BuildArtifactsBucket
                Type: S3
            Name: !Sub ${ServiceName}_pipeline
            RoleArn: !GetAtt PipelineExecutionRole.Arn
            Stages:
                - Name: Source
                  Actions:
                    - Name: CodeCommitRepo
                      ActionTypeId:
                        Category: Source
                        Owner: AWS
                        Provider: CodeCommit
                        Version: 1
                      Configuration:
                        RepositoryName: !Sub '${ServiceName}_repo'
                        BranchName: master
                      OutputArtifacts:
                        - Name: SourceZip
                      RunOrder: 1

How is GitHub defined as a resource and how is the authentication handled for a private repository?

1 Answer 1

3

For github you need to replace provider with github for example

 Pipeline:
        Type: AWS::CodePipeline::Pipeline
        Properties:
            ArtifactStore: 
                Location: !Ref BuildArtifactsBucket
                Type: S3
            Name: !Sub ${ServiceName}_pipeline
            RoleArn: !GetAtt PipelineExecutionRole.Arn
            Stages:
                - Name: Source
                  Actions:
                    - Name: GithubRepo
                      ActionTypeId:
                        Category: Source
                        Owner: ThirdParty
                        Provider: GitHub
                        Version: 1
                      Configuration:
                        "Owner": "MyGitHubAccountName",
                        "Repo": "MyGitHubRepositoryName",
                        "PollForSourceChanges": "false",
                        "Branch": "master",
                        "OAuthToken": "****"

                      OutputArtifacts:
                        - Name: SourceZip
                      RunOrder: 1

For more information click on

code pipeline thirdparty source provider

Here, is how to get github personal token and insert it to your code pipeline

github personal token intergration into code pipeline

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.