/
carrierGateway.go
158 lines (129 loc) · 5.02 KB
/
carrierGateway.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 pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// An example resource schema demonstrating some basic constructs and validation rules.
type CarrierGateway struct {
pulumi.CustomResourceState
// The ID of the carrier gateway.
CarrierGatewayId pulumi.StringOutput `pulumi:"carrierGatewayId"`
// The ID of the owner.
OwnerId pulumi.StringOutput `pulumi:"ownerId"`
// The state of the carrier gateway.
State pulumi.StringOutput `pulumi:"state"`
// The tags for the carrier gateway.
Tags aws.TagArrayOutput `pulumi:"tags"`
// The ID of the VPC.
VpcId pulumi.StringOutput `pulumi:"vpcId"`
}
// NewCarrierGateway registers a new resource with the given unique name, arguments, and options.
func NewCarrierGateway(ctx *pulumi.Context,
name string, args *CarrierGatewayArgs, opts ...pulumi.ResourceOption) (*CarrierGateway, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.VpcId == nil {
return nil, errors.New("invalid value for required argument 'VpcId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"vpcId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource CarrierGateway
err := ctx.RegisterResource("aws-native:ec2:CarrierGateway", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCarrierGateway gets an existing CarrierGateway 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 GetCarrierGateway(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CarrierGatewayState, opts ...pulumi.ResourceOption) (*CarrierGateway, error) {
var resource CarrierGateway
err := ctx.ReadResource("aws-native:ec2:CarrierGateway", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CarrierGateway resources.
type carrierGatewayState struct {
}
type CarrierGatewayState struct {
}
func (CarrierGatewayState) ElementType() reflect.Type {
return reflect.TypeOf((*carrierGatewayState)(nil)).Elem()
}
type carrierGatewayArgs struct {
// The tags for the carrier gateway.
Tags []aws.Tag `pulumi:"tags"`
// The ID of the VPC.
VpcId string `pulumi:"vpcId"`
}
// The set of arguments for constructing a CarrierGateway resource.
type CarrierGatewayArgs struct {
// The tags for the carrier gateway.
Tags aws.TagArrayInput
// The ID of the VPC.
VpcId pulumi.StringInput
}
func (CarrierGatewayArgs) ElementType() reflect.Type {
return reflect.TypeOf((*carrierGatewayArgs)(nil)).Elem()
}
type CarrierGatewayInput interface {
pulumi.Input
ToCarrierGatewayOutput() CarrierGatewayOutput
ToCarrierGatewayOutputWithContext(ctx context.Context) CarrierGatewayOutput
}
func (*CarrierGateway) ElementType() reflect.Type {
return reflect.TypeOf((**CarrierGateway)(nil)).Elem()
}
func (i *CarrierGateway) ToCarrierGatewayOutput() CarrierGatewayOutput {
return i.ToCarrierGatewayOutputWithContext(context.Background())
}
func (i *CarrierGateway) ToCarrierGatewayOutputWithContext(ctx context.Context) CarrierGatewayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CarrierGatewayOutput)
}
type CarrierGatewayOutput struct{ *pulumi.OutputState }
func (CarrierGatewayOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CarrierGateway)(nil)).Elem()
}
func (o CarrierGatewayOutput) ToCarrierGatewayOutput() CarrierGatewayOutput {
return o
}
func (o CarrierGatewayOutput) ToCarrierGatewayOutputWithContext(ctx context.Context) CarrierGatewayOutput {
return o
}
// The ID of the carrier gateway.
func (o CarrierGatewayOutput) CarrierGatewayId() pulumi.StringOutput {
return o.ApplyT(func(v *CarrierGateway) pulumi.StringOutput { return v.CarrierGatewayId }).(pulumi.StringOutput)
}
// The ID of the owner.
func (o CarrierGatewayOutput) OwnerId() pulumi.StringOutput {
return o.ApplyT(func(v *CarrierGateway) pulumi.StringOutput { return v.OwnerId }).(pulumi.StringOutput)
}
// The state of the carrier gateway.
func (o CarrierGatewayOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *CarrierGateway) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// The tags for the carrier gateway.
func (o CarrierGatewayOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v *CarrierGateway) aws.TagArrayOutput { return v.Tags }).(aws.TagArrayOutput)
}
// The ID of the VPC.
func (o CarrierGatewayOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v *CarrierGateway) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CarrierGatewayInput)(nil)).Elem(), &CarrierGateway{})
pulumi.RegisterOutputType(CarrierGatewayOutput{})
}