github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpclattice/service.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. 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.NewService(ctx, "example", &vpclattice.ServiceArgs{ 34 // Name: pulumi.String("example"), 35 // AuthType: pulumi.String("AWS_IAM"), 36 // CustomDomainName: pulumi.String("example.com"), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import VPC Lattice Service using the `id`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:vpclattice/service:Service example svc-06728e2357ea55f8a 54 // ``` 55 type Service struct { 56 pulumi.CustomResourceState 57 58 // ARN of the service. 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 61 AuthType pulumi.StringOutput `pulumi:"authType"` 62 // Amazon Resource Name (ARN) of the certificate. 63 CertificateArn pulumi.StringPtrOutput `pulumi:"certificateArn"` 64 // Custom domain name of the service. 65 CustomDomainName pulumi.StringPtrOutput `pulumi:"customDomainName"` 66 // DNS name of the service. 67 DnsEntries ServiceDnsEntryArrayOutput `pulumi:"dnsEntries"` 68 // Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. 69 // 70 // The following arguments are optional: 71 Name pulumi.StringOutput `pulumi:"name"` 72 // Status of the service. 73 Status pulumi.StringOutput `pulumi:"status"` 74 // 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. 75 Tags pulumi.StringMapOutput `pulumi:"tags"` 76 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 77 // 78 // Deprecated: Please use `tags` instead. 79 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 80 } 81 82 // NewService registers a new resource with the given unique name, arguments, and options. 83 func NewService(ctx *pulumi.Context, 84 name string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) { 85 if args == nil { 86 args = &ServiceArgs{} 87 } 88 89 opts = internal.PkgResourceDefaultOpts(opts) 90 var resource Service 91 err := ctx.RegisterResource("aws:vpclattice/service:Service", name, args, &resource, opts...) 92 if err != nil { 93 return nil, err 94 } 95 return &resource, nil 96 } 97 98 // GetService gets an existing Service resource's state with the given name, ID, and optional 99 // state properties that are used to uniquely qualify the lookup (nil if not required). 100 func GetService(ctx *pulumi.Context, 101 name string, id pulumi.IDInput, state *ServiceState, opts ...pulumi.ResourceOption) (*Service, error) { 102 var resource Service 103 err := ctx.ReadResource("aws:vpclattice/service:Service", name, id, state, &resource, opts...) 104 if err != nil { 105 return nil, err 106 } 107 return &resource, nil 108 } 109 110 // Input properties used for looking up and filtering Service resources. 111 type serviceState struct { 112 // ARN of the service. 113 Arn *string `pulumi:"arn"` 114 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 115 AuthType *string `pulumi:"authType"` 116 // Amazon Resource Name (ARN) of the certificate. 117 CertificateArn *string `pulumi:"certificateArn"` 118 // Custom domain name of the service. 119 CustomDomainName *string `pulumi:"customDomainName"` 120 // DNS name of the service. 121 DnsEntries []ServiceDnsEntry `pulumi:"dnsEntries"` 122 // Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. 123 // 124 // The following arguments are optional: 125 Name *string `pulumi:"name"` 126 // Status of the service. 127 Status *string `pulumi:"status"` 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 map[string]string `pulumi:"tags"` 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 map[string]string `pulumi:"tagsAll"` 134 } 135 136 type ServiceState struct { 137 // ARN of the service. 138 Arn pulumi.StringPtrInput 139 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 140 AuthType pulumi.StringPtrInput 141 // Amazon Resource Name (ARN) of the certificate. 142 CertificateArn pulumi.StringPtrInput 143 // Custom domain name of the service. 144 CustomDomainName pulumi.StringPtrInput 145 // DNS name of the service. 146 DnsEntries ServiceDnsEntryArrayInput 147 // Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. 148 // 149 // The following arguments are optional: 150 Name pulumi.StringPtrInput 151 // Status of the service. 152 Status pulumi.StringPtrInput 153 // 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. 154 Tags pulumi.StringMapInput 155 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 156 // 157 // Deprecated: Please use `tags` instead. 158 TagsAll pulumi.StringMapInput 159 } 160 161 func (ServiceState) ElementType() reflect.Type { 162 return reflect.TypeOf((*serviceState)(nil)).Elem() 163 } 164 165 type serviceArgs struct { 166 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 167 AuthType *string `pulumi:"authType"` 168 // Amazon Resource Name (ARN) of the certificate. 169 CertificateArn *string `pulumi:"certificateArn"` 170 // Custom domain name of the service. 171 CustomDomainName *string `pulumi:"customDomainName"` 172 // Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. 173 // 174 // The following arguments are optional: 175 Name *string `pulumi:"name"` 176 // 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. 177 Tags map[string]string `pulumi:"tags"` 178 } 179 180 // The set of arguments for constructing a Service resource. 181 type ServiceArgs struct { 182 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 183 AuthType pulumi.StringPtrInput 184 // Amazon Resource Name (ARN) of the certificate. 185 CertificateArn pulumi.StringPtrInput 186 // Custom domain name of the service. 187 CustomDomainName pulumi.StringPtrInput 188 // Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. 189 // 190 // The following arguments are optional: 191 Name pulumi.StringPtrInput 192 // 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. 193 Tags pulumi.StringMapInput 194 } 195 196 func (ServiceArgs) ElementType() reflect.Type { 197 return reflect.TypeOf((*serviceArgs)(nil)).Elem() 198 } 199 200 type ServiceInput interface { 201 pulumi.Input 202 203 ToServiceOutput() ServiceOutput 204 ToServiceOutputWithContext(ctx context.Context) ServiceOutput 205 } 206 207 func (*Service) ElementType() reflect.Type { 208 return reflect.TypeOf((**Service)(nil)).Elem() 209 } 210 211 func (i *Service) ToServiceOutput() ServiceOutput { 212 return i.ToServiceOutputWithContext(context.Background()) 213 } 214 215 func (i *Service) ToServiceOutputWithContext(ctx context.Context) ServiceOutput { 216 return pulumi.ToOutputWithContext(ctx, i).(ServiceOutput) 217 } 218 219 // ServiceArrayInput is an input type that accepts ServiceArray and ServiceArrayOutput values. 220 // You can construct a concrete instance of `ServiceArrayInput` via: 221 // 222 // ServiceArray{ ServiceArgs{...} } 223 type ServiceArrayInput interface { 224 pulumi.Input 225 226 ToServiceArrayOutput() ServiceArrayOutput 227 ToServiceArrayOutputWithContext(context.Context) ServiceArrayOutput 228 } 229 230 type ServiceArray []ServiceInput 231 232 func (ServiceArray) ElementType() reflect.Type { 233 return reflect.TypeOf((*[]*Service)(nil)).Elem() 234 } 235 236 func (i ServiceArray) ToServiceArrayOutput() ServiceArrayOutput { 237 return i.ToServiceArrayOutputWithContext(context.Background()) 238 } 239 240 func (i ServiceArray) ToServiceArrayOutputWithContext(ctx context.Context) ServiceArrayOutput { 241 return pulumi.ToOutputWithContext(ctx, i).(ServiceArrayOutput) 242 } 243 244 // ServiceMapInput is an input type that accepts ServiceMap and ServiceMapOutput values. 245 // You can construct a concrete instance of `ServiceMapInput` via: 246 // 247 // ServiceMap{ "key": ServiceArgs{...} } 248 type ServiceMapInput interface { 249 pulumi.Input 250 251 ToServiceMapOutput() ServiceMapOutput 252 ToServiceMapOutputWithContext(context.Context) ServiceMapOutput 253 } 254 255 type ServiceMap map[string]ServiceInput 256 257 func (ServiceMap) ElementType() reflect.Type { 258 return reflect.TypeOf((*map[string]*Service)(nil)).Elem() 259 } 260 261 func (i ServiceMap) ToServiceMapOutput() ServiceMapOutput { 262 return i.ToServiceMapOutputWithContext(context.Background()) 263 } 264 265 func (i ServiceMap) ToServiceMapOutputWithContext(ctx context.Context) ServiceMapOutput { 266 return pulumi.ToOutputWithContext(ctx, i).(ServiceMapOutput) 267 } 268 269 type ServiceOutput struct{ *pulumi.OutputState } 270 271 func (ServiceOutput) ElementType() reflect.Type { 272 return reflect.TypeOf((**Service)(nil)).Elem() 273 } 274 275 func (o ServiceOutput) ToServiceOutput() ServiceOutput { 276 return o 277 } 278 279 func (o ServiceOutput) ToServiceOutputWithContext(ctx context.Context) ServiceOutput { 280 return o 281 } 282 283 // ARN of the service. 284 func (o ServiceOutput) Arn() pulumi.StringOutput { 285 return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 286 } 287 288 // Type of IAM policy. Either `NONE` or `AWS_IAM`. 289 func (o ServiceOutput) AuthType() pulumi.StringOutput { 290 return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.AuthType }).(pulumi.StringOutput) 291 } 292 293 // Amazon Resource Name (ARN) of the certificate. 294 func (o ServiceOutput) CertificateArn() pulumi.StringPtrOutput { 295 return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.CertificateArn }).(pulumi.StringPtrOutput) 296 } 297 298 // Custom domain name of the service. 299 func (o ServiceOutput) CustomDomainName() pulumi.StringPtrOutput { 300 return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.CustomDomainName }).(pulumi.StringPtrOutput) 301 } 302 303 // DNS name of the service. 304 func (o ServiceOutput) DnsEntries() ServiceDnsEntryArrayOutput { 305 return o.ApplyT(func(v *Service) ServiceDnsEntryArrayOutput { return v.DnsEntries }).(ServiceDnsEntryArrayOutput) 306 } 307 308 // Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. 309 // 310 // The following arguments are optional: 311 func (o ServiceOutput) Name() pulumi.StringOutput { 312 return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 313 } 314 315 // Status of the service. 316 func (o ServiceOutput) Status() pulumi.StringOutput { 317 return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 318 } 319 320 // 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. 321 func (o ServiceOutput) Tags() pulumi.StringMapOutput { 322 return o.ApplyT(func(v *Service) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 323 } 324 325 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 326 // 327 // Deprecated: Please use `tags` instead. 328 func (o ServiceOutput) TagsAll() pulumi.StringMapOutput { 329 return o.ApplyT(func(v *Service) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 330 } 331 332 type ServiceArrayOutput struct{ *pulumi.OutputState } 333 334 func (ServiceArrayOutput) ElementType() reflect.Type { 335 return reflect.TypeOf((*[]*Service)(nil)).Elem() 336 } 337 338 func (o ServiceArrayOutput) ToServiceArrayOutput() ServiceArrayOutput { 339 return o 340 } 341 342 func (o ServiceArrayOutput) ToServiceArrayOutputWithContext(ctx context.Context) ServiceArrayOutput { 343 return o 344 } 345 346 func (o ServiceArrayOutput) Index(i pulumi.IntInput) ServiceOutput { 347 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Service { 348 return vs[0].([]*Service)[vs[1].(int)] 349 }).(ServiceOutput) 350 } 351 352 type ServiceMapOutput struct{ *pulumi.OutputState } 353 354 func (ServiceMapOutput) ElementType() reflect.Type { 355 return reflect.TypeOf((*map[string]*Service)(nil)).Elem() 356 } 357 358 func (o ServiceMapOutput) ToServiceMapOutput() ServiceMapOutput { 359 return o 360 } 361 362 func (o ServiceMapOutput) ToServiceMapOutputWithContext(ctx context.Context) ServiceMapOutput { 363 return o 364 } 365 366 func (o ServiceMapOutput) MapIndex(k pulumi.StringInput) ServiceOutput { 367 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Service { 368 return vs[0].(map[string]*Service)[vs[1].(string)] 369 }).(ServiceOutput) 370 } 371 372 func init() { 373 pulumi.RegisterInputType(reflect.TypeOf((*ServiceInput)(nil)).Elem(), &Service{}) 374 pulumi.RegisterInputType(reflect.TypeOf((*ServiceArrayInput)(nil)).Elem(), ServiceArray{}) 375 pulumi.RegisterInputType(reflect.TypeOf((*ServiceMapInput)(nil)).Elem(), ServiceMap{}) 376 pulumi.RegisterOutputType(ServiceOutput{}) 377 pulumi.RegisterOutputType(ServiceArrayOutput{}) 378 pulumi.RegisterOutputType(ServiceMapOutput{}) 379 }