/
instanceAttachment.go
158 lines (129 loc) · 5.55 KB
/
instanceAttachment.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new attachment of an environment to an instance. **Note:** Not supported for Apigee hybrid.
// Auto-naming is currently not supported for this resource.
type InstanceAttachment struct {
pulumi.CustomResourceState
// Time the attachment was created in milliseconds since epoch.
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// ID of the attached environment.
Environment pulumi.StringOutput `pulumi:"environment"`
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// ID of the attachment.
Name pulumi.StringOutput `pulumi:"name"`
OrganizationId pulumi.StringOutput `pulumi:"organizationId"`
}
// NewInstanceAttachment registers a new resource with the given unique name, arguments, and options.
func NewInstanceAttachment(ctx *pulumi.Context,
name string, args *InstanceAttachmentArgs, opts ...pulumi.ResourceOption) (*InstanceAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
if args.OrganizationId == nil {
return nil, errors.New("invalid value for required argument 'OrganizationId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"instanceId",
"organizationId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource InstanceAttachment
err := ctx.RegisterResource("google-native:apigee/v1:InstanceAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInstanceAttachment gets an existing InstanceAttachment 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 GetInstanceAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InstanceAttachmentState, opts ...pulumi.ResourceOption) (*InstanceAttachment, error) {
var resource InstanceAttachment
err := ctx.ReadResource("google-native:apigee/v1:InstanceAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering InstanceAttachment resources.
type instanceAttachmentState struct {
}
type InstanceAttachmentState struct {
}
func (InstanceAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*instanceAttachmentState)(nil)).Elem()
}
type instanceAttachmentArgs struct {
// ID of the attached environment.
Environment *string `pulumi:"environment"`
InstanceId string `pulumi:"instanceId"`
OrganizationId string `pulumi:"organizationId"`
}
// The set of arguments for constructing a InstanceAttachment resource.
type InstanceAttachmentArgs struct {
// ID of the attached environment.
Environment pulumi.StringPtrInput
InstanceId pulumi.StringInput
OrganizationId pulumi.StringInput
}
func (InstanceAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*instanceAttachmentArgs)(nil)).Elem()
}
type InstanceAttachmentInput interface {
pulumi.Input
ToInstanceAttachmentOutput() InstanceAttachmentOutput
ToInstanceAttachmentOutputWithContext(ctx context.Context) InstanceAttachmentOutput
}
func (*InstanceAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**InstanceAttachment)(nil)).Elem()
}
func (i *InstanceAttachment) ToInstanceAttachmentOutput() InstanceAttachmentOutput {
return i.ToInstanceAttachmentOutputWithContext(context.Background())
}
func (i *InstanceAttachment) ToInstanceAttachmentOutputWithContext(ctx context.Context) InstanceAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceAttachmentOutput)
}
type InstanceAttachmentOutput struct{ *pulumi.OutputState }
func (InstanceAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**InstanceAttachment)(nil)).Elem()
}
func (o InstanceAttachmentOutput) ToInstanceAttachmentOutput() InstanceAttachmentOutput {
return o
}
func (o InstanceAttachmentOutput) ToInstanceAttachmentOutputWithContext(ctx context.Context) InstanceAttachmentOutput {
return o
}
// Time the attachment was created in milliseconds since epoch.
func (o InstanceAttachmentOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceAttachment) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// ID of the attached environment.
func (o InstanceAttachmentOutput) Environment() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceAttachment) pulumi.StringOutput { return v.Environment }).(pulumi.StringOutput)
}
func (o InstanceAttachmentOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceAttachment) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// ID of the attachment.
func (o InstanceAttachmentOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceAttachment) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o InstanceAttachmentOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v *InstanceAttachment) pulumi.StringOutput { return v.OrganizationId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InstanceAttachmentInput)(nil)).Elem(), &InstanceAttachment{})
pulumi.RegisterOutputType(InstanceAttachmentOutput{})
}