Skip to content

Commit

Permalink
r/aws_ec2_transit_gateway_vpc_attachment: Use '_Values()' for enums (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Jul 25, 2022
1 parent aa554ef commit ca77b21
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions internal/service/ec2/transitgateway_vpc_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func ResourceTransitGatewayVPCAttachment() *schema.Resource {
Read: resourceTransitGatewayVPCAttachmentRead,
Update: resourceTransitGatewayVPCAttachmentUpdate,
Delete: resourceTransitGatewayVPCAttachmentDelete,

Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Expand All @@ -35,22 +36,16 @@ func ResourceTransitGatewayVPCAttachment() *schema.Resource {
ValidateFunc: validation.StringInSlice(ec2.ApplianceModeSupportValue_Values(), false),
},
"dns_support": {
Type: schema.TypeString,
Optional: true,
Default: ec2.DnsSupportValueEnable,
ValidateFunc: validation.StringInSlice([]string{
ec2.DnsSupportValueDisable,
ec2.DnsSupportValueEnable,
}, false),
Type: schema.TypeString,
Optional: true,
Default: ec2.DnsSupportValueEnable,
ValidateFunc: validation.StringInSlice(ec2.DnsSupportValue_Values(), false),
},
"ipv6_support": {
Type: schema.TypeString,
Optional: true,
Default: ec2.Ipv6SupportValueDisable,
ValidateFunc: validation.StringInSlice([]string{
ec2.Ipv6SupportValueDisable,
ec2.Ipv6SupportValueEnable,
}, false),
Type: schema.TypeString,
Optional: true,
Default: ec2.Ipv6SupportValueDisable,
ValidateFunc: validation.StringInSlice(ec2.Ipv6SupportValue_Values(), false),
},
"subnet_ids": {
Type: schema.TypeSet,
Expand Down Expand Up @@ -96,7 +91,6 @@ func resourceTransitGatewayVPCAttachmentCreate(d *schema.ResourceData, meta inte
tags := defaultTagsConfig.MergeTags(tftags.New(d.Get("tags").(map[string]interface{})))

transitGatewayID := d.Get("transit_gateway_id").(string)

input := &ec2.CreateTransitGatewayVpcAttachmentInput{
Options: &ec2.CreateTransitGatewayVpcAttachmentRequestOptions{
ApplianceModeSupport: aws.String(d.Get("appliance_mode_support").(string)),
Expand Down

0 comments on commit ca77b21

Please sign in to comment.