github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpclattice/serviceNetworkVpcAssociation.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 VPC 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.NewServiceNetworkVpcAssociation(ctx, "example", &vpclattice.ServiceNetworkVpcAssociationArgs{ 35 // VpcIdentifier: pulumi.Any(exampleAwsVpc.Id), 36 // ServiceNetworkIdentifier: pulumi.Any(exampleAwsVpclatticeServiceNetwork.Id), 37 // SecurityGroupIds: pulumi.StringArray{ 38 // exampleAwsSecurityGroup.Id, 39 // }, 40 // }) 41 // if err != nil { 42 // return err 43 // } 44 // return nil 45 // }) 46 // } 47 // 48 // ``` 49 // <!--End PulumiCodeChooser --> 50 // 51 // ## Import 52 // 53 // Using `pulumi import`, import VPC Lattice Service Network VPC Association using the `id`. For example: 54 // 55 // ```sh 56 // $ pulumi import aws:vpclattice/serviceNetworkVpcAssociation:ServiceNetworkVpcAssociation example snsa-05e2474658a88f6ba 57 // ``` 58 type ServiceNetworkVpcAssociation struct { 59 pulumi.CustomResourceState 60 61 // The ARN of the Association. 62 Arn pulumi.StringOutput `pulumi:"arn"` 63 // The account that created the association. 64 CreatedBy pulumi.StringOutput `pulumi:"createdBy"` 65 // The IDs of the security groups. 66 SecurityGroupIds pulumi.StringArrayOutput `pulumi:"securityGroupIds"` 67 // 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. 68 // The following arguments are optional: 69 ServiceNetworkIdentifier pulumi.StringOutput `pulumi:"serviceNetworkIdentifier"` 70 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 71 Status pulumi.StringOutput `pulumi:"status"` 72 // 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. 73 Tags pulumi.StringMapOutput `pulumi:"tags"` 74 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 75 // 76 // Deprecated: Please use `tags` instead. 77 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 78 // The ID of the VPC. 79 VpcIdentifier pulumi.StringOutput `pulumi:"vpcIdentifier"` 80 } 81 82 // NewServiceNetworkVpcAssociation registers a new resource with the given unique name, arguments, and options. 83 func NewServiceNetworkVpcAssociation(ctx *pulumi.Context, 84 name string, args *ServiceNetworkVpcAssociationArgs, opts ...pulumi.ResourceOption) (*ServiceNetworkVpcAssociation, error) { 85 if args == nil { 86 return nil, errors.New("missing one or more required arguments") 87 } 88 89 if args.ServiceNetworkIdentifier == nil { 90 return nil, errors.New("invalid value for required argument 'ServiceNetworkIdentifier'") 91 } 92 if args.VpcIdentifier == nil { 93 return nil, errors.New("invalid value for required argument 'VpcIdentifier'") 94 } 95 opts = internal.PkgResourceDefaultOpts(opts) 96 var resource ServiceNetworkVpcAssociation 97 err := ctx.RegisterResource("aws:vpclattice/serviceNetworkVpcAssociation:ServiceNetworkVpcAssociation", name, args, &resource, opts...) 98 if err != nil { 99 return nil, err 100 } 101 return &resource, nil 102 } 103 104 // GetServiceNetworkVpcAssociation gets an existing ServiceNetworkVpcAssociation resource's state with the given name, ID, and optional 105 // state properties that are used to uniquely qualify the lookup (nil if not required). 106 func GetServiceNetworkVpcAssociation(ctx *pulumi.Context, 107 name string, id pulumi.IDInput, state *ServiceNetworkVpcAssociationState, opts ...pulumi.ResourceOption) (*ServiceNetworkVpcAssociation, error) { 108 var resource ServiceNetworkVpcAssociation 109 err := ctx.ReadResource("aws:vpclattice/serviceNetworkVpcAssociation:ServiceNetworkVpcAssociation", name, id, state, &resource, opts...) 110 if err != nil { 111 return nil, err 112 } 113 return &resource, nil 114 } 115 116 // Input properties used for looking up and filtering ServiceNetworkVpcAssociation resources. 117 type serviceNetworkVpcAssociationState struct { 118 // The ARN of the Association. 119 Arn *string `pulumi:"arn"` 120 // The account that created the association. 121 CreatedBy *string `pulumi:"createdBy"` 122 // The IDs of the security groups. 123 SecurityGroupIds []string `pulumi:"securityGroupIds"` 124 // 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. 125 // The following arguments are optional: 126 ServiceNetworkIdentifier *string `pulumi:"serviceNetworkIdentifier"` 127 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 128 Status *string `pulumi:"status"` 129 // 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. 130 Tags map[string]string `pulumi:"tags"` 131 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 132 // 133 // Deprecated: Please use `tags` instead. 134 TagsAll map[string]string `pulumi:"tagsAll"` 135 // The ID of the VPC. 136 VpcIdentifier *string `pulumi:"vpcIdentifier"` 137 } 138 139 type ServiceNetworkVpcAssociationState struct { 140 // The ARN of the Association. 141 Arn pulumi.StringPtrInput 142 // The account that created the association. 143 CreatedBy pulumi.StringPtrInput 144 // The IDs of the security groups. 145 SecurityGroupIds pulumi.StringArrayInput 146 // 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. 147 // The following arguments are optional: 148 ServiceNetworkIdentifier pulumi.StringPtrInput 149 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 150 Status pulumi.StringPtrInput 151 // 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. 152 Tags pulumi.StringMapInput 153 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 154 // 155 // Deprecated: Please use `tags` instead. 156 TagsAll pulumi.StringMapInput 157 // The ID of the VPC. 158 VpcIdentifier pulumi.StringPtrInput 159 } 160 161 func (ServiceNetworkVpcAssociationState) ElementType() reflect.Type { 162 return reflect.TypeOf((*serviceNetworkVpcAssociationState)(nil)).Elem() 163 } 164 165 type serviceNetworkVpcAssociationArgs struct { 166 // The IDs of the security groups. 167 SecurityGroupIds []string `pulumi:"securityGroupIds"` 168 // 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. 169 // The following arguments are optional: 170 ServiceNetworkIdentifier string `pulumi:"serviceNetworkIdentifier"` 171 // 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. 172 Tags map[string]string `pulumi:"tags"` 173 // The ID of the VPC. 174 VpcIdentifier string `pulumi:"vpcIdentifier"` 175 } 176 177 // The set of arguments for constructing a ServiceNetworkVpcAssociation resource. 178 type ServiceNetworkVpcAssociationArgs struct { 179 // The IDs of the security groups. 180 SecurityGroupIds pulumi.StringArrayInput 181 // 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. 182 // The following arguments are optional: 183 ServiceNetworkIdentifier pulumi.StringInput 184 // 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. 185 Tags pulumi.StringMapInput 186 // The ID of the VPC. 187 VpcIdentifier pulumi.StringInput 188 } 189 190 func (ServiceNetworkVpcAssociationArgs) ElementType() reflect.Type { 191 return reflect.TypeOf((*serviceNetworkVpcAssociationArgs)(nil)).Elem() 192 } 193 194 type ServiceNetworkVpcAssociationInput interface { 195 pulumi.Input 196 197 ToServiceNetworkVpcAssociationOutput() ServiceNetworkVpcAssociationOutput 198 ToServiceNetworkVpcAssociationOutputWithContext(ctx context.Context) ServiceNetworkVpcAssociationOutput 199 } 200 201 func (*ServiceNetworkVpcAssociation) ElementType() reflect.Type { 202 return reflect.TypeOf((**ServiceNetworkVpcAssociation)(nil)).Elem() 203 } 204 205 func (i *ServiceNetworkVpcAssociation) ToServiceNetworkVpcAssociationOutput() ServiceNetworkVpcAssociationOutput { 206 return i.ToServiceNetworkVpcAssociationOutputWithContext(context.Background()) 207 } 208 209 func (i *ServiceNetworkVpcAssociation) ToServiceNetworkVpcAssociationOutputWithContext(ctx context.Context) ServiceNetworkVpcAssociationOutput { 210 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkVpcAssociationOutput) 211 } 212 213 // ServiceNetworkVpcAssociationArrayInput is an input type that accepts ServiceNetworkVpcAssociationArray and ServiceNetworkVpcAssociationArrayOutput values. 214 // You can construct a concrete instance of `ServiceNetworkVpcAssociationArrayInput` via: 215 // 216 // ServiceNetworkVpcAssociationArray{ ServiceNetworkVpcAssociationArgs{...} } 217 type ServiceNetworkVpcAssociationArrayInput interface { 218 pulumi.Input 219 220 ToServiceNetworkVpcAssociationArrayOutput() ServiceNetworkVpcAssociationArrayOutput 221 ToServiceNetworkVpcAssociationArrayOutputWithContext(context.Context) ServiceNetworkVpcAssociationArrayOutput 222 } 223 224 type ServiceNetworkVpcAssociationArray []ServiceNetworkVpcAssociationInput 225 226 func (ServiceNetworkVpcAssociationArray) ElementType() reflect.Type { 227 return reflect.TypeOf((*[]*ServiceNetworkVpcAssociation)(nil)).Elem() 228 } 229 230 func (i ServiceNetworkVpcAssociationArray) ToServiceNetworkVpcAssociationArrayOutput() ServiceNetworkVpcAssociationArrayOutput { 231 return i.ToServiceNetworkVpcAssociationArrayOutputWithContext(context.Background()) 232 } 233 234 func (i ServiceNetworkVpcAssociationArray) ToServiceNetworkVpcAssociationArrayOutputWithContext(ctx context.Context) ServiceNetworkVpcAssociationArrayOutput { 235 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkVpcAssociationArrayOutput) 236 } 237 238 // ServiceNetworkVpcAssociationMapInput is an input type that accepts ServiceNetworkVpcAssociationMap and ServiceNetworkVpcAssociationMapOutput values. 239 // You can construct a concrete instance of `ServiceNetworkVpcAssociationMapInput` via: 240 // 241 // ServiceNetworkVpcAssociationMap{ "key": ServiceNetworkVpcAssociationArgs{...} } 242 type ServiceNetworkVpcAssociationMapInput interface { 243 pulumi.Input 244 245 ToServiceNetworkVpcAssociationMapOutput() ServiceNetworkVpcAssociationMapOutput 246 ToServiceNetworkVpcAssociationMapOutputWithContext(context.Context) ServiceNetworkVpcAssociationMapOutput 247 } 248 249 type ServiceNetworkVpcAssociationMap map[string]ServiceNetworkVpcAssociationInput 250 251 func (ServiceNetworkVpcAssociationMap) ElementType() reflect.Type { 252 return reflect.TypeOf((*map[string]*ServiceNetworkVpcAssociation)(nil)).Elem() 253 } 254 255 func (i ServiceNetworkVpcAssociationMap) ToServiceNetworkVpcAssociationMapOutput() ServiceNetworkVpcAssociationMapOutput { 256 return i.ToServiceNetworkVpcAssociationMapOutputWithContext(context.Background()) 257 } 258 259 func (i ServiceNetworkVpcAssociationMap) ToServiceNetworkVpcAssociationMapOutputWithContext(ctx context.Context) ServiceNetworkVpcAssociationMapOutput { 260 return pulumi.ToOutputWithContext(ctx, i).(ServiceNetworkVpcAssociationMapOutput) 261 } 262 263 type ServiceNetworkVpcAssociationOutput struct{ *pulumi.OutputState } 264 265 func (ServiceNetworkVpcAssociationOutput) ElementType() reflect.Type { 266 return reflect.TypeOf((**ServiceNetworkVpcAssociation)(nil)).Elem() 267 } 268 269 func (o ServiceNetworkVpcAssociationOutput) ToServiceNetworkVpcAssociationOutput() ServiceNetworkVpcAssociationOutput { 270 return o 271 } 272 273 func (o ServiceNetworkVpcAssociationOutput) ToServiceNetworkVpcAssociationOutputWithContext(ctx context.Context) ServiceNetworkVpcAssociationOutput { 274 return o 275 } 276 277 // The ARN of the Association. 278 func (o ServiceNetworkVpcAssociationOutput) Arn() pulumi.StringOutput { 279 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 280 } 281 282 // The account that created the association. 283 func (o ServiceNetworkVpcAssociationOutput) CreatedBy() pulumi.StringOutput { 284 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringOutput { return v.CreatedBy }).(pulumi.StringOutput) 285 } 286 287 // The IDs of the security groups. 288 func (o ServiceNetworkVpcAssociationOutput) SecurityGroupIds() pulumi.StringArrayOutput { 289 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput) 290 } 291 292 // 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. 293 // The following arguments are optional: 294 func (o ServiceNetworkVpcAssociationOutput) ServiceNetworkIdentifier() pulumi.StringOutput { 295 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringOutput { return v.ServiceNetworkIdentifier }).(pulumi.StringOutput) 296 } 297 298 // The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED 299 func (o ServiceNetworkVpcAssociationOutput) Status() pulumi.StringOutput { 300 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 301 } 302 303 // 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. 304 func (o ServiceNetworkVpcAssociationOutput) Tags() pulumi.StringMapOutput { 305 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 306 } 307 308 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 309 // 310 // Deprecated: Please use `tags` instead. 311 func (o ServiceNetworkVpcAssociationOutput) TagsAll() pulumi.StringMapOutput { 312 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 313 } 314 315 // The ID of the VPC. 316 func (o ServiceNetworkVpcAssociationOutput) VpcIdentifier() pulumi.StringOutput { 317 return o.ApplyT(func(v *ServiceNetworkVpcAssociation) pulumi.StringOutput { return v.VpcIdentifier }).(pulumi.StringOutput) 318 } 319 320 type ServiceNetworkVpcAssociationArrayOutput struct{ *pulumi.OutputState } 321 322 func (ServiceNetworkVpcAssociationArrayOutput) ElementType() reflect.Type { 323 return reflect.TypeOf((*[]*ServiceNetworkVpcAssociation)(nil)).Elem() 324 } 325 326 func (o ServiceNetworkVpcAssociationArrayOutput) ToServiceNetworkVpcAssociationArrayOutput() ServiceNetworkVpcAssociationArrayOutput { 327 return o 328 } 329 330 func (o ServiceNetworkVpcAssociationArrayOutput) ToServiceNetworkVpcAssociationArrayOutputWithContext(ctx context.Context) ServiceNetworkVpcAssociationArrayOutput { 331 return o 332 } 333 334 func (o ServiceNetworkVpcAssociationArrayOutput) Index(i pulumi.IntInput) ServiceNetworkVpcAssociationOutput { 335 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceNetworkVpcAssociation { 336 return vs[0].([]*ServiceNetworkVpcAssociation)[vs[1].(int)] 337 }).(ServiceNetworkVpcAssociationOutput) 338 } 339 340 type ServiceNetworkVpcAssociationMapOutput struct{ *pulumi.OutputState } 341 342 func (ServiceNetworkVpcAssociationMapOutput) ElementType() reflect.Type { 343 return reflect.TypeOf((*map[string]*ServiceNetworkVpcAssociation)(nil)).Elem() 344 } 345 346 func (o ServiceNetworkVpcAssociationMapOutput) ToServiceNetworkVpcAssociationMapOutput() ServiceNetworkVpcAssociationMapOutput { 347 return o 348 } 349 350 func (o ServiceNetworkVpcAssociationMapOutput) ToServiceNetworkVpcAssociationMapOutputWithContext(ctx context.Context) ServiceNetworkVpcAssociationMapOutput { 351 return o 352 } 353 354 func (o ServiceNetworkVpcAssociationMapOutput) MapIndex(k pulumi.StringInput) ServiceNetworkVpcAssociationOutput { 355 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceNetworkVpcAssociation { 356 return vs[0].(map[string]*ServiceNetworkVpcAssociation)[vs[1].(string)] 357 }).(ServiceNetworkVpcAssociationOutput) 358 } 359 360 func init() { 361 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkVpcAssociationInput)(nil)).Elem(), &ServiceNetworkVpcAssociation{}) 362 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkVpcAssociationArrayInput)(nil)).Elem(), ServiceNetworkVpcAssociationArray{}) 363 pulumi.RegisterInputType(reflect.TypeOf((*ServiceNetworkVpcAssociationMapInput)(nil)).Elem(), ServiceNetworkVpcAssociationMap{}) 364 pulumi.RegisterOutputType(ServiceNetworkVpcAssociationOutput{}) 365 pulumi.RegisterOutputType(ServiceNetworkVpcAssociationArrayOutput{}) 366 pulumi.RegisterOutputType(ServiceNetworkVpcAssociationMapOutput{}) 367 }