@@ -5,6 +5,9 @@ import "time"
5
5
const (
6
6
// CloudFormationRetryMaxAttempts is the maximum number of retries for CloudFormation.
7
7
CloudFormationRetryMaxAttempts int = 2
8
+ // CloudFormationWaitNanoSecTime is the time to wait for CloudFormation.
9
+ // It is 1 hour.
10
+ CloudFormationWaitNanoSecTime = time .Duration (6000000000000000 )
8
11
)
9
12
10
13
// StackStatus is the status of a CloudFormation stack.
@@ -84,3 +87,174 @@ type Stack struct {
84
87
// TemplateDescription is the template description of the template used to create the stack.
85
88
TemplateDescription * string
86
89
}
90
+
91
+ // ResourceStatus is the status of a CloudFormation stack resource.
92
+ type ResourceStatus string
93
+
94
+ const (
95
+ // ResourceStatusCreateInProgress is the resource is being created.
96
+ ResourceStatusCreateInProgress ResourceStatus = "CREATE_IN_PROGRESS"
97
+ // ResourceStatusCreateFailed is the resource creation failed.
98
+ ResourceStatusCreateFailed ResourceStatus = "CREATE_FAILED"
99
+ // ResourceStatusCreateComplete is the resource has been created.
100
+ ResourceStatusCreateComplete ResourceStatus = "CREATE_COMPLETE"
101
+ // ResourceStatusDeleteInProgress is the resource is being deleted.
102
+ ResourceStatusDeleteInProgress ResourceStatus = "DELETE_IN_PROGRESS"
103
+ // ResourceStatusDeleteFailed is the resource deletion failed.
104
+ ResourceStatusDeleteFailed ResourceStatus = "DELETE_FAILED"
105
+ // ResourceStatusDeleteComplete is the resource has been deleted.
106
+ ResourceStatusDeleteComplete ResourceStatus = "DELETE_COMPLETE"
107
+ // ResourceStatusDeleteSkipped is the resource was not successfully deleted. It might still be
108
+ ResourceStatusDeleteSkipped ResourceStatus = "DELETE_SKIPPED"
109
+ // ResourceStatusUpdateInProgress is the resource is being updated.
110
+ ResourceStatusUpdateInProgress ResourceStatus = "UPDATE_IN_PROGRESS"
111
+ // ResourceStatusUpdateFailed is the resource update failed.
112
+ ResourceStatusUpdateFailed ResourceStatus = "UPDATE_FAILED"
113
+ // ResourceStatusUpdateComplete is the resource has been updated.
114
+ ResourceStatusUpdateComplete ResourceStatus = "UPDATE_COMPLETE"
115
+ // ResourceStatusImportFailed is the resource import failed.
116
+ ResourceStatusImportFailed ResourceStatus = "IMPORT_FAILED"
117
+ // ResourceStatusImportComplete is the resource has been imported.
118
+ ResourceStatusImportComplete ResourceStatus = "IMPORT_COMPLETE"
119
+ // ResourceStatusImportInProgress is the resource is being imported into a stack.
120
+ ResourceStatusImportInProgress ResourceStatus = "IMPORT_IN_PROGRESS"
121
+ // ResourceStatusImportRollbackInProgress is the resource is being rolled back to its previous
122
+ ResourceStatusImportRollbackInProgress ResourceStatus = "IMPORT_ROLLBACK_IN_PROGRESS"
123
+ // ResourceStatusImportRollbackFailed is the resource import failed and the resource is
124
+ ResourceStatusImportRollbackFailed ResourceStatus = "IMPORT_ROLLBACK_FAILED"
125
+ // ResourceStatusImportRollbackComplete is the resource was rolled back to its previous
126
+ ResourceStatusImportRollbackComplete ResourceStatus = "IMPORT_ROLLBACK_COMPLETE"
127
+ // ResourceStatusUpdateRollbackInProgress is the resource is being rolled back as part of a
128
+ ResourceStatusUpdateRollbackInProgress ResourceStatus = "UPDATE_ROLLBACK_IN_PROGRESS"
129
+ // ResourceStatusUpdateRollbackComplete is the resource was rolled back to its previous
130
+ ResourceStatusUpdateRollbackComplete ResourceStatus = "UPDATE_ROLLBACK_COMPLETE"
131
+ // ResourceStatusUpdateRollbackFailed is the resource update failed and the resource is being rolled back to its previous configuration.
132
+ ResourceStatusUpdateRollbackFailed ResourceStatus = "UPDATE_ROLLBACK_FAILED"
133
+ // ResourceStatusRollbackInProgress is the resource is being rolled back.
134
+ ResourceStatusRollbackInProgress ResourceStatus = "ROLLBACK_IN_PROGRESS"
135
+ // ResourceStatusRollbackComplete is the resource was rolled back.
136
+ ResourceStatusRollbackComplete ResourceStatus = "ROLLBACK_COMPLETE"
137
+ // ResourceStatusRollbackFailed is the resource rollback failed.
138
+ ResourceStatusRollbackFailed ResourceStatus = "ROLLBACK_FAILED"
139
+ )
140
+
141
+ // Values returns all known values for ResourceStatus. Note that this can be
142
+ // expanded in the future, and so it is only as up to date as the client. The
143
+ // ordering of this slice is not guaranteed to be stable across updates.
144
+ func (ResourceStatus ) Values () []ResourceStatus {
145
+ return []ResourceStatus {
146
+ ResourceStatusCreateInProgress ,
147
+ ResourceStatusCreateFailed ,
148
+ ResourceStatusCreateComplete ,
149
+ ResourceStatusDeleteInProgress ,
150
+ ResourceStatusDeleteFailed ,
151
+ ResourceStatusDeleteComplete ,
152
+ ResourceStatusDeleteSkipped ,
153
+ ResourceStatusUpdateInProgress ,
154
+ ResourceStatusUpdateFailed ,
155
+ ResourceStatusUpdateComplete ,
156
+ ResourceStatusImportFailed ,
157
+ ResourceStatusImportComplete ,
158
+ ResourceStatusImportInProgress ,
159
+ ResourceStatusImportRollbackInProgress ,
160
+ ResourceStatusImportRollbackFailed ,
161
+ ResourceStatusImportRollbackComplete ,
162
+ ResourceStatusUpdateRollbackInProgress ,
163
+ ResourceStatusUpdateRollbackComplete ,
164
+ ResourceStatusUpdateRollbackFailed ,
165
+ ResourceStatusRollbackInProgress ,
166
+ ResourceStatusRollbackComplete ,
167
+ ResourceStatusRollbackFailed ,
168
+ }
169
+ }
170
+
171
+ // StackResourceDriftStatus is status of the resource's actual configuration
172
+ type StackResourceDriftStatus string
173
+
174
+ const (
175
+ // StackResourceDriftStatusInSync is the resource's actual configuration matches its expected
176
+ StackResourceDriftStatusInSync StackResourceDriftStatus = "IN_SYNC"
177
+ // StackResourceDriftStatusModified is the resource differs from its expected configuration.
178
+ StackResourceDriftStatusModified StackResourceDriftStatus = "MODIFIED"
179
+ // StackResourceDriftStatusDeleted is the resource differs from its expected configuration in that it has been deleted.
180
+ StackResourceDriftStatusDeleted StackResourceDriftStatus = "DELETED"
181
+ // StackResourceDriftStatusNotChecked is CloudFormation hasn't checked if the resource differs from its expected configuration.
182
+ StackResourceDriftStatusNotChecked StackResourceDriftStatus = "NOT_CHECKED"
183
+ )
184
+
185
+ // Values returns all known values for StackResourceDriftStatus. Note that this
186
+ // can be expanded in the future, and so it is only as up to date as the client.
187
+ // The ordering of this slice is not guaranteed to be stable across updates.
188
+ func (StackResourceDriftStatus ) Values () []StackResourceDriftStatus {
189
+ return []StackResourceDriftStatus {
190
+ StackResourceDriftStatusInSync ,
191
+ StackResourceDriftStatusModified ,
192
+ StackResourceDriftStatusDeleted ,
193
+ StackResourceDriftStatusNotChecked ,
194
+ }
195
+ }
196
+
197
+ // StackResourceDriftInformationSummary is summarizes information about whether
198
+ // the resource's actual configuration differs, or has drifted, from its expected configuration.
199
+ type StackResourceDriftInformationSummary struct {
200
+ // StackResourceDriftStatus is status of the resource's actual
201
+ // configuration compared to its expected configuration.
202
+ StackResourceDriftStatus StackResourceDriftStatus
203
+ // LastCheckTimestamp is when CloudFormation last checked if the
204
+ // resource had drifted from its expected configuration.
205
+ LastCheckTimestamp * time.Time
206
+ }
207
+
208
+ // ModuleInfo is contains information about the module from which the resource
209
+ // was created, if the resource was created from a module included in the stack
210
+ // template. For more information about modules, see Using modules to encapsulate
211
+ // and reuse resource configurations (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html)
212
+ // in the CloudFormation User Guide.
213
+ type ModuleInfo struct {
214
+ // LogicalIDHierarchy is a concatenated list of the logical IDs of the module
215
+ // or modules containing the resource. Modules are listed starting with the
216
+ // inner-most nested module, and separated by / .
217
+ // In the following example, the resource was created from a module, moduleA,
218
+ // that's nested inside a parent module, moduleB . moduleA/moduleB For more
219
+ // information, see Referencing resources in a module
220
+ // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html#module-ref-resources)
221
+ // in the CloudFormation User Guide.
222
+ LogicalIDHierarchy * string
223
+ // TypeHierarchy is a concatenated list of the module type or types containing
224
+ // the resource. Module types are listed starting with the inner-most nested
225
+ // module, and separated by /.
226
+ // In the following example, the resource was created from a module of type
227
+ // AWS::First::Example::MODULE , that's nested inside a parent module of type
228
+ // AWS::Second::Example::MODULE .
229
+ // AWS::First::Example::MODULE/AWS::Second::Example::MODULE
230
+ TypeHierarchy * string
231
+ }
232
+
233
+ // StackResource is a CloudFormation stack resource. It is same as types.StackResourceSummary.
234
+ type StackResource struct {
235
+ // LastUpdatedTimestamp is time the status was updated.
236
+ LastUpdatedTimestamp * time.Time
237
+ // LogicalResourceID is the logical name of the resource specified in the template.
238
+ LogicalResourceID * string
239
+ // ResourceStatus is current status of the resource.
240
+ ResourceStatus ResourceStatus
241
+ // ResourceType is type of resource. For more information, go to Amazon Web Services Resource
242
+ // Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)
243
+ // in the CloudFormation User Guide.
244
+ ResourceType * string
245
+ // DriftInformation is information about whether the resource's actual
246
+ // configuration differs, or has drifted, from its expected configuration,
247
+ // as defined in the stack template and any values specified as template
248
+ // parameters. For more information, see Detecting Unregulated Configuration
249
+ // Changes to Stacks and Resources
250
+ // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html
251
+ DriftInformation * StackResourceDriftInformationSummary
252
+ // ModuleInfo is contains information about the module from which the resource was created, if
253
+ // the resource was created from a module included in the stack template.
254
+ ModuleInfo * ModuleInfo
255
+ // PhysicalResourceID is the name or unique identifier that corresponds to a
256
+ // physical instance ID of the resource.
257
+ PhysicalResourceID * string
258
+ // ResourceStatusReason is success/failure message associated with the resource.
259
+ ResourceStatusReason * string
260
+ }
0 commit comments