-
Notifications
You must be signed in to change notification settings - Fork 17
/
StackSetDeploymentModel.go
143 lines (129 loc) · 4.88 KB
/
StackSetDeploymentModel.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package awscodepipelineactions
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// Determines how IAM roles are created and managed.
//
// Example:
// var pipeline pipeline
// var sourceOutput artifact
//
//
// pipeline.AddStage(&StageOptions{
// StageName: jsii.String("DeployStackSets"),
// Actions: []iAction{
// // First, update the StackSet itself with the newest template
// codepipeline_actions.NewCloudFormationDeployStackSetAction(&CloudFormationDeployStackSetActionProps{
// ActionName: jsii.String("UpdateStackSet"),
// RunOrder: jsii.Number(1),
// StackSetName: jsii.String("MyStackSet"),
// Template: codepipeline_actions.StackSetTemplate_FromArtifactPath(sourceOutput.AtPath(jsii.String("template.yaml"))),
//
// // Change this to 'StackSetDeploymentModel.organizations()' if you want to deploy to OUs
// DeploymentModel: codepipeline_actions.StackSetDeploymentModel_SelfManaged(),
// // This deploys to a set of accounts
// StackInstances: codepipeline_actions.StackInstances_InAccounts([]*string{
// jsii.String("111111111111"),
// }, []*string{
// jsii.String("us-east-1"),
// jsii.String("eu-west-1"),
// }),
// }),
//
// // Afterwards, update/create additional instances in other accounts
// codepipeline_actions.NewCloudFormationDeployStackInstancesAction(&CloudFormationDeployStackInstancesActionProps{
// ActionName: jsii.String("AddMoreInstances"),
// RunOrder: jsii.Number(2),
// StackSetName: jsii.String("MyStackSet"),
// StackInstances: codepipeline_actions.StackInstances_*InAccounts([]*string{
// jsii.String("222222222222"),
// jsii.String("333333333333"),
// }, []*string{
// jsii.String("us-east-1"),
// jsii.String("eu-west-1"),
// }),
// }),
// },
// })
//
type StackSetDeploymentModel interface {
}
// The jsii proxy struct for StackSetDeploymentModel
type jsiiProxy_StackSetDeploymentModel struct {
_ byte // padding
}
func NewStackSetDeploymentModel_Override(s StackSetDeploymentModel) {
_init_.Initialize()
_jsii_.Create(
"aws-cdk-lib.aws_codepipeline_actions.StackSetDeploymentModel",
nil, // no parameters
s,
)
}
// Deploy to AWS Organizations accounts.
//
// AWS CloudFormation StackSets automatically creates the IAM roles required
// to deploy to accounts managed by AWS Organizations. This requires an
// account to be a member of an Organization.
//
// Using this deployment model, you can specify either AWS Account Ids or
// Organization Unit Ids in the `stackInstances` parameter.
func StackSetDeploymentModel_Organizations(props *OrganizationsDeploymentProps) StackSetDeploymentModel {
_init_.Initialize()
if err := validateStackSetDeploymentModel_OrganizationsParameters(props); err != nil {
panic(err)
}
var returns StackSetDeploymentModel
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_codepipeline_actions.StackSetDeploymentModel",
"organizations",
[]interface{}{props},
&returns,
)
return returns
}
// Deploy to AWS Accounts not managed by AWS Organizations.
//
// You are responsible for creating Execution Roles in every account you will
// be deploying to in advance to create the actual stack instances. Unless you
// specify overrides, StackSets expects the execution roles you create to have
// the default name `AWSCloudFormationStackSetExecutionRole`. See the [Grant
// self-managed
// permissions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html)
// section of the CloudFormation documentation.
//
// The CDK will automatically create the central Administration Role in the
// Pipeline account which will be used to assume the Execution Role in each of
// the target accounts.
//
// If you wish to use a pre-created Administration Role, use `Role.fromRoleName()`
// or `Role.fromRoleArn()` to import it, and pass it to this function:
//
// ```ts
// const existingAdminRole = iam.Role.fromRoleName(this, 'AdminRole', 'AWSCloudFormationStackSetAdministrationRole');
//
// const deploymentModel = codepipeline_actions.StackSetDeploymentModel.selfManaged({
// // Use an existing Role. Leave this out to create a new Role.
// administrationRole: existingAdminRole,
// });
// ```
//
// Using this deployment model, you can only specify AWS Account Ids in the
// `stackInstances` parameter.
// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html
//
func StackSetDeploymentModel_SelfManaged(props *SelfManagedDeploymentProps) StackSetDeploymentModel {
_init_.Initialize()
if err := validateStackSetDeploymentModel_SelfManagedParameters(props); err != nil {
panic(err)
}
var returns StackSetDeploymentModel
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_codepipeline_actions.StackSetDeploymentModel",
"selfManaged",
[]interface{}{props},
&returns,
)
return returns
}