github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/vpcConnection.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 quicksight 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 QuickSight VPC Connection. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "encoding/json" 28 // 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 30 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight" 31 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 32 // 33 // ) 34 // 35 // func main() { 36 // pulumi.Run(func(ctx *pulumi.Context) error { 37 // tmpJSON0, err := json.Marshal(map[string]interface{}{ 38 // "Version": "2012-10-17", 39 // "Statement": []map[string]interface{}{ 40 // map[string]interface{}{ 41 // "Effect": "Allow", 42 // "Action": "sts:AssumeRole", 43 // "Principal": map[string]interface{}{ 44 // "Service": "quicksight.amazonaws.com", 45 // }, 46 // }, 47 // }, 48 // }) 49 // if err != nil { 50 // return err 51 // } 52 // json0 := string(tmpJSON0) 53 // tmpJSON1, err := json.Marshal(map[string]interface{}{ 54 // "Version": "2012-10-17", 55 // "Statement": []map[string]interface{}{ 56 // map[string]interface{}{ 57 // "Effect": "Allow", 58 // "Action": []string{ 59 // "ec2:CreateNetworkInterface", 60 // "ec2:ModifyNetworkInterfaceAttribute", 61 // "ec2:DeleteNetworkInterface", 62 // "ec2:DescribeSubnets", 63 // "ec2:DescribeSecurityGroups", 64 // }, 65 // "Resource": []string{ 66 // "*", 67 // }, 68 // }, 69 // }, 70 // }) 71 // if err != nil { 72 // return err 73 // } 74 // json1 := string(tmpJSON1) 75 // vpcConnectionRole, err := iam.NewRole(ctx, "vpc_connection_role", &iam.RoleArgs{ 76 // AssumeRolePolicy: pulumi.String(json0), 77 // InlinePolicies: iam.RoleInlinePolicyArray{ 78 // &iam.RoleInlinePolicyArgs{ 79 // Name: pulumi.String("QuickSightVPCConnectionRolePolicy"), 80 // Policy: pulumi.String(json1), 81 // }, 82 // }, 83 // }) 84 // if err != nil { 85 // return err 86 // } 87 // _, err = quicksight.NewVpcConnection(ctx, "example", &quicksight.VpcConnectionArgs{ 88 // VpcConnectionId: pulumi.String("example-connection-id"), 89 // Name: pulumi.String("Example Connection"), 90 // RoleArn: vpcConnectionRole.Arn, 91 // SecurityGroupIds: pulumi.StringArray{ 92 // pulumi.String("sg-00000000000000000"), 93 // }, 94 // SubnetIds: pulumi.StringArray{ 95 // pulumi.String("subnet-00000000000000000"), 96 // pulumi.String("subnet-00000000000000001"), 97 // }, 98 // }) 99 // if err != nil { 100 // return err 101 // } 102 // return nil 103 // }) 104 // } 105 // 106 // ``` 107 // <!--End PulumiCodeChooser --> 108 // 109 // ## Import 110 // 111 // Using `pulumi import`, import QuickSight VPC connection using the AWS account ID and VPC connection ID separated by commas (`,`). For example: 112 // 113 // ```sh 114 // $ pulumi import aws:quicksight/vpcConnection:VpcConnection example 123456789012,example 115 // ``` 116 type VpcConnection struct { 117 pulumi.CustomResourceState 118 119 // ARN of the VPC connection. 120 Arn pulumi.StringOutput `pulumi:"arn"` 121 // The availability status of the VPC connection. Valid values are `AVAILABLE`, `UNAVAILABLE` or `PARTIALLY_AVAILABLE`. 122 AvailabilityStatus pulumi.StringOutput `pulumi:"availabilityStatus"` 123 // AWS account ID. 124 AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"` 125 // A list of IP addresses of DNS resolver endpoints for the VPC connection. 126 DnsResolvers pulumi.StringArrayOutput `pulumi:"dnsResolvers"` 127 // The display name for the VPC connection. 128 Name pulumi.StringOutput `pulumi:"name"` 129 // The IAM role to associate with the VPC connection. 130 RoleArn pulumi.StringOutput `pulumi:"roleArn"` 131 // A list of security group IDs for the VPC connection. 132 SecurityGroupIds pulumi.StringArrayOutput `pulumi:"securityGroupIds"` 133 // A list of subnet IDs for the VPC connection. 134 // 135 // The following arguments are optional: 136 SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"` 137 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 138 Tags pulumi.StringMapOutput `pulumi:"tags"` 139 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 140 // 141 // Deprecated: Please use `tags` instead. 142 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 143 Timeouts VpcConnectionTimeoutsPtrOutput `pulumi:"timeouts"` 144 // The ID of the VPC connection. 145 VpcConnectionId pulumi.StringOutput `pulumi:"vpcConnectionId"` 146 } 147 148 // NewVpcConnection registers a new resource with the given unique name, arguments, and options. 149 func NewVpcConnection(ctx *pulumi.Context, 150 name string, args *VpcConnectionArgs, opts ...pulumi.ResourceOption) (*VpcConnection, error) { 151 if args == nil { 152 return nil, errors.New("missing one or more required arguments") 153 } 154 155 if args.RoleArn == nil { 156 return nil, errors.New("invalid value for required argument 'RoleArn'") 157 } 158 if args.SecurityGroupIds == nil { 159 return nil, errors.New("invalid value for required argument 'SecurityGroupIds'") 160 } 161 if args.SubnetIds == nil { 162 return nil, errors.New("invalid value for required argument 'SubnetIds'") 163 } 164 if args.VpcConnectionId == nil { 165 return nil, errors.New("invalid value for required argument 'VpcConnectionId'") 166 } 167 opts = internal.PkgResourceDefaultOpts(opts) 168 var resource VpcConnection 169 err := ctx.RegisterResource("aws:quicksight/vpcConnection:VpcConnection", name, args, &resource, opts...) 170 if err != nil { 171 return nil, err 172 } 173 return &resource, nil 174 } 175 176 // GetVpcConnection gets an existing VpcConnection resource's state with the given name, ID, and optional 177 // state properties that are used to uniquely qualify the lookup (nil if not required). 178 func GetVpcConnection(ctx *pulumi.Context, 179 name string, id pulumi.IDInput, state *VpcConnectionState, opts ...pulumi.ResourceOption) (*VpcConnection, error) { 180 var resource VpcConnection 181 err := ctx.ReadResource("aws:quicksight/vpcConnection:VpcConnection", name, id, state, &resource, opts...) 182 if err != nil { 183 return nil, err 184 } 185 return &resource, nil 186 } 187 188 // Input properties used for looking up and filtering VpcConnection resources. 189 type vpcConnectionState struct { 190 // ARN of the VPC connection. 191 Arn *string `pulumi:"arn"` 192 // The availability status of the VPC connection. Valid values are `AVAILABLE`, `UNAVAILABLE` or `PARTIALLY_AVAILABLE`. 193 AvailabilityStatus *string `pulumi:"availabilityStatus"` 194 // AWS account ID. 195 AwsAccountId *string `pulumi:"awsAccountId"` 196 // A list of IP addresses of DNS resolver endpoints for the VPC connection. 197 DnsResolvers []string `pulumi:"dnsResolvers"` 198 // The display name for the VPC connection. 199 Name *string `pulumi:"name"` 200 // The IAM role to associate with the VPC connection. 201 RoleArn *string `pulumi:"roleArn"` 202 // A list of security group IDs for the VPC connection. 203 SecurityGroupIds []string `pulumi:"securityGroupIds"` 204 // A list of subnet IDs for the VPC connection. 205 // 206 // The following arguments are optional: 207 SubnetIds []string `pulumi:"subnetIds"` 208 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 209 Tags map[string]string `pulumi:"tags"` 210 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 211 // 212 // Deprecated: Please use `tags` instead. 213 TagsAll map[string]string `pulumi:"tagsAll"` 214 Timeouts *VpcConnectionTimeouts `pulumi:"timeouts"` 215 // The ID of the VPC connection. 216 VpcConnectionId *string `pulumi:"vpcConnectionId"` 217 } 218 219 type VpcConnectionState struct { 220 // ARN of the VPC connection. 221 Arn pulumi.StringPtrInput 222 // The availability status of the VPC connection. Valid values are `AVAILABLE`, `UNAVAILABLE` or `PARTIALLY_AVAILABLE`. 223 AvailabilityStatus pulumi.StringPtrInput 224 // AWS account ID. 225 AwsAccountId pulumi.StringPtrInput 226 // A list of IP addresses of DNS resolver endpoints for the VPC connection. 227 DnsResolvers pulumi.StringArrayInput 228 // The display name for the VPC connection. 229 Name pulumi.StringPtrInput 230 // The IAM role to associate with the VPC connection. 231 RoleArn pulumi.StringPtrInput 232 // A list of security group IDs for the VPC connection. 233 SecurityGroupIds pulumi.StringArrayInput 234 // A list of subnet IDs for the VPC connection. 235 // 236 // The following arguments are optional: 237 SubnetIds pulumi.StringArrayInput 238 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 239 Tags pulumi.StringMapInput 240 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 241 // 242 // Deprecated: Please use `tags` instead. 243 TagsAll pulumi.StringMapInput 244 Timeouts VpcConnectionTimeoutsPtrInput 245 // The ID of the VPC connection. 246 VpcConnectionId pulumi.StringPtrInput 247 } 248 249 func (VpcConnectionState) ElementType() reflect.Type { 250 return reflect.TypeOf((*vpcConnectionState)(nil)).Elem() 251 } 252 253 type vpcConnectionArgs struct { 254 // AWS account ID. 255 AwsAccountId *string `pulumi:"awsAccountId"` 256 // A list of IP addresses of DNS resolver endpoints for the VPC connection. 257 DnsResolvers []string `pulumi:"dnsResolvers"` 258 // The display name for the VPC connection. 259 Name *string `pulumi:"name"` 260 // The IAM role to associate with the VPC connection. 261 RoleArn string `pulumi:"roleArn"` 262 // A list of security group IDs for the VPC connection. 263 SecurityGroupIds []string `pulumi:"securityGroupIds"` 264 // A list of subnet IDs for the VPC connection. 265 // 266 // The following arguments are optional: 267 SubnetIds []string `pulumi:"subnetIds"` 268 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 269 Tags map[string]string `pulumi:"tags"` 270 Timeouts *VpcConnectionTimeouts `pulumi:"timeouts"` 271 // The ID of the VPC connection. 272 VpcConnectionId string `pulumi:"vpcConnectionId"` 273 } 274 275 // The set of arguments for constructing a VpcConnection resource. 276 type VpcConnectionArgs struct { 277 // AWS account ID. 278 AwsAccountId pulumi.StringPtrInput 279 // A list of IP addresses of DNS resolver endpoints for the VPC connection. 280 DnsResolvers pulumi.StringArrayInput 281 // The display name for the VPC connection. 282 Name pulumi.StringPtrInput 283 // The IAM role to associate with the VPC connection. 284 RoleArn pulumi.StringInput 285 // A list of security group IDs for the VPC connection. 286 SecurityGroupIds pulumi.StringArrayInput 287 // A list of subnet IDs for the VPC connection. 288 // 289 // The following arguments are optional: 290 SubnetIds pulumi.StringArrayInput 291 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 292 Tags pulumi.StringMapInput 293 Timeouts VpcConnectionTimeoutsPtrInput 294 // The ID of the VPC connection. 295 VpcConnectionId pulumi.StringInput 296 } 297 298 func (VpcConnectionArgs) ElementType() reflect.Type { 299 return reflect.TypeOf((*vpcConnectionArgs)(nil)).Elem() 300 } 301 302 type VpcConnectionInput interface { 303 pulumi.Input 304 305 ToVpcConnectionOutput() VpcConnectionOutput 306 ToVpcConnectionOutputWithContext(ctx context.Context) VpcConnectionOutput 307 } 308 309 func (*VpcConnection) ElementType() reflect.Type { 310 return reflect.TypeOf((**VpcConnection)(nil)).Elem() 311 } 312 313 func (i *VpcConnection) ToVpcConnectionOutput() VpcConnectionOutput { 314 return i.ToVpcConnectionOutputWithContext(context.Background()) 315 } 316 317 func (i *VpcConnection) ToVpcConnectionOutputWithContext(ctx context.Context) VpcConnectionOutput { 318 return pulumi.ToOutputWithContext(ctx, i).(VpcConnectionOutput) 319 } 320 321 // VpcConnectionArrayInput is an input type that accepts VpcConnectionArray and VpcConnectionArrayOutput values. 322 // You can construct a concrete instance of `VpcConnectionArrayInput` via: 323 // 324 // VpcConnectionArray{ VpcConnectionArgs{...} } 325 type VpcConnectionArrayInput interface { 326 pulumi.Input 327 328 ToVpcConnectionArrayOutput() VpcConnectionArrayOutput 329 ToVpcConnectionArrayOutputWithContext(context.Context) VpcConnectionArrayOutput 330 } 331 332 type VpcConnectionArray []VpcConnectionInput 333 334 func (VpcConnectionArray) ElementType() reflect.Type { 335 return reflect.TypeOf((*[]*VpcConnection)(nil)).Elem() 336 } 337 338 func (i VpcConnectionArray) ToVpcConnectionArrayOutput() VpcConnectionArrayOutput { 339 return i.ToVpcConnectionArrayOutputWithContext(context.Background()) 340 } 341 342 func (i VpcConnectionArray) ToVpcConnectionArrayOutputWithContext(ctx context.Context) VpcConnectionArrayOutput { 343 return pulumi.ToOutputWithContext(ctx, i).(VpcConnectionArrayOutput) 344 } 345 346 // VpcConnectionMapInput is an input type that accepts VpcConnectionMap and VpcConnectionMapOutput values. 347 // You can construct a concrete instance of `VpcConnectionMapInput` via: 348 // 349 // VpcConnectionMap{ "key": VpcConnectionArgs{...} } 350 type VpcConnectionMapInput interface { 351 pulumi.Input 352 353 ToVpcConnectionMapOutput() VpcConnectionMapOutput 354 ToVpcConnectionMapOutputWithContext(context.Context) VpcConnectionMapOutput 355 } 356 357 type VpcConnectionMap map[string]VpcConnectionInput 358 359 func (VpcConnectionMap) ElementType() reflect.Type { 360 return reflect.TypeOf((*map[string]*VpcConnection)(nil)).Elem() 361 } 362 363 func (i VpcConnectionMap) ToVpcConnectionMapOutput() VpcConnectionMapOutput { 364 return i.ToVpcConnectionMapOutputWithContext(context.Background()) 365 } 366 367 func (i VpcConnectionMap) ToVpcConnectionMapOutputWithContext(ctx context.Context) VpcConnectionMapOutput { 368 return pulumi.ToOutputWithContext(ctx, i).(VpcConnectionMapOutput) 369 } 370 371 type VpcConnectionOutput struct{ *pulumi.OutputState } 372 373 func (VpcConnectionOutput) ElementType() reflect.Type { 374 return reflect.TypeOf((**VpcConnection)(nil)).Elem() 375 } 376 377 func (o VpcConnectionOutput) ToVpcConnectionOutput() VpcConnectionOutput { 378 return o 379 } 380 381 func (o VpcConnectionOutput) ToVpcConnectionOutputWithContext(ctx context.Context) VpcConnectionOutput { 382 return o 383 } 384 385 // ARN of the VPC connection. 386 func (o VpcConnectionOutput) Arn() pulumi.StringOutput { 387 return o.ApplyT(func(v *VpcConnection) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 388 } 389 390 // The availability status of the VPC connection. Valid values are `AVAILABLE`, `UNAVAILABLE` or `PARTIALLY_AVAILABLE`. 391 func (o VpcConnectionOutput) AvailabilityStatus() pulumi.StringOutput { 392 return o.ApplyT(func(v *VpcConnection) pulumi.StringOutput { return v.AvailabilityStatus }).(pulumi.StringOutput) 393 } 394 395 // AWS account ID. 396 func (o VpcConnectionOutput) AwsAccountId() pulumi.StringOutput { 397 return o.ApplyT(func(v *VpcConnection) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput) 398 } 399 400 // A list of IP addresses of DNS resolver endpoints for the VPC connection. 401 func (o VpcConnectionOutput) DnsResolvers() pulumi.StringArrayOutput { 402 return o.ApplyT(func(v *VpcConnection) pulumi.StringArrayOutput { return v.DnsResolvers }).(pulumi.StringArrayOutput) 403 } 404 405 // The display name for the VPC connection. 406 func (o VpcConnectionOutput) Name() pulumi.StringOutput { 407 return o.ApplyT(func(v *VpcConnection) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 408 } 409 410 // The IAM role to associate with the VPC connection. 411 func (o VpcConnectionOutput) RoleArn() pulumi.StringOutput { 412 return o.ApplyT(func(v *VpcConnection) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput) 413 } 414 415 // A list of security group IDs for the VPC connection. 416 func (o VpcConnectionOutput) SecurityGroupIds() pulumi.StringArrayOutput { 417 return o.ApplyT(func(v *VpcConnection) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput) 418 } 419 420 // A list of subnet IDs for the VPC connection. 421 // 422 // The following arguments are optional: 423 func (o VpcConnectionOutput) SubnetIds() pulumi.StringArrayOutput { 424 return o.ApplyT(func(v *VpcConnection) pulumi.StringArrayOutput { return v.SubnetIds }).(pulumi.StringArrayOutput) 425 } 426 427 // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 428 func (o VpcConnectionOutput) Tags() pulumi.StringMapOutput { 429 return o.ApplyT(func(v *VpcConnection) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 430 } 431 432 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 433 // 434 // Deprecated: Please use `tags` instead. 435 func (o VpcConnectionOutput) TagsAll() pulumi.StringMapOutput { 436 return o.ApplyT(func(v *VpcConnection) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 437 } 438 439 func (o VpcConnectionOutput) Timeouts() VpcConnectionTimeoutsPtrOutput { 440 return o.ApplyT(func(v *VpcConnection) VpcConnectionTimeoutsPtrOutput { return v.Timeouts }).(VpcConnectionTimeoutsPtrOutput) 441 } 442 443 // The ID of the VPC connection. 444 func (o VpcConnectionOutput) VpcConnectionId() pulumi.StringOutput { 445 return o.ApplyT(func(v *VpcConnection) pulumi.StringOutput { return v.VpcConnectionId }).(pulumi.StringOutput) 446 } 447 448 type VpcConnectionArrayOutput struct{ *pulumi.OutputState } 449 450 func (VpcConnectionArrayOutput) ElementType() reflect.Type { 451 return reflect.TypeOf((*[]*VpcConnection)(nil)).Elem() 452 } 453 454 func (o VpcConnectionArrayOutput) ToVpcConnectionArrayOutput() VpcConnectionArrayOutput { 455 return o 456 } 457 458 func (o VpcConnectionArrayOutput) ToVpcConnectionArrayOutputWithContext(ctx context.Context) VpcConnectionArrayOutput { 459 return o 460 } 461 462 func (o VpcConnectionArrayOutput) Index(i pulumi.IntInput) VpcConnectionOutput { 463 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VpcConnection { 464 return vs[0].([]*VpcConnection)[vs[1].(int)] 465 }).(VpcConnectionOutput) 466 } 467 468 type VpcConnectionMapOutput struct{ *pulumi.OutputState } 469 470 func (VpcConnectionMapOutput) ElementType() reflect.Type { 471 return reflect.TypeOf((*map[string]*VpcConnection)(nil)).Elem() 472 } 473 474 func (o VpcConnectionMapOutput) ToVpcConnectionMapOutput() VpcConnectionMapOutput { 475 return o 476 } 477 478 func (o VpcConnectionMapOutput) ToVpcConnectionMapOutputWithContext(ctx context.Context) VpcConnectionMapOutput { 479 return o 480 } 481 482 func (o VpcConnectionMapOutput) MapIndex(k pulumi.StringInput) VpcConnectionOutput { 483 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VpcConnection { 484 return vs[0].(map[string]*VpcConnection)[vs[1].(string)] 485 }).(VpcConnectionOutput) 486 } 487 488 func init() { 489 pulumi.RegisterInputType(reflect.TypeOf((*VpcConnectionInput)(nil)).Elem(), &VpcConnection{}) 490 pulumi.RegisterInputType(reflect.TypeOf((*VpcConnectionArrayInput)(nil)).Elem(), VpcConnectionArray{}) 491 pulumi.RegisterInputType(reflect.TypeOf((*VpcConnectionMapInput)(nil)).Elem(), VpcConnectionMap{}) 492 pulumi.RegisterOutputType(VpcConnectionOutput{}) 493 pulumi.RegisterOutputType(VpcConnectionArrayOutput{}) 494 pulumi.RegisterOutputType(VpcConnectionMapOutput{}) 495 }