Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(codepipeline): pipeline type v2 with pipeline-level variables an…
…d triggers (aws#28538) This PR supports pipeline type v2 with pipeline-level variables and triggers. When referring to a variable in pipeline actions, it must be specified according to the format `#{variables.variableName}`. In order to avoid the need to specify directly in this form, a new class `Variable` with a `reference()` method was created. ```ts const myVariable = new codepipeline.Variable({ variableName: 'bucket-var', description: 'description', defaultValue: 'sample', }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', { artifactBucket: sourceBucket, pipelineType: codepipeline.PipelineType.V2, variables: [myVariable], stages: [ { stageName: 'Source', actions: [sourceAction], }, { stageName: 'Deploy', actions: [ new S3DeployAction({ actionName: 'DeployAction', extract: false, // objectKey: '#{variables.bucket-var}.txt', objectKey: `${myVariable.reference()}.txt`, input: sourceOutput, bucket: deployBucket, }), ], }, ], }); ``` - user guide - https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html - https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-variables.html#reference-variables-workflow - https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-github-tags.html - CloudFormation - https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-codepipeline-pipeline.html - https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-pipeline-variabledeclaration.html - https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-pipeline-pipelinetriggerdeclaration.html Closes aws#28476 aws#28694. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information