RepositoryProps

class aws_cdk.aws_codecommit.RepositoryProps(*, repository_name, code=None, description=None)

Bases: object

Parameters
  • repository_name (str) – Name of the repository. This property is required for all CodeCommit repositories.

  • code (Optional[Code]) – The contents with which to initialize the repository after it has been created. Default: - No initialization (create empty repo)

  • description (Optional[str]) – A description of the repository. Use the description to identify the purpose of the repository. Default: - No description.

ExampleMetadata

lit=test/integ.cfn-template-from-repo.lit.ts infused

Example:

# Source stage: read from repository
repo = codecommit.Repository(stack, "TemplateRepo",
    repository_name="template-repo"
)
source_output = codepipeline.Artifact("SourceArtifact")
source = cpactions.CodeCommitSourceAction(
    action_name="Source",
    repository=repo,
    output=source_output,
    trigger=cpactions.CodeCommitTrigger.POLL
)
source_stage = {
    "stage_name": "Source",
    "actions": [source]
}

# Deployment stage: create and deploy changeset with manual approval
stack_name = "OurStack"
change_set_name = "StagedChangeSet"

prod_stage = {
    "stage_name": "Deploy",
    "actions": [
        cpactions.CloudFormationCreateReplaceChangeSetAction(
            action_name="PrepareChanges",
            stack_name=stack_name,
            change_set_name=change_set_name,
            admin_permissions=True,
            template_path=source_output.at_path("template.yaml"),
            run_order=1
        ),
        cpactions.ManualApprovalAction(
            action_name="ApproveChanges",
            run_order=2
        ),
        cpactions.CloudFormationExecuteChangeSetAction(
            action_name="ExecuteChanges",
            stack_name=stack_name,
            change_set_name=change_set_name,
            run_order=3
        )
    ]
}

codepipeline.Pipeline(stack, "Pipeline",
    stages=[source_stage, prod_stage
    ]
)

Attributes

code

The contents with which to initialize the repository after it has been created.

Default
  • No initialization (create empty repo)

Return type

Optional[Code]

description

A description of the repository.

Use the description to identify the purpose of the repository.

Default
  • No description.

Return type

Optional[str]

repository_name

Name of the repository.

This property is required for all CodeCommit repositories.

Return type

str