-
Notifications
You must be signed in to change notification settings - Fork 17
/
awscdk_CliCredentialsStackSynthesizer.go
182 lines (162 loc) · 5.54 KB
/
awscdk_CliCredentialsStackSynthesizer.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// An experiment to bundle the entire CDK into a single module
package awscdk
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// A synthesizer that uses conventional asset locations, but not conventional deployment roles.
//
// Instead of assuming the bootstrapped deployment roles, all stack operations will be performed
// using the CLI's current credentials.
//
// - This synthesizer does not support deploying to accounts to which the CLI does not have
// credentials. It also does not support deploying using **CDK Pipelines**. For either of those
// features, use `DefaultStackSynthesizer`.
// - This synthesizer requires an S3 bucket and ECR repository with well-known names. To
// not depend on those, use `LegacyStackSynthesizer`.
//
// Be aware that your CLI credentials must be valid for the duration of the
// entire deployment. If you are using session credentials, make sure the
// session lifetime is long enough.
//
// By default, expects the environment to have been bootstrapped with just the staging resources
// of the Bootstrap Stack V2 (also known as "modern bootstrap stack"). You can override
// the default names using the synthesizer's construction properties.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import monocdk "github.com/aws/aws-cdk-go/awscdk"
//
// cliCredentialsStackSynthesizer := monocdk.NewCliCredentialsStackSynthesizer(&cliCredentialsStackSynthesizerProps{
// bucketPrefix: jsii.String("bucketPrefix"),
// dockerTagPrefix: jsii.String("dockerTagPrefix"),
// fileAssetsBucketName: jsii.String("fileAssetsBucketName"),
// imageAssetsRepositoryName: jsii.String("imageAssetsRepositoryName"),
// qualifier: jsii.String("qualifier"),
// })
//
// Experimental.
type CliCredentialsStackSynthesizer interface {
StackSynthesizer
// Register a Docker Image Asset.
//
// Returns the parameters that can be used to refer to the asset inside the template.
// Experimental.
AddDockerImageAsset(asset *DockerImageAssetSource) *DockerImageAssetLocation
// Register a File Asset.
//
// Returns the parameters that can be used to refer to the asset inside the template.
// Experimental.
AddFileAsset(asset *FileAssetSource) *FileAssetLocation
// Bind to the stack this environment is going to be used on.
//
// Must be called before any of the other methods are called.
// Experimental.
Bind(stack Stack)
// Write the stack artifact to the session.
//
// Use default settings to add a CloudFormationStackArtifact artifact to
// the given synthesis session.
// Experimental.
EmitStackArtifact(stack Stack, session ISynthesisSession, options *SynthesizeStackArtifactOptions)
// Synthesize the associated stack to the session.
// Experimental.
Synthesize(session ISynthesisSession)
// Have the stack write out its template.
// Experimental.
SynthesizeStackTemplate(stack Stack, session ISynthesisSession)
}
// The jsii proxy struct for CliCredentialsStackSynthesizer
type jsiiProxy_CliCredentialsStackSynthesizer struct {
jsiiProxy_StackSynthesizer
}
// Experimental.
func NewCliCredentialsStackSynthesizer(props *CliCredentialsStackSynthesizerProps) CliCredentialsStackSynthesizer {
_init_.Initialize()
if err := validateNewCliCredentialsStackSynthesizerParameters(props); err != nil {
panic(err)
}
j := jsiiProxy_CliCredentialsStackSynthesizer{}
_jsii_.Create(
"monocdk.CliCredentialsStackSynthesizer",
[]interface{}{props},
&j,
)
return &j
}
// Experimental.
func NewCliCredentialsStackSynthesizer_Override(c CliCredentialsStackSynthesizer, props *CliCredentialsStackSynthesizerProps) {
_init_.Initialize()
_jsii_.Create(
"monocdk.CliCredentialsStackSynthesizer",
[]interface{}{props},
c,
)
}
func (c *jsiiProxy_CliCredentialsStackSynthesizer) AddDockerImageAsset(asset *DockerImageAssetSource) *DockerImageAssetLocation {
if err := c.validateAddDockerImageAssetParameters(asset); err != nil {
panic(err)
}
var returns *DockerImageAssetLocation
_jsii_.Invoke(
c,
"addDockerImageAsset",
[]interface{}{asset},
&returns,
)
return returns
}
func (c *jsiiProxy_CliCredentialsStackSynthesizer) AddFileAsset(asset *FileAssetSource) *FileAssetLocation {
if err := c.validateAddFileAssetParameters(asset); err != nil {
panic(err)
}
var returns *FileAssetLocation
_jsii_.Invoke(
c,
"addFileAsset",
[]interface{}{asset},
&returns,
)
return returns
}
func (c *jsiiProxy_CliCredentialsStackSynthesizer) Bind(stack Stack) {
if err := c.validateBindParameters(stack); err != nil {
panic(err)
}
_jsii_.InvokeVoid(
c,
"bind",
[]interface{}{stack},
)
}
func (c *jsiiProxy_CliCredentialsStackSynthesizer) EmitStackArtifact(stack Stack, session ISynthesisSession, options *SynthesizeStackArtifactOptions) {
if err := c.validateEmitStackArtifactParameters(stack, session, options); err != nil {
panic(err)
}
_jsii_.InvokeVoid(
c,
"emitStackArtifact",
[]interface{}{stack, session, options},
)
}
func (c *jsiiProxy_CliCredentialsStackSynthesizer) Synthesize(session ISynthesisSession) {
if err := c.validateSynthesizeParameters(session); err != nil {
panic(err)
}
_jsii_.InvokeVoid(
c,
"synthesize",
[]interface{}{session},
)
}
func (c *jsiiProxy_CliCredentialsStackSynthesizer) SynthesizeStackTemplate(stack Stack, session ISynthesisSession) {
if err := c.validateSynthesizeStackTemplateParameters(stack, session); err != nil {
panic(err)
}
_jsii_.InvokeVoid(
c,
"synthesizeStackTemplate",
[]interface{}{stack, session},
)
}