Interface PipelineDeployStackActionProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
PipelineDeployStackActionProps.Jsii$Proxy
import software.amazon.awscdk.services.codebuild.*; import software.amazon.awscdk.services.codepipeline.*; import software.amazon.awscdk.services.codepipeline.actions.*; import software.amazon.awscdk.core.*; import software.amazon.awscdk.appdelivery.*; import software.amazon.awscdk.services.iam.*; public class MyServiceStackA extends Stack { } public class MyServiceStackB extends Stack { } App app = new App(); // We define a stack that contains the CodePipeline Stack pipelineStack = new Stack(app, "PipelineStack"); Pipeline pipeline = Pipeline.Builder.create(pipelineStack, "CodePipeline") // Mutating a CodePipeline can cause the currently propagating state to be // "lost". Ensure we re-run the latest change through the pipeline after it's // been mutated so we're sure the latest state is fully deployed through. .restartExecutionOnUpdate(true) .build(); // Configure the CodePipeline source - where your CDK App's source code is hosted Artifact sourceOutput = new Artifact(); GitHubSourceAction source = GitHubSourceAction.Builder.create() .actionName("GitHub") .output(sourceOutput) .owner("myName") .repo("myRepo") .oauthToken(SecretValue.unsafePlainText("secret")) .build(); pipeline.addStage(StageOptions.builder() .stageName("source") .actions(List.of(source)) .build()); PipelineProject project = PipelineProject.Builder.create(pipelineStack, "CodeBuild").build(); Artifact synthesizedApp = new Artifact(); CodeBuildAction buildAction = CodeBuildAction.Builder.create() .actionName("CodeBuild") .project(project) .input(sourceOutput) .outputs(List.of(synthesizedApp)) .build(); pipeline.addStage(StageOptions.builder() .stageName("build") .actions(List.of(buildAction)) .build()); // Optionally, self-update the pipeline stack IStage selfUpdateStage = pipeline.addStage(StageOptions.builder().stageName("SelfUpdate").build()); selfUpdateStage.addAction(PipelineDeployStackAction.Builder.create() .stack(pipelineStack) .input(synthesizedApp) .adminPermissions(true) .build()); // Now add our service stacks IStage deployStage = pipeline.addStage(StageOptions.builder().stageName("Deploy").build()); MyServiceStackA serviceStackA = MyServiceStackA.Builder.create(app, "ServiceStackA").build(); // Add actions to deploy the stacks in the deploy stage: PipelineDeployStackAction deployServiceAAction = PipelineDeployStackAction.Builder.create() .stack(serviceStackA) .input(synthesizedApp) // See the note below for details about this option. .adminPermissions(false) .build(); deployStage.addAction(deployServiceAAction); // Add the necessary permissions for you service deploy action. This role is // is passed to CloudFormation and needs the permissions necessary to deploy // stack. Alternatively you can enable [Administrator](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator) permissions above, // users should understand the privileged nature of this role. String myResourceArn = "arn:partition:service:region:account-id:resource-id"; deployServiceAAction.addToDeploymentRolePolicy(PolicyStatement.Builder.create() .actions(List.of("service:SomeAction")) .resources(List.of(myResourceArn)) .build()); MyServiceStackB serviceStackB = MyServiceStackB.Builder.create(app, "ServiceStackB").build(); deployStage.addAction(PipelineDeployStackAction.Builder.create() .stack(serviceStackB) .input(synthesizedApp) .createChangeSetRunOrder(998) .adminPermissions(true) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Deprecated.static final class
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Deprecated.Deprecated.default List<CloudFormationCapabilities>
Deprecated.default String
Deprecated.default String
Deprecated.default Number
Deprecated.default String
Deprecated.default Number
Deprecated.getInput()
Deprecated.default IRole
getRole()
Deprecated.getStack()
Deprecated.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAdminPermissions
Deprecated.(deprecated) Whether to grant admin permissions to CloudFormation while deploying this template.Setting this to
true
affects the defaults forrole
andcapabilities
, if you don't specify any alternatives.The default role that will be created for you will have admin (i.e.,
*
) permissions on all resources, and the deployment will have named IAM capabilities (i.e., able to create all IAM resources).This is a shorthand that you can use if you fully trust the templates that are deployed in this pipeline. If you want more fine-grained permissions, use
addToRolePolicy
andcapabilities
to control what the CloudFormation deployment is allowed to do. -
getInput
Deprecated.(deprecated) The CodePipeline artifact that holds the synthesized app, which is the contents of the<directory>
when runningcdk synth -o <directory>
. -
getStack
Deprecated.(deprecated) The CDK stack to be deployed. -
getCapabilities
@Stability(Deprecated) @Deprecated @Nullable default List<CloudFormationCapabilities> getCapabilities()Deprecated.(deprecated) Acknowledge certain changes made as part of deployment.For stacks that contain certain resources, explicit acknowledgement that AWS CloudFormation might create or update those resources. For example, you must specify AnonymousIAM if your stack template contains AWS Identity and Access Management (IAM) resources. For more information
Default: [AnonymousIAM, AutoExpand], unless `adminPermissions` is true
- See Also:
-
getChangeSetName
Deprecated.(deprecated) The name to use when creating a ChangeSet for the stack.Default: CDK-CodePipeline-ChangeSet
-
getCreateChangeSetActionName
Deprecated.(deprecated) The name of the CodePipeline action creating the ChangeSet.Default: 'ChangeSet'
-
getCreateChangeSetRunOrder
Deprecated.(deprecated) The runOrder for the CodePipeline action creating the ChangeSet.Default: 1
-
getExecuteChangeSetActionName
Deprecated.(deprecated) The name of the CodePipeline action creating the ChangeSet.Default: 'Execute'
-
getExecuteChangeSetRunOrder
Deprecated.(deprecated) The runOrder for the CodePipeline action executing the ChangeSet.Default: ``createChangeSetRunOrder + 1``
-
getRole
Deprecated.(deprecated) IAM role to assume when deploying changes.If not specified, a fresh role is created. The role is created with zero permissions unless
adminPermissions
is true, in which case the role will have admin permissions.Default: A fresh role with admin or no permissions (depending on the value of `adminPermissions`).
-
builder
Deprecated.
-