github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpclattice/serviceNetworkServiceAssociation.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 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Resource for managing an AWS VPC Lattice Service Network Service Association. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := vpclattice.NewServiceNetworkServiceAssociation(ctx, "example", &vpclattice.ServiceNetworkServiceAssociationArgs{ 35 // ServiceIdentifier: pulumi.Any(exampleAwsVpclatticeService.Id), 36 // ServiceNetworkIdentifier: pulumi.Any(exampleAwsVpclatticeServiceNetwork.Id), 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 Network Service Association using the `id`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:vpclattice/serviceNetworkServiceAssociation:ServiceNetworkServiceAssociation example snsa-05e2474658a88f6ba 54 // ``` 55 type ServiceNetworkServiceAssociation struct { 56 pulumi.CustomResourceState 57 58 // The ARN of the Association. 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // The account that created the association. 61 CreatedBy pulumi.StringOutput `pulumi:"createdBy"` 62 // The custom domain name of the service. 63 CustomDomainName pulumi.StringOutput `pulumi:"customDomainName"` 64 // The DNS name of the service. 65 DnsEntries ServiceNetworkServiceAssociationDnsEntryArrayOutput `pulumi:"dnsEntries"` 66 // The ID or Amazon Resource Identifier (ARN) of the service. 67 ServiceIdentifier pulumi.StringOutput `pulumi:"serviceIdentifier"` 68 // The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. 69 // The following arguments are optional: 70 ServiceNetworkIdentifier pulumi.StringOutput `pulumi:"serviceNetworkIdentifier"` 71 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 72 Status pulumi.StringOutput `pulumi:"status"` 73 // 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. 74 Tags pulumi.StringMapOutput `pulumi:"tags"` 75 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 76 // 77 // Deprecated: Please use `tags` instead. 78 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 79 } 80 81 // NewServiceNetworkServiceAssociation registers a new resource with the given unique name, arguments, and options. 82 func NewServiceNetworkServiceAssociation(ctx *pulumi.Context, 83 name string, args *ServiceNetworkServiceAssociationArgs, opts ...pulumi.ResourceOption) (*ServiceNetworkServiceAssociation, error) { 84 if args == nil { 85 return nil, errors.New("missing one or more required arguments") 86 } 87 88 if args.ServiceIdentifier == nil { 89 return nil, errors.New("invalid value for required argument 'ServiceIdentifier'") 90 } 91 if args.ServiceNetworkIdentifier == nil { 92 return nil, errors.New("invalid value for required argument 'ServiceNetworkIdentifier'") 93 } 94 opts = internal.PkgResourceDefaultOpts(opts) 95 var resource ServiceNetworkServiceAssociation 96 err := ctx.RegisterResource("aws:vpclattice/serviceNetworkServiceAssociation:ServiceNetworkServiceAssociation", name, args, &resource, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return &resource, nil 101 } 102 103 // GetServiceNetworkServiceAssociation gets an existing ServiceNetworkServiceAssociation resource's state with the given name, ID, and optional 104 // state properties that are used to uniquely qualify the lookup (nil if not required). 105 func GetServiceNetworkServiceAssociation(ctx *pulumi.Context, 106 name string, id pulumi.IDInput, state *ServiceNetworkServiceAssociationState, opts ...pulumi.ResourceOption) (*ServiceNetworkServiceAssociation, error) { 107 var resource ServiceNetworkServiceAssociation 108 err := ctx.ReadResource("aws:vpclattice/serviceNetworkServiceAssociation:ServiceNetworkServiceAssociation", name, id, state, &resource, opts...) 109 if err != nil { 110 return nil, err 111 } 112 return &resource, nil 113 } 114 115 // Input properties used for looking up and filtering ServiceNetworkServiceAssociation resources. 116 type serviceNetworkServiceAssociationState struct { 117 // The ARN of the Association. 118 Arn *string `pulumi:"arn"` 119 // The account that created the association. 120 CreatedBy *string `pulumi:"createdBy"` 121 // The custom domain name of the service. 122 CustomDomainName *string `pulumi:"customDomainName"` 123 // The DNS name of the service. 124 DnsEntries []ServiceNetworkServiceAssociationDnsEntry `pulumi:"dnsEntries"` 125 // The ID or Amazon Resource Identifier (ARN) of the service. 126 ServiceIdentifier *string `pulumi:"serviceIdentifier"` 127 // The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. 128 // The following arguments are optional: 129 ServiceNetworkIdentifier *string `pulumi:"serviceNetworkIdentifier"` 130 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 131 Status *string `pulumi:"status"` 132 // 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. 133 Tags map[string]string `pulumi:"tags"` 134 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 135 // 136 // Deprecated: Please use `tags` instead. 137 TagsAll map[string]string `pulumi:"tagsAll"` 138 } 139 140 type ServiceNetworkServiceAssociationState struct { 141 // The ARN of the Association. 142 Arn pulumi.StringPtrInput 143 // The account that created the association. 144 CreatedBy pulumi.StringPtrInput 145 // The custom domain name of the service. 146 CustomDomainName pulumi.StringPtrInput 147 // The DNS name of the service. 148 DnsEntries ServiceNetworkServiceAssociationDnsEntryArrayInput 149 // The ID or Amazon Resource Identifier (ARN) of the service. 150 ServiceIdentifier pulumi.StringPtrInput 151 // The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. 152 // The following arguments are optional: 153 ServiceNetworkIdentifier pulumi.StringPtrInput 154 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 155 Status pulumi.StringPtrInput 156 // 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. 157 Tags pulumi.StringMapInput 158 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 159 // 160 // Deprecated: Please use `tags` instead. 161 TagsAll pulumi.StringMapInput 162 } 163 164 func (ServiceNetworkServiceAssociationState) ElementType() reflect.Type { 165 return reflect.TypeOf((*serviceNetworkServiceAssociationState)(nil)).Elem() 166 } 167 168 type serviceNetworkServiceAssociationArgs struct { 169 // The ID or Amazon Resource Identifier (ARN) of the service. 170 ServiceIdentifier string `pulumi:"serviceIdentifier"` 171 // The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. 172 // The following arguments are optional: 173 ServiceNetworkIdentifier string `pulumi:"serviceNetworkIdentifier"` 174 // 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. 175 Tags map[string]string `pulumi:"tags"` 176 } 177 178 // The set of arguments for constructing a ServiceNetworkServiceAssociation resource. 179 type ServiceNetworkServiceAssociationArgs struct { 180 // The ID or Amazon Resource Identifier (ARN) of the service. 181 ServiceIdentifier pulumi.StringInput 182 // The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. 183 // The following arguments are optional: 184 ServiceNetworkIdentifier pulumi.StringInput 185 // 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. 186 Tags pulumi.StringMapInput 187 } 188 189 func (ServiceNetworkServiceAssociationArgs) ElementType() reflect.Type { 190 return reflect.TypeOf((*serviceNetworkServiceAssociationArgs)(nil)).Elem() 191 } 192 193 type ServiceNetworkServiceAssociationInput interface { 194 pulumi.Input 195 196 ToServiceNetworkServiceAssociationOutput() ServiceNetworkServiceAssociationOutput 197 ToServiceNetworkServiceAssociationOutputWithContext(ctx context.Context) ServiceNetworkServiceAssociationOutput 198 } 199 200 func (*ServiceNetworkServiceAssociation) ElementType() reflect.Type { 201 return reflect.TypeOf((**ServiceNetworkServiceAssociation)(nil)).Elem() 202 } 203 204 func (i *ServiceNetworkServiceAssociation) ToServiceNetworkServiceAssociationOutput() ServiceNetworkServiceAssociationOutput { 205 return i.ToServiceNetworkServiceAssociationOutputWithContext(context.Background()) 206 } 207 208 func (i *ServiceNetworkServiceAssociation) ToServiceNetworkServiceAssociationOutputWithContext(ctx context.Context) ServiceNetworkServiceAssociationOutput { 209 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkServiceAssociationOutput) 210 } 211 212 // ServiceNetworkServiceAssociationArrayInput is an input type that accepts ServiceNetworkServiceAssociationArray and ServiceNetworkServiceAssociationArrayOutput values. 213 // You can construct a concrete instance of `ServiceNetworkServiceAssociationArrayInput` via: 214 // 215 // ServiceNetworkServiceAssociationArray{ ServiceNetworkServiceAssociationArgs{...} } 216 type ServiceNetworkServiceAssociationArrayInput interface { 217 pulumi.Input 218 219 ToServiceNetworkServiceAssociationArrayOutput() ServiceNetworkServiceAssociationArrayOutput 220 ToServiceNetworkServiceAssociationArrayOutputWithContext(context.Context) ServiceNetworkServiceAssociationArrayOutput 221 } 222 223 type ServiceNetworkServiceAssociationArray []ServiceNetworkServiceAssociationInput 224 225 func (ServiceNetworkServiceAssociationArray) ElementType() reflect.Type { 226 return reflect.TypeOf((*[]*ServiceNetworkServiceAssociation)(nil)).Elem() 227 } 228 229 func (i ServiceNetworkServiceAssociationArray) ToServiceNetworkServiceAssociationArrayOutput() ServiceNetworkServiceAssociationArrayOutput { 230 return i.ToServiceNetworkServiceAssociationArrayOutputWithContext(context.Background()) 231 } 232 233 func (i ServiceNetworkServiceAssociationArray) ToServiceNetworkServiceAssociationArrayOutputWithContext(ctx context.Context) ServiceNetworkServiceAssociationArrayOutput { 234 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkServiceAssociationArrayOutput) 235 } 236 237 // ServiceNetworkServiceAssociationMapInput is an input type that accepts ServiceNetworkServiceAssociationMap and ServiceNetworkServiceAssociationMapOutput values. 238 // You can construct a concrete instance of `ServiceNetworkServiceAssociationMapInput` via: 239 // 240 // ServiceNetworkServiceAssociationMap{ "key": ServiceNetworkServiceAssociationArgs{...} } 241 type ServiceNetworkServiceAssociationMapInput interface { 242 pulumi.Input 243 244 ToServiceNetworkServiceAssociationMapOutput() ServiceNetworkServiceAssociationMapOutput 245 ToServiceNetworkServiceAssociationMapOutputWithContext(context.Context) ServiceNetworkServiceAssociationMapOutput 246 } 247 248 type ServiceNetworkServiceAssociationMap map[string]ServiceNetworkServiceAssociationInput 249 250 func (ServiceNetworkServiceAssociationMap) ElementType() reflect.Type { 251 return reflect.TypeOf((*map[string]*ServiceNetworkServiceAssociation)(nil)).Elem() 252 } 253 254 func (i ServiceNetworkServiceAssociationMap) ToServiceNetworkServiceAssociationMapOutput() ServiceNetworkServiceAssociationMapOutput { 255 return i.ToServiceNetworkServiceAssociationMapOutputWithContext(context.Background()) 256 } 257 258 func (i ServiceNetworkServiceAssociationMap) ToServiceNetworkServiceAssociationMapOutputWithContext(ctx context.Context) ServiceNetworkServiceAssociationMapOutput { 259 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkServiceAssociationMapOutput) 260 } 261 262 type ServiceNetworkServiceAssociationOutput struct{ *pulumi.OutputState } 263 264 func (ServiceNetworkServiceAssociationOutput) ElementType() reflect.Type { 265 return reflect.TypeOf((**ServiceNetworkServiceAssociation)(nil)).Elem() 266 } 267 268 func (o ServiceNetworkServiceAssociationOutput) ToServiceNetworkServiceAssociationOutput() ServiceNetworkServiceAssociationOutput { 269 return o 270 } 271 272 func (o ServiceNetworkServiceAssociationOutput) ToServiceNetworkServiceAssociationOutputWithContext(ctx context.Context) ServiceNetworkServiceAssociationOutput { 273 return o 274 } 275 276 // The ARN of the Association. 277 func (o ServiceNetworkServiceAssociationOutput) Arn() pulumi.StringOutput { 278 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 279 } 280 281 // The account that created the association. 282 func (o ServiceNetworkServiceAssociationOutput) CreatedBy() pulumi.StringOutput { 283 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringOutput { return v.CreatedBy }).(pulumi.StringOutput) 284 } 285 286 // The custom domain name of the service. 287 func (o ServiceNetworkServiceAssociationOutput) CustomDomainName() pulumi.StringOutput { 288 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringOutput { return v.CustomDomainName }).(pulumi.StringOutput) 289 } 290 291 // The DNS name of the service. 292 func (o ServiceNetworkServiceAssociationOutput) DnsEntries() ServiceNetworkServiceAssociationDnsEntryArrayOutput { 293 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) ServiceNetworkServiceAssociationDnsEntryArrayOutput { 294 return v.DnsEntries 295 }).(ServiceNetworkServiceAssociationDnsEntryArrayOutput) 296 } 297 298 // The ID or Amazon Resource Identifier (ARN) of the service. 299 func (o ServiceNetworkServiceAssociationOutput) ServiceIdentifier() pulumi.StringOutput { 300 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringOutput { return v.ServiceIdentifier }).(pulumi.StringOutput) 301 } 302 303 // The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. 304 // The following arguments are optional: 305 func (o ServiceNetworkServiceAssociationOutput) ServiceNetworkIdentifier() pulumi.StringOutput { 306 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringOutput { return v.ServiceNetworkIdentifier }).(pulumi.StringOutput) 307 } 308 309 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 310 func (o ServiceNetworkServiceAssociationOutput) Status() pulumi.StringOutput { 311 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 312 } 313 314 // 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. 315 func (o ServiceNetworkServiceAssociationOutput) Tags() pulumi.StringMapOutput { 316 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 317 } 318 319 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 320 // 321 // Deprecated: Please use `tags` instead. 322 func (o ServiceNetworkServiceAssociationOutput) TagsAll() pulumi.StringMapOutput { 323 return o.ApplyT(func(v *ServiceNetworkServiceAssociation) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 324 } 325 326 type ServiceNetworkServiceAssociationArrayOutput struct{ *pulumi.OutputState } 327 328 func (ServiceNetworkServiceAssociationArrayOutput) ElementType() reflect.Type { 329 return reflect.TypeOf((*[]*ServiceNetworkServiceAssociation)(nil)).Elem() 330 } 331 332 func (o ServiceNetworkServiceAssociationArrayOutput) ToServiceNetworkServiceAssociationArrayOutput() ServiceNetworkServiceAssociationArrayOutput { 333 return o 334 } 335 336 func (o ServiceNetworkServiceAssociationArrayOutput) ToServiceNetworkServiceAssociationArrayOutputWithContext(ctx context.Context) ServiceNetworkServiceAssociationArrayOutput { 337 return o 338 } 339 340 func (o ServiceNetworkServiceAssociationArrayOutput) Index(i pulumi.IntInput) ServiceNetworkServiceAssociationOutput { 341 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceNetworkServiceAssociation { 342 return vs[0].([]*ServiceNetworkServiceAssociation)[vs[1].(int)] 343 }).(ServiceNetworkServiceAssociationOutput) 344 } 345 346 type ServiceNetworkServiceAssociationMapOutput struct{ *pulumi.OutputState } 347 348 func (ServiceNetworkServiceAssociationMapOutput) ElementType() reflect.Type { 349 return reflect.TypeOf((*map[string]*ServiceNetworkServiceAssociation)(nil)).Elem() 350 } 351 352 func (o ServiceNetworkServiceAssociationMapOutput) ToServiceNetworkServiceAssociationMapOutput() ServiceNetworkServiceAssociationMapOutput { 353 return o 354 } 355 356 func (o ServiceNetworkServiceAssociationMapOutput) ToServiceNetworkServiceAssociationMapOutputWithContext(ctx context.Context) ServiceNetworkServiceAssociationMapOutput { 357 return o 358 } 359 360 func (o ServiceNetworkServiceAssociationMapOutput) MapIndex(k pulumi.StringInput) ServiceNetworkServiceAssociationOutput { 361 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceNetworkServiceAssociation { 362 return vs[0].(map[string]*ServiceNetworkServiceAssociation)[vs[1].(string)] 363 }).(ServiceNetworkServiceAssociationOutput) 364 } 365 366 func init() { 367 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkServiceAssociationInput)(nil)).Elem(), &ServiceNetworkServiceAssociation{}) 368 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkServiceAssociationArrayInput)(nil)).Elem(), ServiceNetworkServiceAssociationArray{}) 369 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkServiceAssociationMapInput)(nil)).Elem(), ServiceNetworkServiceAssociationMap{}) 370 pulumi.RegisterOutputType(ServiceNetworkServiceAssociationOutput{}) 371 pulumi.RegisterOutputType(ServiceNetworkServiceAssociationArrayOutput{}) 372 pulumi.RegisterOutputType(ServiceNetworkServiceAssociationMapOutput{}) 373 }