github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpclattice/serviceNetwork.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package vpclattice 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Resource for managing an AWS VPC Lattice Service Network. 15 // 16 // ## Example Usage 17 // 18 // ### Basic Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := vpclattice.NewServiceNetwork(ctx, "example", &vpclattice.ServiceNetworkArgs{ 34 // Name: pulumi.String("example"), 35 // AuthType: pulumi.String("AWS_IAM"), 36 // }) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 // 47 // ## Import 48 // 49 // Using `pulumi import`, import VPC Lattice Service Network using the `id`. For example: 50 // 51 // ```sh 52 // $ pulumi import aws:vpclattice/serviceNetwork:ServiceNetwork example sn-0158f91c1e3358dba 53 // ``` 54 type ServiceNetwork struct { 55 pulumi.CustomResourceState 56 57 // ARN of the Service Network. 58 Arn pulumi.StringOutput `pulumi:"arn"` 59 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 60 AuthType pulumi.StringOutput `pulumi:"authType"` 61 // Name of the service network 62 // 63 // The following arguments are optional: 64 Name pulumi.StringOutput `pulumi:"name"` 65 // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 66 Tags pulumi.StringMapOutput `pulumi:"tags"` 67 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 68 // 69 // Deprecated: Please use `tags` instead. 70 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 71 } 72 73 // NewServiceNetwork registers a new resource with the given unique name, arguments, and options. 74 func NewServiceNetwork(ctx *pulumi.Context, 75 name string, args *ServiceNetworkArgs, opts ...pulumi.ResourceOption) (*ServiceNetwork, error) { 76 if args == nil { 77 args = &ServiceNetworkArgs{} 78 } 79 80 opts = internal.PkgResourceDefaultOpts(opts) 81 var resource ServiceNetwork 82 err := ctx.RegisterResource("aws:vpclattice/serviceNetwork:ServiceNetwork", name, args, &resource, opts...) 83 if err != nil { 84 return nil, err 85 } 86 return &resource, nil 87 } 88 89 // GetServiceNetwork gets an existing ServiceNetwork resource's state with the given name, ID, and optional 90 // state properties that are used to uniquely qualify the lookup (nil if not required). 91 func GetServiceNetwork(ctx *pulumi.Context, 92 name string, id pulumi.IDInput, state *ServiceNetworkState, opts ...pulumi.ResourceOption) (*ServiceNetwork, error) { 93 var resource ServiceNetwork 94 err := ctx.ReadResource("aws:vpclattice/serviceNetwork:ServiceNetwork", name, id, state, &resource, opts...) 95 if err != nil { 96 return nil, err 97 } 98 return &resource, nil 99 } 100 101 // Input properties used for looking up and filtering ServiceNetwork resources. 102 type serviceNetworkState struct { 103 // ARN of the Service Network. 104 Arn *string `pulumi:"arn"` 105 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 106 AuthType *string `pulumi:"authType"` 107 // Name of the service network 108 // 109 // The following arguments are optional: 110 Name *string `pulumi:"name"` 111 // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 112 Tags map[string]string `pulumi:"tags"` 113 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 114 // 115 // Deprecated: Please use `tags` instead. 116 TagsAll map[string]string `pulumi:"tagsAll"` 117 } 118 119 type ServiceNetworkState struct { 120 // ARN of the Service Network. 121 Arn pulumi.StringPtrInput 122 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 123 AuthType pulumi.StringPtrInput 124 // Name of the service network 125 // 126 // The following arguments are optional: 127 Name pulumi.StringPtrInput 128 // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 129 Tags pulumi.StringMapInput 130 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 131 // 132 // Deprecated: Please use `tags` instead. 133 TagsAll pulumi.StringMapInput 134 } 135 136 func (ServiceNetworkState) ElementType() reflect.Type { 137 return reflect.TypeOf((*serviceNetworkState)(nil)).Elem() 138 } 139 140 type serviceNetworkArgs struct { 141 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 142 AuthType *string `pulumi:"authType"` 143 // Name of the service network 144 // 145 // The following arguments are optional: 146 Name *string `pulumi:"name"` 147 // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 148 Tags map[string]string `pulumi:"tags"` 149 } 150 151 // The set of arguments for constructing a ServiceNetwork resource. 152 type ServiceNetworkArgs struct { 153 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 154 AuthType pulumi.StringPtrInput 155 // Name of the service network 156 // 157 // The following arguments are optional: 158 Name pulumi.StringPtrInput 159 // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 160 Tags pulumi.StringMapInput 161 } 162 163 func (ServiceNetworkArgs) ElementType() reflect.Type { 164 return reflect.TypeOf((*serviceNetworkArgs)(nil)).Elem() 165 } 166 167 type ServiceNetworkInput interface { 168 pulumi.Input 169 170 ToServiceNetworkOutput() ServiceNetworkOutput 171 ToServiceNetworkOutputWithContext(ctx context.Context) ServiceNetworkOutput 172 } 173 174 func (*ServiceNetwork) ElementType() reflect.Type { 175 return reflect.TypeOf((**ServiceNetwork)(nil)).Elem() 176 } 177 178 func (i *ServiceNetwork) ToServiceNetworkOutput() ServiceNetworkOutput { 179 return i.ToServiceNetworkOutputWithContext(context.Background()) 180 } 181 182 func (i *ServiceNetwork) ToServiceNetworkOutputWithContext(ctx context.Context) ServiceNetworkOutput { 183 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkOutput) 184 } 185 186 // ServiceNetworkArrayInput is an input type that accepts ServiceNetworkArray and ServiceNetworkArrayOutput values. 187 // You can construct a concrete instance of `ServiceNetworkArrayInput` via: 188 // 189 // ServiceNetworkArray{ ServiceNetworkArgs{...} } 190 type ServiceNetworkArrayInput interface { 191 pulumi.Input 192 193 ToServiceNetworkArrayOutput() ServiceNetworkArrayOutput 194 ToServiceNetworkArrayOutputWithContext(context.Context) ServiceNetworkArrayOutput 195 } 196 197 type ServiceNetworkArray []ServiceNetworkInput 198 199 func (ServiceNetworkArray) ElementType() reflect.Type { 200 return reflect.TypeOf((*[]*ServiceNetwork)(nil)).Elem() 201 } 202 203 func (i ServiceNetworkArray) ToServiceNetworkArrayOutput() ServiceNetworkArrayOutput { 204 return i.ToServiceNetworkArrayOutputWithContext(context.Background()) 205 } 206 207 func (i ServiceNetworkArray) ToServiceNetworkArrayOutputWithContext(ctx context.Context) ServiceNetworkArrayOutput { 208 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkArrayOutput) 209 } 210 211 // ServiceNetworkMapInput is an input type that accepts ServiceNetworkMap and ServiceNetworkMapOutput values. 212 // You can construct a concrete instance of `ServiceNetworkMapInput` via: 213 // 214 // ServiceNetworkMap{ "key": ServiceNetworkArgs{...} } 215 type ServiceNetworkMapInput interface { 216 pulumi.Input 217 218 ToServiceNetworkMapOutput() ServiceNetworkMapOutput 219 ToServiceNetworkMapOutputWithContext(context.Context) ServiceNetworkMapOutput 220 } 221 222 type ServiceNetworkMap map[string]ServiceNetworkInput 223 224 func (ServiceNetworkMap) ElementType() reflect.Type { 225 return reflect.TypeOf((*map[string]*ServiceNetwork)(nil)).Elem() 226 } 227 228 func (i ServiceNetworkMap) ToServiceNetworkMapOutput() ServiceNetworkMapOutput { 229 return i.ToServiceNetworkMapOutputWithContext(context.Background()) 230 } 231 232 func (i ServiceNetworkMap) ToServiceNetworkMapOutputWithContext(ctx context.Context) ServiceNetworkMapOutput { 233 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkMapOutput) 234 } 235 236 type ServiceNetworkOutput struct{ *pulumi.OutputState } 237 238 func (ServiceNetworkOutput) ElementType() reflect.Type { 239 return reflect.TypeOf((**ServiceNetwork)(nil)).Elem() 240 } 241 242 func (o ServiceNetworkOutput) ToServiceNetworkOutput() ServiceNetworkOutput { 243 return o 244 } 245 246 func (o ServiceNetworkOutput) ToServiceNetworkOutputWithContext(ctx context.Context) ServiceNetworkOutput { 247 return o 248 } 249 250 // ARN of the Service Network. 251 func (o ServiceNetworkOutput) Arn() pulumi.StringOutput { 252 return o.ApplyT(func(v *ServiceNetwork) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 253 } 254 255 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 256 func (o ServiceNetworkOutput) AuthType() pulumi.StringOutput { 257 return o.ApplyT(func(v *ServiceNetwork) pulumi.StringOutput { return v.AuthType }).(pulumi.StringOutput) 258 } 259 260 // Name of the service network 261 // 262 // The following arguments are optional: 263 func (o ServiceNetworkOutput) Name() pulumi.StringOutput { 264 return o.ApplyT(func(v *ServiceNetwork) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 265 } 266 267 // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 268 func (o ServiceNetworkOutput) Tags() pulumi.StringMapOutput { 269 return o.ApplyT(func(v *ServiceNetwork) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 270 } 271 272 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 273 // 274 // Deprecated: Please use `tags` instead. 275 func (o ServiceNetworkOutput) TagsAll() pulumi.StringMapOutput { 276 return o.ApplyT(func(v *ServiceNetwork) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 277 } 278 279 type ServiceNetworkArrayOutput struct{ *pulumi.OutputState } 280 281 func (ServiceNetworkArrayOutput) ElementType() reflect.Type { 282 return reflect.TypeOf((*[]*ServiceNetwork)(nil)).Elem() 283 } 284 285 func (o ServiceNetworkArrayOutput) ToServiceNetworkArrayOutput() ServiceNetworkArrayOutput { 286 return o 287 } 288 289 func (o ServiceNetworkArrayOutput) ToServiceNetworkArrayOutputWithContext(ctx context.Context) ServiceNetworkArrayOutput { 290 return o 291 } 292 293 func (o ServiceNetworkArrayOutput) Index(i pulumi.IntInput) ServiceNetworkOutput { 294 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceNetwork { 295 return vs[0].([]*ServiceNetwork)[vs[1].(int)] 296 }).(ServiceNetworkOutput) 297 } 298 299 type ServiceNetworkMapOutput struct{ *pulumi.OutputState } 300 301 func (ServiceNetworkMapOutput) ElementType() reflect.Type { 302 return reflect.TypeOf((*map[string]*ServiceNetwork)(nil)).Elem() 303 } 304 305 func (o ServiceNetworkMapOutput) ToServiceNetworkMapOutput() ServiceNetworkMapOutput { 306 return o 307 } 308 309 func (o ServiceNetworkMapOutput) ToServiceNetworkMapOutputWithContext(ctx context.Context) ServiceNetworkMapOutput { 310 return o 311 } 312 313 func (o ServiceNetworkMapOutput) MapIndex(k pulumi.StringInput) ServiceNetworkOutput { 314 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceNetwork { 315 return vs[0].(map[string]*ServiceNetwork)[vs[1].(string)] 316 }).(ServiceNetworkOutput) 317 } 318 319 func init() { 320 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkInput)(nil)).Elem(), &ServiceNetwork{}) 321 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkArrayInput)(nil)).Elem(), ServiceNetworkArray{}) 322 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkMapInput)(nil)).Elem(), ServiceNetworkMap{}) 323 pulumi.RegisterOutputType(ServiceNetworkOutput{}) 324 pulumi.RegisterOutputType(ServiceNetworkArrayOutput{}) 325 pulumi.RegisterOutputType(ServiceNetworkMapOutput{}) 326 }