generated from pulumi/pulumi-tf-provider-boilerplate
/
getInstanceAttachments.go
172 lines (150 loc) · 6.69 KB
/
getInstanceAttachments.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cen
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides Cen Instance Attachments of the current Alibaba Cloud User.
//
// > **NOTE:** Available in v1.97.0+.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/go/alicloud/cen"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/cen"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := cen.GetInstanceAttachments(ctx, &cen.GetInstanceAttachmentsArgs{
// InstanceId: "cen-o40h17ll9w********",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("theFirstAttachmentedInstanceId", example.Attachments[0].ChildInstanceId)
// return nil
// })
// }
//
// ```
func GetInstanceAttachments(ctx *pulumi.Context, args *GetInstanceAttachmentsArgs, opts ...pulumi.InvokeOption) (*GetInstanceAttachmentsResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetInstanceAttachmentsResult
err := ctx.Invoke("alicloud:cen/getInstanceAttachments:getInstanceAttachments", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getInstanceAttachments.
type GetInstanceAttachmentsArgs struct {
// The region to which the network to be queried belongs.
ChildInstanceRegionId *string `pulumi:"childInstanceRegionId"`
// The type of the associated network. Valid values: `VPC`, `VBR` and `CCN`.
ChildInstanceType *string `pulumi:"childInstanceType"`
// The ID of the CEN instance.
InstanceId string `pulumi:"instanceId"`
OutputFile *string `pulumi:"outputFile"`
// The status of the Cen Child Instance Attachment. Valid value: `Attaching`, `Attached` and `Aetaching`.
Status *string `pulumi:"status"`
}
// A collection of values returned by getInstanceAttachments.
type GetInstanceAttachmentsResult struct {
// A list of CEN Instance Attachments. Each element contains the following attributes:
Attachments []GetInstanceAttachmentsAttachment `pulumi:"attachments"`
// The ID of the region to which the network belongs.
ChildInstanceRegionId *string `pulumi:"childInstanceRegionId"`
// The type of the associated network.
ChildInstanceType *string `pulumi:"childInstanceType"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of CEN Instance Attachment IDs.
Ids []string `pulumi:"ids"`
// The ID of the CEN instance.
InstanceId string `pulumi:"instanceId"`
OutputFile *string `pulumi:"outputFile"`
// The status of the network.
Status *string `pulumi:"status"`
}
func GetInstanceAttachmentsOutput(ctx *pulumi.Context, args GetInstanceAttachmentsOutputArgs, opts ...pulumi.InvokeOption) GetInstanceAttachmentsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetInstanceAttachmentsResult, error) {
args := v.(GetInstanceAttachmentsArgs)
r, err := GetInstanceAttachments(ctx, &args, opts...)
var s GetInstanceAttachmentsResult
if r != nil {
s = *r
}
return s, err
}).(GetInstanceAttachmentsResultOutput)
}
// A collection of arguments for invoking getInstanceAttachments.
type GetInstanceAttachmentsOutputArgs struct {
// The region to which the network to be queried belongs.
ChildInstanceRegionId pulumi.StringPtrInput `pulumi:"childInstanceRegionId"`
// The type of the associated network. Valid values: `VPC`, `VBR` and `CCN`.
ChildInstanceType pulumi.StringPtrInput `pulumi:"childInstanceType"`
// The ID of the CEN instance.
InstanceId pulumi.StringInput `pulumi:"instanceId"`
OutputFile pulumi.StringPtrInput `pulumi:"outputFile"`
// The status of the Cen Child Instance Attachment. Valid value: `Attaching`, `Attached` and `Aetaching`.
Status pulumi.StringPtrInput `pulumi:"status"`
}
func (GetInstanceAttachmentsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetInstanceAttachmentsArgs)(nil)).Elem()
}
// A collection of values returned by getInstanceAttachments.
type GetInstanceAttachmentsResultOutput struct{ *pulumi.OutputState }
func (GetInstanceAttachmentsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetInstanceAttachmentsResult)(nil)).Elem()
}
func (o GetInstanceAttachmentsResultOutput) ToGetInstanceAttachmentsResultOutput() GetInstanceAttachmentsResultOutput {
return o
}
func (o GetInstanceAttachmentsResultOutput) ToGetInstanceAttachmentsResultOutputWithContext(ctx context.Context) GetInstanceAttachmentsResultOutput {
return o
}
// A list of CEN Instance Attachments. Each element contains the following attributes:
func (o GetInstanceAttachmentsResultOutput) Attachments() GetInstanceAttachmentsAttachmentArrayOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) []GetInstanceAttachmentsAttachment { return v.Attachments }).(GetInstanceAttachmentsAttachmentArrayOutput)
}
// The ID of the region to which the network belongs.
func (o GetInstanceAttachmentsResultOutput) ChildInstanceRegionId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) *string { return v.ChildInstanceRegionId }).(pulumi.StringPtrOutput)
}
// The type of the associated network.
func (o GetInstanceAttachmentsResultOutput) ChildInstanceType() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) *string { return v.ChildInstanceType }).(pulumi.StringPtrOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetInstanceAttachmentsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) string { return v.Id }).(pulumi.StringOutput)
}
// A list of CEN Instance Attachment IDs.
func (o GetInstanceAttachmentsResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
// The ID of the CEN instance.
func (o GetInstanceAttachmentsResultOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) string { return v.InstanceId }).(pulumi.StringOutput)
}
func (o GetInstanceAttachmentsResultOutput) OutputFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) *string { return v.OutputFile }).(pulumi.StringPtrOutput)
}
// The status of the network.
func (o GetInstanceAttachmentsResultOutput) Status() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetInstanceAttachmentsResult) *string { return v.Status }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetInstanceAttachmentsResultOutput{})
}