/
cloudFormationType.go
364 lines (318 loc) · 18.4 KB
/
cloudFormationType.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package cloudformation
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/cloudformation"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cloudformation.NewCloudFormationType(ctx, "example", &cloudformation.CloudFormationTypeArgs{
// SchemaHandlerPackage: pulumi.String(fmt.Sprintf("%v%v%v%v", "s3://", aws_s3_bucket_object.Example.Bucket, "/", aws_s3_bucket_object.Example.Key)),
// Type: pulumi.String("RESOURCE"),
// TypeName: pulumi.String("ExampleCompany::ExampleService::ExampleResource"),
// LoggingConfig: &cloudformation.CloudFormationTypeLoggingConfigArgs{
// LogGroupName: pulumi.Any(aws_cloudwatch_log_group.Example.Name),
// LogRoleArn: pulumi.Any(aws_iam_role.Example.Arn),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// `aws_cloudformation_type` can be imported with their type version Amazon Resource Name (ARN), e.g.,
//
// ```sh
// $ pulumi import aws:cloudformation/cloudFormationType:CloudFormationType example arn:aws:cloudformation:us-east-1:123456789012:type/resource/ExampleCompany-ExampleService-ExampleType/1
// ```
type CloudFormationType struct {
pulumi.CustomResourceState
// (Optional) Amazon Resource Name (ARN) of the CloudFormation Type version. See also `typeArn`.
Arn pulumi.StringOutput `pulumi:"arn"`
// Identifier of the CloudFormation Type default version.
DefaultVersionId pulumi.StringOutput `pulumi:"defaultVersionId"`
// Deprecation status of the version.
DeprecatedStatus pulumi.StringOutput `pulumi:"deprecatedStatus"`
// Description of the version.
Description pulumi.StringOutput `pulumi:"description"`
// URL of the documentation for the CloudFormation Type.
DocumentationUrl pulumi.StringOutput `pulumi:"documentationUrl"`
// Amazon Resource Name (ARN) of the IAM Role for CloudFormation to assume when invoking the extension. If your extension calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the extension handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the extension handler, thereby supplying your extension with the appropriate credentials.
ExecutionRoleArn pulumi.StringPtrOutput `pulumi:"executionRoleArn"`
// Whether the CloudFormation Type version is the default version.
IsDefaultVersion pulumi.BoolOutput `pulumi:"isDefaultVersion"`
// Configuration block containing logging configuration.
LoggingConfig CloudFormationTypeLoggingConfigPtrOutput `pulumi:"loggingConfig"`
// Provisioning behavior of the CloudFormation Type.
ProvisioningType pulumi.StringOutput `pulumi:"provisioningType"`
// JSON document of the CloudFormation Type schema.
Schema pulumi.StringOutput `pulumi:"schema"`
// URL to the S3 bucket containing the extension project package that contains the necessary files for the extension you want to register. Must begin with `s3://` or `https://`. For example, `s3://example-bucket/example-object`.
SchemaHandlerPackage pulumi.StringOutput `pulumi:"schemaHandlerPackage"`
// URL of the source code for the CloudFormation Type.
SourceUrl pulumi.StringOutput `pulumi:"sourceUrl"`
// CloudFormation Registry Type. For example, `RESOURCE` or `MODULE`.
Type pulumi.StringOutput `pulumi:"type"`
// (Optional) Amazon Resource Name (ARN) of the CloudFormation Type. See also `arn`.
TypeArn pulumi.StringOutput `pulumi:"typeArn"`
// CloudFormation Type name. For example, `ExampleCompany::ExampleService::ExampleResource`.
TypeName pulumi.StringOutput `pulumi:"typeName"`
// (Optional) Identifier of the CloudFormation Type version.
VersionId pulumi.StringOutput `pulumi:"versionId"`
// Scope of the CloudFormation Type.
Visibility pulumi.StringOutput `pulumi:"visibility"`
}
// NewCloudFormationType registers a new resource with the given unique name, arguments, and options.
func NewCloudFormationType(ctx *pulumi.Context,
name string, args *CloudFormationTypeArgs, opts ...pulumi.ResourceOption) (*CloudFormationType, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SchemaHandlerPackage == nil {
return nil, errors.New("invalid value for required argument 'SchemaHandlerPackage'")
}
if args.TypeName == nil {
return nil, errors.New("invalid value for required argument 'TypeName'")
}
var resource CloudFormationType
err := ctx.RegisterResource("aws:cloudformation/cloudFormationType:CloudFormationType", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCloudFormationType gets an existing CloudFormationType resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCloudFormationType(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CloudFormationTypeState, opts ...pulumi.ResourceOption) (*CloudFormationType, error) {
var resource CloudFormationType
err := ctx.ReadResource("aws:cloudformation/cloudFormationType:CloudFormationType", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CloudFormationType resources.
type cloudFormationTypeState struct {
// (Optional) Amazon Resource Name (ARN) of the CloudFormation Type version. See also `typeArn`.
Arn *string `pulumi:"arn"`
// Identifier of the CloudFormation Type default version.
DefaultVersionId *string `pulumi:"defaultVersionId"`
// Deprecation status of the version.
DeprecatedStatus *string `pulumi:"deprecatedStatus"`
// Description of the version.
Description *string `pulumi:"description"`
// URL of the documentation for the CloudFormation Type.
DocumentationUrl *string `pulumi:"documentationUrl"`
// Amazon Resource Name (ARN) of the IAM Role for CloudFormation to assume when invoking the extension. If your extension calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the extension handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the extension handler, thereby supplying your extension with the appropriate credentials.
ExecutionRoleArn *string `pulumi:"executionRoleArn"`
// Whether the CloudFormation Type version is the default version.
IsDefaultVersion *bool `pulumi:"isDefaultVersion"`
// Configuration block containing logging configuration.
LoggingConfig *CloudFormationTypeLoggingConfig `pulumi:"loggingConfig"`
// Provisioning behavior of the CloudFormation Type.
ProvisioningType *string `pulumi:"provisioningType"`
// JSON document of the CloudFormation Type schema.
Schema *string `pulumi:"schema"`
// URL to the S3 bucket containing the extension project package that contains the necessary files for the extension you want to register. Must begin with `s3://` or `https://`. For example, `s3://example-bucket/example-object`.
SchemaHandlerPackage *string `pulumi:"schemaHandlerPackage"`
// URL of the source code for the CloudFormation Type.
SourceUrl *string `pulumi:"sourceUrl"`
// CloudFormation Registry Type. For example, `RESOURCE` or `MODULE`.
Type *string `pulumi:"type"`
// (Optional) Amazon Resource Name (ARN) of the CloudFormation Type. See also `arn`.
TypeArn *string `pulumi:"typeArn"`
// CloudFormation Type name. For example, `ExampleCompany::ExampleService::ExampleResource`.
TypeName *string `pulumi:"typeName"`
// (Optional) Identifier of the CloudFormation Type version.
VersionId *string `pulumi:"versionId"`
// Scope of the CloudFormation Type.
Visibility *string `pulumi:"visibility"`
}
type CloudFormationTypeState struct {
// (Optional) Amazon Resource Name (ARN) of the CloudFormation Type version. See also `typeArn`.
Arn pulumi.StringPtrInput
// Identifier of the CloudFormation Type default version.
DefaultVersionId pulumi.StringPtrInput
// Deprecation status of the version.
DeprecatedStatus pulumi.StringPtrInput
// Description of the version.
Description pulumi.StringPtrInput
// URL of the documentation for the CloudFormation Type.
DocumentationUrl pulumi.StringPtrInput
// Amazon Resource Name (ARN) of the IAM Role for CloudFormation to assume when invoking the extension. If your extension calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the extension handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the extension handler, thereby supplying your extension with the appropriate credentials.
ExecutionRoleArn pulumi.StringPtrInput
// Whether the CloudFormation Type version is the default version.
IsDefaultVersion pulumi.BoolPtrInput
// Configuration block containing logging configuration.
LoggingConfig CloudFormationTypeLoggingConfigPtrInput
// Provisioning behavior of the CloudFormation Type.
ProvisioningType pulumi.StringPtrInput
// JSON document of the CloudFormation Type schema.
Schema pulumi.StringPtrInput
// URL to the S3 bucket containing the extension project package that contains the necessary files for the extension you want to register. Must begin with `s3://` or `https://`. For example, `s3://example-bucket/example-object`.
SchemaHandlerPackage pulumi.StringPtrInput
// URL of the source code for the CloudFormation Type.
SourceUrl pulumi.StringPtrInput
// CloudFormation Registry Type. For example, `RESOURCE` or `MODULE`.
Type pulumi.StringPtrInput
// (Optional) Amazon Resource Name (ARN) of the CloudFormation Type. See also `arn`.
TypeArn pulumi.StringPtrInput
// CloudFormation Type name. For example, `ExampleCompany::ExampleService::ExampleResource`.
TypeName pulumi.StringPtrInput
// (Optional) Identifier of the CloudFormation Type version.
VersionId pulumi.StringPtrInput
// Scope of the CloudFormation Type.
Visibility pulumi.StringPtrInput
}
func (CloudFormationTypeState) ElementType() reflect.Type {
return reflect.TypeOf((*cloudFormationTypeState)(nil)).Elem()
}
type cloudFormationTypeArgs struct {
// Amazon Resource Name (ARN) of the IAM Role for CloudFormation to assume when invoking the extension. If your extension calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the extension handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the extension handler, thereby supplying your extension with the appropriate credentials.
ExecutionRoleArn *string `pulumi:"executionRoleArn"`
// Configuration block containing logging configuration.
LoggingConfig *CloudFormationTypeLoggingConfig `pulumi:"loggingConfig"`
// URL to the S3 bucket containing the extension project package that contains the necessary files for the extension you want to register. Must begin with `s3://` or `https://`. For example, `s3://example-bucket/example-object`.
SchemaHandlerPackage string `pulumi:"schemaHandlerPackage"`
// CloudFormation Registry Type. For example, `RESOURCE` or `MODULE`.
Type *string `pulumi:"type"`
// CloudFormation Type name. For example, `ExampleCompany::ExampleService::ExampleResource`.
TypeName string `pulumi:"typeName"`
}
// The set of arguments for constructing a CloudFormationType resource.
type CloudFormationTypeArgs struct {
// Amazon Resource Name (ARN) of the IAM Role for CloudFormation to assume when invoking the extension. If your extension calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the extension handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the extension handler, thereby supplying your extension with the appropriate credentials.
ExecutionRoleArn pulumi.StringPtrInput
// Configuration block containing logging configuration.
LoggingConfig CloudFormationTypeLoggingConfigPtrInput
// URL to the S3 bucket containing the extension project package that contains the necessary files for the extension you want to register. Must begin with `s3://` or `https://`. For example, `s3://example-bucket/example-object`.
SchemaHandlerPackage pulumi.StringInput
// CloudFormation Registry Type. For example, `RESOURCE` or `MODULE`.
Type pulumi.StringPtrInput
// CloudFormation Type name. For example, `ExampleCompany::ExampleService::ExampleResource`.
TypeName pulumi.StringInput
}
func (CloudFormationTypeArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cloudFormationTypeArgs)(nil)).Elem()
}
type CloudFormationTypeInput interface {
pulumi.Input
ToCloudFormationTypeOutput() CloudFormationTypeOutput
ToCloudFormationTypeOutputWithContext(ctx context.Context) CloudFormationTypeOutput
}
func (*CloudFormationType) ElementType() reflect.Type {
return reflect.TypeOf((**CloudFormationType)(nil)).Elem()
}
func (i *CloudFormationType) ToCloudFormationTypeOutput() CloudFormationTypeOutput {
return i.ToCloudFormationTypeOutputWithContext(context.Background())
}
func (i *CloudFormationType) ToCloudFormationTypeOutputWithContext(ctx context.Context) CloudFormationTypeOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudFormationTypeOutput)
}
// CloudFormationTypeArrayInput is an input type that accepts CloudFormationTypeArray and CloudFormationTypeArrayOutput values.
// You can construct a concrete instance of `CloudFormationTypeArrayInput` via:
//
// CloudFormationTypeArray{ CloudFormationTypeArgs{...} }
type CloudFormationTypeArrayInput interface {
pulumi.Input
ToCloudFormationTypeArrayOutput() CloudFormationTypeArrayOutput
ToCloudFormationTypeArrayOutputWithContext(context.Context) CloudFormationTypeArrayOutput
}
type CloudFormationTypeArray []CloudFormationTypeInput
func (CloudFormationTypeArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CloudFormationType)(nil)).Elem()
}
func (i CloudFormationTypeArray) ToCloudFormationTypeArrayOutput() CloudFormationTypeArrayOutput {
return i.ToCloudFormationTypeArrayOutputWithContext(context.Background())
}
func (i CloudFormationTypeArray) ToCloudFormationTypeArrayOutputWithContext(ctx context.Context) CloudFormationTypeArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudFormationTypeArrayOutput)
}
// CloudFormationTypeMapInput is an input type that accepts CloudFormationTypeMap and CloudFormationTypeMapOutput values.
// You can construct a concrete instance of `CloudFormationTypeMapInput` via:
//
// CloudFormationTypeMap{ "key": CloudFormationTypeArgs{...} }
type CloudFormationTypeMapInput interface {
pulumi.Input
ToCloudFormationTypeMapOutput() CloudFormationTypeMapOutput
ToCloudFormationTypeMapOutputWithContext(context.Context) CloudFormationTypeMapOutput
}
type CloudFormationTypeMap map[string]CloudFormationTypeInput
func (CloudFormationTypeMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CloudFormationType)(nil)).Elem()
}
func (i CloudFormationTypeMap) ToCloudFormationTypeMapOutput() CloudFormationTypeMapOutput {
return i.ToCloudFormationTypeMapOutputWithContext(context.Background())
}
func (i CloudFormationTypeMap) ToCloudFormationTypeMapOutputWithContext(ctx context.Context) CloudFormationTypeMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudFormationTypeMapOutput)
}
type CloudFormationTypeOutput struct{ *pulumi.OutputState }
func (CloudFormationTypeOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CloudFormationType)(nil)).Elem()
}
func (o CloudFormationTypeOutput) ToCloudFormationTypeOutput() CloudFormationTypeOutput {
return o
}
func (o CloudFormationTypeOutput) ToCloudFormationTypeOutputWithContext(ctx context.Context) CloudFormationTypeOutput {
return o
}
type CloudFormationTypeArrayOutput struct{ *pulumi.OutputState }
func (CloudFormationTypeArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CloudFormationType)(nil)).Elem()
}
func (o CloudFormationTypeArrayOutput) ToCloudFormationTypeArrayOutput() CloudFormationTypeArrayOutput {
return o
}
func (o CloudFormationTypeArrayOutput) ToCloudFormationTypeArrayOutputWithContext(ctx context.Context) CloudFormationTypeArrayOutput {
return o
}
func (o CloudFormationTypeArrayOutput) Index(i pulumi.IntInput) CloudFormationTypeOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CloudFormationType {
return vs[0].([]*CloudFormationType)[vs[1].(int)]
}).(CloudFormationTypeOutput)
}
type CloudFormationTypeMapOutput struct{ *pulumi.OutputState }
func (CloudFormationTypeMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CloudFormationType)(nil)).Elem()
}
func (o CloudFormationTypeMapOutput) ToCloudFormationTypeMapOutput() CloudFormationTypeMapOutput {
return o
}
func (o CloudFormationTypeMapOutput) ToCloudFormationTypeMapOutputWithContext(ctx context.Context) CloudFormationTypeMapOutput {
return o
}
func (o CloudFormationTypeMapOutput) MapIndex(k pulumi.StringInput) CloudFormationTypeOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CloudFormationType {
return vs[0].(map[string]*CloudFormationType)[vs[1].(string)]
}).(CloudFormationTypeOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CloudFormationTypeInput)(nil)).Elem(), &CloudFormationType{})
pulumi.RegisterInputType(reflect.TypeOf((*CloudFormationTypeArrayInput)(nil)).Elem(), CloudFormationTypeArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CloudFormationTypeMapInput)(nil)).Elem(), CloudFormationTypeMap{})
pulumi.RegisterOutputType(CloudFormationTypeOutput{})
pulumi.RegisterOutputType(CloudFormationTypeArrayOutput{})
pulumi.RegisterOutputType(CloudFormationTypeMapOutput{})
}