package awscodepipelineactions import ( "github.com/aws/aws-cdk-go/awscdk/v2/awscodecommit" "github.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline" "github.com/aws/aws-cdk-go/awscdk/v2/awsiam" ) // Construction properties of the `CodeCommitSourceAction CodeCommit source CodePipeline Action`. // // Example: // // Source stage: read from repository // repo := codecommit.NewRepository(stack, jsii.String("TemplateRepo"), &RepositoryProps{ // RepositoryName: jsii.String("template-repo"), // }) // sourceOutput := codepipeline.NewArtifact(jsii.String("SourceArtifact")) // source := cpactions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{ // ActionName: jsii.String("Source"), // Repository: repo, // Output: sourceOutput, // Trigger: cpactions.CodeCommitTrigger_POLL, // }) // sourceStage := map[string]interface{}{ // "stageName": jsii.String("Source"), // "actions": []CodeCommitSourceAction{ // source, // }, // } // // // Deployment stage: create and deploy changeset with manual approval // stackName := "OurStack" // changeSetName := "StagedChangeSet" // // prodStage := map[string]interface{}{ // "stageName": jsii.String("Deploy"), // "actions": []interface{}{ // cpactions.NewCloudFormationCreateReplaceChangeSetAction(&CloudFormationCreateReplaceChangeSetActionProps{ // "actionName": jsii.String("PrepareChanges"), // "stackName": jsii.String(stackName), // "changeSetName": jsii.String(changeSetName), // "adminPermissions": jsii.Boolean(true), // "templatePath": sourceOutput.atPath(jsii.String("template.yaml")), // "runOrder": jsii.Number(1), // }), // cpactions.NewManualApprovalAction(&ManualApprovalActionProps{ // "actionName": jsii.String("ApproveChanges"), // "runOrder": jsii.Number(2), // }), // cpactions.NewCloudFormationExecuteChangeSetAction(&CloudFormationExecuteChangeSetActionProps{ // "actionName": jsii.String("ExecuteChanges"), // "stackName": jsii.String(stackName), // "changeSetName": jsii.String(changeSetName), // "runOrder": jsii.Number(3), // }), // }, // } // // codepipeline.NewPipeline(stack, jsii.String("Pipeline"), &PipelineProps{ // Stages: []stageProps{ // sourceStage, // prodStage, // }, // }) // type CodeCommitSourceActionProps struct { // The physical, human-readable name of the Action. // // Note that Action names must be unique within a single Stage. ActionName *string `field:"required" json:"actionName" yaml:"actionName"` // The runOrder property for this Action. // // RunOrder determines the relative order in which multiple Actions in the same Stage execute. // See: https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html // RunOrder *float64 `field:"optional" json:"runOrder" yaml:"runOrder"` // The name of the namespace to use for variables emitted by this action. VariablesNamespace *string `field:"optional" json:"variablesNamespace" yaml:"variablesNamespace"` // The Role in which context's this Action will be executing in. // // The Pipeline's Role will assume this Role // (the required permissions for that will be granted automatically) // right before executing this Action. // This Action will be passed into your `IAction.bind` // method in the `ActionBindOptions.role` property. Role awsiam.IRole `field:"optional" json:"role" yaml:"role"` Output awscodepipeline.Artifact `field:"required" json:"output" yaml:"output"` // The CodeCommit repository. Repository awscodecommit.IRepository `field:"required" json:"repository" yaml:"repository"` Branch *string `field:"optional" json:"branch" yaml:"branch"` // Whether the output should be the contents of the repository (which is the default), or a link that allows CodeBuild to clone the repository before building. // // **Note**: if this option is true, // then only CodeBuild actions can use the resulting `output`. // See: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeCommit.html // CodeBuildCloneOutput *bool `field:"optional" json:"codeBuildCloneOutput" yaml:"codeBuildCloneOutput"` // Role to be used by on commit event rule. // // Used only when trigger value is CodeCommitTrigger.EVENTS. EventRole awsiam.IRole `field:"optional" json:"eventRole" yaml:"eventRole"` // How should CodePipeline detect source changes for this Action. Trigger CodeCommitTrigger `field:"optional" json:"trigger" yaml:"trigger"` }