@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-07T23:46:58.943Z") @Stability(value=Experimental) public interface PipelineDeployStackActionProps extends software.amazon.jsii.JsiiSerializable
// Example automatically generated from non-compiling source. May contain errors.
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
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());
| Modifier and Type | Interface and Description |
|---|---|
static class |
PipelineDeployStackActionProps.Builder
A builder for
PipelineDeployStackActionProps |
static class |
PipelineDeployStackActionProps.Jsii$Proxy
An implementation for
PipelineDeployStackActionProps |
| Modifier and Type | Method and Description |
|---|---|
static PipelineDeployStackActionProps.Builder |
builder() |
Boolean |
getAdminPermissions()
(experimental) Whether to grant admin permissions to CloudFormation while deploying this template.
|
default List<CloudFormationCapabilities> |
getCapabilities()
(experimental) Acknowledge certain changes made as part of deployment.
|
default String |
getChangeSetName()
(experimental) The name to use when creating a ChangeSet for the stack.
|
default String |
getCreateChangeSetActionName()
(experimental) The name of the CodePipeline action creating the ChangeSet.
|
default Number |
getCreateChangeSetRunOrder()
(experimental) The runOrder for the CodePipeline action creating the ChangeSet.
|
default String |
getExecuteChangeSetActionName()
(experimental) The name of the CodePipeline action creating the ChangeSet.
|
default Number |
getExecuteChangeSetRunOrder()
(experimental) The runOrder for the CodePipeline action executing the ChangeSet.
|
Artifact |
getInput()
(experimental) The CodePipeline artifact that holds the synthesized app, which is the contents of the ``
|
default IRole |
getRole()
(experimental) IAM role to assume when deploying changes.
|
Stack |
getStack()
(experimental) The CDK stack to be deployed.
|
@Stability(value=Experimental) @NotNull Boolean getAdminPermissions()
Setting this to true affects the defaults for role and capabilities, 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 and capabilities to control what the CloudFormation
deployment is allowed to do.
@Stability(value=Experimental) @NotNull Artifact getInput()
@Stability(value=Experimental) @NotNull Stack getStack()
@Stability(value=Experimental) @Nullable default List<CloudFormationCapabilities> getCapabilities()
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
@Stability(value=Experimental) @Nullable default String getChangeSetName()
Default: CDK-CodePipeline-ChangeSet
@Stability(value=Experimental) @Nullable default String getCreateChangeSetActionName()
Default: 'ChangeSet'
@Stability(value=Experimental) @Nullable default Number getCreateChangeSetRunOrder()
Default: 1
@Stability(value=Experimental) @Nullable default String getExecuteChangeSetActionName()
Default: 'Execute'
@Stability(value=Experimental) @Nullable default Number getExecuteChangeSetRunOrder()
Default: ``createChangeSetRunOrder + 1``
@Stability(value=Experimental) @Nullable default IRole getRole()
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`).
@Stability(value=Experimental) static PipelineDeployStackActionProps.Builder builder()
Copyright © 2022. All rights reserved.