GitHubSourceCodeProvider

class aws_cdk.aws_amplify.GitHubSourceCodeProvider(*, oauth_token, owner, repository)

Bases: object

(experimental) GitHub source code provider.

Stability

experimental

Example:

# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_codebuild as codebuild
import aws_cdk.aws_amplify as amplify
import aws_cdk.core as cdk

amplify_app = amplify.App(self, "MyApp",
    source_code_provider=amplify.GitHubSourceCodeProvider(
        owner="<user>",
        repository="<repo>",
        oauth_token=cdk.SecretValue.secrets_manager("my-github-token")
    ),
    build_spec=codebuild.BuildSpec.from_object_to_yaml({ # Alternatively add a `amplify.yml` to the repo
        "version": "1.0",
        "frontend": {
            "phases": {
                "pre_build": {
                    "commands": ["yarn"
                    ]
                },
                "build": {
                    "commands": ["yarn build"
                    ]
                }
            },
            "artifacts": {
                "base_directory": "public",
                "files": -"**/*"
            }
        }})
)
Parameters
  • oauth_token (SecretValue) – (experimental) A personal access token with the repo scope.

  • owner (str) – (experimental) The user or organization owning the repository.

  • repository (str) – (experimental) The name of the repository.

Stability

experimental

Methods

bind(_app)

(experimental) Binds the source code provider to an app.

Parameters

_app (App) –

Stability

experimental

Return type

SourceCodeProviderConfig