-
Notifications
You must be signed in to change notification settings - Fork 151
/
getStack.go
191 lines (165 loc) · 6.74 KB
/
getStack.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
// *** 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/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The CloudFormation Stack data source allows access to stack
// outputs and other useful data including the template body.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/cloudformation"
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// network, err := cloudformation.LookupStack(ctx, &cloudformation.LookupStackArgs{
// Name: "my-network-stack",
// }, nil)
// if err != nil {
// return err
// }
// _, err = ec2.NewInstance(ctx, "web", &ec2.InstanceArgs{
// Ami: pulumi.String("ami-abb07bcb"),
// InstanceType: pulumi.String("t2.micro"),
// SubnetId: pulumi.String(network.Outputs.SubnetId),
// Tags: pulumi.StringMap{
// "Name": pulumi.String("HelloWorld"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupStack(ctx *pulumi.Context, args *LookupStackArgs, opts ...pulumi.InvokeOption) (*LookupStackResult, error) {
var rv LookupStackResult
err := ctx.Invoke("aws:cloudformation/getStack:getStack", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getStack.
type LookupStackArgs struct {
// The name of the stack
Name string `pulumi:"name"`
// A map of tags associated with this stack.
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getStack.
type LookupStackResult struct {
// A list of capabilities
Capabilities []string `pulumi:"capabilities"`
// Description of the stack
Description string `pulumi:"description"`
// Whether the rollback of the stack is disabled when stack creation fails
DisableRollback bool `pulumi:"disableRollback"`
// The ARN of the IAM role used to create the stack.
IamRoleArn string `pulumi:"iamRoleArn"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// A list of SNS topic ARNs to publish stack related events
NotificationArns []string `pulumi:"notificationArns"`
// A map of outputs from the stack.
Outputs map[string]string `pulumi:"outputs"`
// A map of parameters that specify input parameters for the stack.
Parameters map[string]string `pulumi:"parameters"`
// A map of tags associated with this stack.
Tags map[string]string `pulumi:"tags"`
// Structure containing the template body.
TemplateBody string `pulumi:"templateBody"`
// The amount of time that can pass before the stack status becomes `CREATE_FAILED`
TimeoutInMinutes int `pulumi:"timeoutInMinutes"`
}
func LookupStackOutput(ctx *pulumi.Context, args LookupStackOutputArgs, opts ...pulumi.InvokeOption) LookupStackResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupStackResult, error) {
args := v.(LookupStackArgs)
r, err := LookupStack(ctx, &args, opts...)
return *r, err
}).(LookupStackResultOutput)
}
// A collection of arguments for invoking getStack.
type LookupStackOutputArgs struct {
// The name of the stack
Name pulumi.StringInput `pulumi:"name"`
// A map of tags associated with this stack.
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupStackOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupStackArgs)(nil)).Elem()
}
// A collection of values returned by getStack.
type LookupStackResultOutput struct{ *pulumi.OutputState }
func (LookupStackResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupStackResult)(nil)).Elem()
}
func (o LookupStackResultOutput) ToLookupStackResultOutput() LookupStackResultOutput {
return o
}
func (o LookupStackResultOutput) ToLookupStackResultOutputWithContext(ctx context.Context) LookupStackResultOutput {
return o
}
// A list of capabilities
func (o LookupStackResultOutput) Capabilities() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupStackResult) []string { return v.Capabilities }).(pulumi.StringArrayOutput)
}
// Description of the stack
func (o LookupStackResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupStackResult) string { return v.Description }).(pulumi.StringOutput)
}
// Whether the rollback of the stack is disabled when stack creation fails
func (o LookupStackResultOutput) DisableRollback() pulumi.BoolOutput {
return o.ApplyT(func(v LookupStackResult) bool { return v.DisableRollback }).(pulumi.BoolOutput)
}
// The ARN of the IAM role used to create the stack.
func (o LookupStackResultOutput) IamRoleArn() pulumi.StringOutput {
return o.ApplyT(func(v LookupStackResult) string { return v.IamRoleArn }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupStackResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupStackResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupStackResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupStackResult) string { return v.Name }).(pulumi.StringOutput)
}
// A list of SNS topic ARNs to publish stack related events
func (o LookupStackResultOutput) NotificationArns() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupStackResult) []string { return v.NotificationArns }).(pulumi.StringArrayOutput)
}
// A map of outputs from the stack.
func (o LookupStackResultOutput) Outputs() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupStackResult) map[string]string { return v.Outputs }).(pulumi.StringMapOutput)
}
// A map of parameters that specify input parameters for the stack.
func (o LookupStackResultOutput) Parameters() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupStackResult) map[string]string { return v.Parameters }).(pulumi.StringMapOutput)
}
// A map of tags associated with this stack.
func (o LookupStackResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupStackResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// Structure containing the template body.
func (o LookupStackResultOutput) TemplateBody() pulumi.StringOutput {
return o.ApplyT(func(v LookupStackResult) string { return v.TemplateBody }).(pulumi.StringOutput)
}
// The amount of time that can pass before the stack status becomes `CREATE_FAILED`
func (o LookupStackResultOutput) TimeoutInMinutes() pulumi.IntOutput {
return o.ApplyT(func(v LookupStackResult) int { return v.TimeoutInMinutes }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(LookupStackResultOutput{})
}