/
fargateProfile.go
188 lines (157 loc) · 6.53 KB
/
fargateProfile.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
// 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 eks
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"
)
// Resource Schema for AWS::EKS::FargateProfile
type FargateProfile struct {
pulumi.CustomResourceState
Arn pulumi.StringOutput `pulumi:"arn"`
// Name of the Cluster
ClusterName pulumi.StringOutput `pulumi:"clusterName"`
// Name of FargateProfile
FargateProfileName pulumi.StringPtrOutput `pulumi:"fargateProfileName"`
// The IAM policy arn for pods
PodExecutionRoleArn pulumi.StringOutput `pulumi:"podExecutionRoleArn"`
Selectors FargateProfileSelectorArrayOutput `pulumi:"selectors"`
Subnets pulumi.StringArrayOutput `pulumi:"subnets"`
// An array of key-value pairs to apply to this resource.
Tags aws.TagArrayOutput `pulumi:"tags"`
}
// NewFargateProfile registers a new resource with the given unique name, arguments, and options.
func NewFargateProfile(ctx *pulumi.Context,
name string, args *FargateProfileArgs, opts ...pulumi.ResourceOption) (*FargateProfile, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterName == nil {
return nil, errors.New("invalid value for required argument 'ClusterName'")
}
if args.PodExecutionRoleArn == nil {
return nil, errors.New("invalid value for required argument 'PodExecutionRoleArn'")
}
if args.Selectors == nil {
return nil, errors.New("invalid value for required argument 'Selectors'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"clusterName",
"fargateProfileName",
"podExecutionRoleArn",
"selectors[*]",
"subnets[*]",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource FargateProfile
err := ctx.RegisterResource("aws-native:eks:FargateProfile", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFargateProfile gets an existing FargateProfile 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 GetFargateProfile(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FargateProfileState, opts ...pulumi.ResourceOption) (*FargateProfile, error) {
var resource FargateProfile
err := ctx.ReadResource("aws-native:eks:FargateProfile", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering FargateProfile resources.
type fargateProfileState struct {
}
type FargateProfileState struct {
}
func (FargateProfileState) ElementType() reflect.Type {
return reflect.TypeOf((*fargateProfileState)(nil)).Elem()
}
type fargateProfileArgs struct {
// Name of the Cluster
ClusterName string `pulumi:"clusterName"`
// Name of FargateProfile
FargateProfileName *string `pulumi:"fargateProfileName"`
// The IAM policy arn for pods
PodExecutionRoleArn string `pulumi:"podExecutionRoleArn"`
Selectors []FargateProfileSelector `pulumi:"selectors"`
Subnets []string `pulumi:"subnets"`
// An array of key-value pairs to apply to this resource.
Tags []aws.Tag `pulumi:"tags"`
}
// The set of arguments for constructing a FargateProfile resource.
type FargateProfileArgs struct {
// Name of the Cluster
ClusterName pulumi.StringInput
// Name of FargateProfile
FargateProfileName pulumi.StringPtrInput
// The IAM policy arn for pods
PodExecutionRoleArn pulumi.StringInput
Selectors FargateProfileSelectorArrayInput
Subnets pulumi.StringArrayInput
// An array of key-value pairs to apply to this resource.
Tags aws.TagArrayInput
}
func (FargateProfileArgs) ElementType() reflect.Type {
return reflect.TypeOf((*fargateProfileArgs)(nil)).Elem()
}
type FargateProfileInput interface {
pulumi.Input
ToFargateProfileOutput() FargateProfileOutput
ToFargateProfileOutputWithContext(ctx context.Context) FargateProfileOutput
}
func (*FargateProfile) ElementType() reflect.Type {
return reflect.TypeOf((**FargateProfile)(nil)).Elem()
}
func (i *FargateProfile) ToFargateProfileOutput() FargateProfileOutput {
return i.ToFargateProfileOutputWithContext(context.Background())
}
func (i *FargateProfile) ToFargateProfileOutputWithContext(ctx context.Context) FargateProfileOutput {
return pulumi.ToOutputWithContext(ctx, i).(FargateProfileOutput)
}
type FargateProfileOutput struct{ *pulumi.OutputState }
func (FargateProfileOutput) ElementType() reflect.Type {
return reflect.TypeOf((**FargateProfile)(nil)).Elem()
}
func (o FargateProfileOutput) ToFargateProfileOutput() FargateProfileOutput {
return o
}
func (o FargateProfileOutput) ToFargateProfileOutputWithContext(ctx context.Context) FargateProfileOutput {
return o
}
func (o FargateProfileOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *FargateProfile) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Name of the Cluster
func (o FargateProfileOutput) ClusterName() pulumi.StringOutput {
return o.ApplyT(func(v *FargateProfile) pulumi.StringOutput { return v.ClusterName }).(pulumi.StringOutput)
}
// Name of FargateProfile
func (o FargateProfileOutput) FargateProfileName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *FargateProfile) pulumi.StringPtrOutput { return v.FargateProfileName }).(pulumi.StringPtrOutput)
}
// The IAM policy arn for pods
func (o FargateProfileOutput) PodExecutionRoleArn() pulumi.StringOutput {
return o.ApplyT(func(v *FargateProfile) pulumi.StringOutput { return v.PodExecutionRoleArn }).(pulumi.StringOutput)
}
func (o FargateProfileOutput) Selectors() FargateProfileSelectorArrayOutput {
return o.ApplyT(func(v *FargateProfile) FargateProfileSelectorArrayOutput { return v.Selectors }).(FargateProfileSelectorArrayOutput)
}
func (o FargateProfileOutput) Subnets() pulumi.StringArrayOutput {
return o.ApplyT(func(v *FargateProfile) pulumi.StringArrayOutput { return v.Subnets }).(pulumi.StringArrayOutput)
}
// An array of key-value pairs to apply to this resource.
func (o FargateProfileOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v *FargateProfile) aws.TagArrayOutput { return v.Tags }).(aws.TagArrayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FargateProfileInput)(nil)).Elem(), &FargateProfile{})
pulumi.RegisterOutputType(FargateProfileOutput{})
}