diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 81bd1322abb..55be5589059 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -411,8 +411,6 @@ func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsAmiUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*AWSClient).ec2conn - d.Partial(true) - if d.HasChange("tags") { o, n := d.GetChange("tags") @@ -431,11 +429,8 @@ func resourceAwsAmiUpdate(d *schema.ResourceData, meta interface{}) error { if err != nil { return err } - d.SetPartial("description") } - d.Partial(false) - return resourceAwsAmiRead(d, meta) } diff --git a/aws/resource_aws_ami_copy.go b/aws/resource_aws_ami_copy.go index 238bbfe1d91..f20148aec4b 100644 --- a/aws/resource_aws_ami_copy.go +++ b/aws/resource_aws_ami_copy.go @@ -215,10 +215,7 @@ func resourceAwsAmiCopyCreate(d *schema.ResourceData, meta interface{}) error { id := *res.ImageId d.SetId(id) - d.Partial(true) // make sure we record the id even if the rest of this gets interrupted d.Set("manage_ebs_snapshots", true) - d.SetPartial("manage_ebs_snapshots") - d.Partial(false) if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { if err := keyvaluetags.Ec2UpdateTags(client, id, nil, v); err != nil { diff --git a/aws/resource_aws_ami_from_instance.go b/aws/resource_aws_ami_from_instance.go index fd9d4013426..00b008ba65e 100644 --- a/aws/resource_aws_ami_from_instance.go +++ b/aws/resource_aws_ami_from_instance.go @@ -197,10 +197,7 @@ func resourceAwsAmiFromInstanceCreate(d *schema.ResourceData, meta interface{}) id := *res.ImageId d.SetId(id) - d.Partial(true) // make sure we record the id even if the rest of this gets interrupted d.Set("manage_ebs_snapshots", true) - d.SetPartial("manage_ebs_snapshots") - d.Partial(false) if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { if err := keyvaluetags.Ec2UpdateTags(client, id, nil, v); err != nil { diff --git a/aws/resource_aws_default_network_acl.go b/aws/resource_aws_default_network_acl.go index 80b5c86b41b..b7c376f2417 100644 --- a/aws/resource_aws_default_network_acl.go +++ b/aws/resource_aws_default_network_acl.go @@ -169,7 +169,6 @@ func resourceAwsDefaultNetworkAclCreate(d *schema.ResourceData, meta interface{} func resourceAwsDefaultNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) if d.HasChange("ingress") { err := updateNetworkAclEntries(d, "ingress", conn) @@ -241,7 +240,6 @@ func resourceAwsDefaultNetworkAclUpdate(d *schema.ResourceData, meta interface{} } } - d.Partial(false) // Re-use the exiting Network ACL Resources READ method return resourceAwsNetworkAclRead(d, meta) } diff --git a/aws/resource_aws_ec2_client_vpn_endpoint.go b/aws/resource_aws_ec2_client_vpn_endpoint.go index cb1e7cca2ef..3034f0bcf16 100644 --- a/aws/resource_aws_ec2_client_vpn_endpoint.go +++ b/aws/resource_aws_ec2_client_vpn_endpoint.go @@ -266,8 +266,6 @@ func resourceAwsEc2ClientVpnEndpointDelete(d *schema.ResourceData, meta interfac func resourceAwsEc2ClientVpnEndpointUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) - req := &ec2.ModifyClientVpnEndpointInput{ ClientVpnEndpointId: aws.String(d.Id()), } @@ -334,7 +332,6 @@ func resourceAwsEc2ClientVpnEndpointUpdate(d *schema.ResourceData, meta interfac } } - d.Partial(false) return resourceAwsEc2ClientVpnEndpointRead(d, meta) } diff --git a/aws/resource_aws_instance.go b/aws/resource_aws_instance.go index d35ac0db122..6fecb4179f9 100644 --- a/aws/resource_aws_instance.go +++ b/aws/resource_aws_instance.go @@ -949,16 +949,12 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) - if d.HasChange("tags") && !d.IsNewResource() { o, n := d.GetChange("tags") if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating tags: %s", err) } - - d.SetPartial("tags") } if d.HasChange("volume_tags") && !d.IsNewResource() { @@ -974,8 +970,6 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error updating volume_tags (%s): %s", volumeId, err) } } - - d.SetPartial("volume_tags") } if d.HasChange("iam_instance_profile") && !d.IsNewResource() { @@ -1269,8 +1263,6 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { // TODO(mitchellh): wait for the attributes we modified to // persist the change... - d.Partial(false) - return resourceAwsInstanceRead(d, meta) } diff --git a/aws/resource_aws_network_acl.go b/aws/resource_aws_network_acl.go index 6b2ee541a76..6456a98daed 100644 --- a/aws/resource_aws_network_acl.go +++ b/aws/resource_aws_network_acl.go @@ -251,7 +251,6 @@ func resourceAwsNetworkAclRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) if d.HasChange("ingress") { err := updateNetworkAclEntries(d, "ingress", conn) @@ -335,7 +334,6 @@ func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error } } - d.Partial(false) return resourceAwsNetworkAclRead(d, meta) } diff --git a/aws/resource_aws_network_interface.go b/aws/resource_aws_network_interface.go index b568909a978..87563c23b05 100644 --- a/aws/resource_aws_network_interface.go +++ b/aws/resource_aws_network_interface.go @@ -261,7 +261,6 @@ func resourceAwsNetworkInterfaceDetach(oa *schema.Set, meta interface{}, eniId s func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) if d.HasChange("attachment") { oa, na := d.GetChange("attachment") @@ -285,8 +284,6 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error attaching ENI: %s", attach_err) } } - - d.SetPartial("attachment") } if d.HasChange("private_ips") { @@ -326,8 +323,6 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Failure to assign Private IPs: %s", err) } } - - d.SetPartial("private_ips") } // ModifyNetworkInterfaceAttribute needs to be called after creating an ENI @@ -342,8 +337,6 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) if err != nil { return fmt.Errorf("Failure updating ENI: %s", err) } - - d.SetPartial("source_dest_check") } if d.HasChange("private_ips_count") && !d.IsNewResource() { @@ -384,8 +377,6 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Failure to unassign Private IPs: %s", err) } } - - d.SetPartial("private_ips_count") } } @@ -399,8 +390,6 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) if err != nil { return fmt.Errorf("Failure updating ENI: %s", err) } - - d.SetPartial("security_groups") } if d.HasChange("description") { @@ -413,8 +402,6 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) if err != nil { return fmt.Errorf("Failure updating ENI: %s", err) } - - d.SetPartial("description") } if d.HasChange("tags") { @@ -425,8 +412,6 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) } } - d.Partial(false) - return resourceAwsNetworkInterfaceRead(d, meta) } diff --git a/aws/resource_aws_spot_fleet_request.go b/aws/resource_aws_spot_fleet_request.go index ecc4d447852..5a33503b830 100644 --- a/aws/resource_aws_spot_fleet_request.go +++ b/aws/resource_aws_spot_fleet_request.go @@ -1197,8 +1197,6 @@ func resourceAwsSpotFleetRequestUpdate(d *schema.ResourceData, meta interface{}) // http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySpotFleetRequest.html conn := meta.(*AWSClient).ec2conn - d.Partial(true) - req := &ec2.ModifySpotFleetRequestInput{ SpotFleetRequestId: aws.String(d.Id()), } diff --git a/aws/resource_aws_subnet.go b/aws/resource_aws_subnet.go index 4615e89eee2..bfd1bf2a695 100644 --- a/aws/resource_aws_subnet.go +++ b/aws/resource_aws_subnet.go @@ -164,8 +164,6 @@ func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { if err != nil { return fmt.Errorf("error adding tags: %s", err) } - - d.SetPartial("tags") } // You cannot modify multiple subnet attributes in the same request. @@ -182,8 +180,6 @@ func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.ModifySubnetAttribute(input); err != nil { return fmt.Errorf("error enabling EC2 Subnet (%s) assign IPv6 address on creation: %s", d.Id(), err) } - - d.SetPartial("assign_ipv6_address_on_creation") } if d.Get("map_public_ip_on_launch").(bool) { @@ -197,12 +193,8 @@ func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.ModifySubnetAttribute(input); err != nil { return fmt.Errorf("error enabling EC2 Subnet (%s) map public IP on launch: %s", d.Id(), err) } - - d.SetPartial("map_public_ip_on_launch") } - d.Partial(false) - return resourceAwsSubnetRead(d, meta) } @@ -262,16 +254,12 @@ func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) - if d.HasChange("tags") { o, n := d.GetChange("tags") if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating EC2 Subnet (%s) tags: %s", d.Id(), err) } - - d.SetPartial("tags") } if d.HasChange("map_public_ip_on_launch") { @@ -288,8 +276,6 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { if err != nil { return err - } else { - d.SetPartial("map_public_ip_on_launch") } } @@ -357,8 +343,6 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { "Error waiting for IPv6 CIDR (%s) to become associated: %s", d.Id(), err) } - - d.SetPartial("ipv6_cidr_block") } if d.HasChange("assign_ipv6_address_on_creation") { @@ -375,13 +359,9 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { if err != nil { return err - } else { - d.SetPartial("assign_ipv6_address_on_creation") } } - d.Partial(false) - return resourceAwsSubnetRead(d, meta) } diff --git a/aws/resource_aws_vpc.go b/aws/resource_aws_vpc.go index 82de72328d0..8485d1570a7 100644 --- a/aws/resource_aws_vpc.go +++ b/aws/resource_aws_vpc.go @@ -145,10 +145,6 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { d.SetId(*vpc.VpcId) log.Printf("[INFO] VPC ID: %s", d.Id()) - // Set partial mode and say that we setup the cidr block - d.Partial(true) - d.SetPartial("cidr_block") - // Wait for the VPC to become available log.Printf( "[DEBUG] Waiting for VPC (%s) to become available", @@ -186,8 +182,6 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.ModifyVpcAttribute(input); err != nil { return fmt.Errorf("error enabling VPC (%s) DNS hostnames: %s", d.Id(), err) } - - d.SetPartial("enable_dns_hostnames") } // By default, only the enableDnsSupport attribute is set to true in a VPC created any other way. @@ -204,8 +198,6 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.ModifyVpcAttribute(input); err != nil { return fmt.Errorf("error disabling VPC (%s) DNS support: %s", d.Id(), err) } - - d.SetPartial("enable_dns_support") } if d.Get("enable_classiclink").(bool) { @@ -216,8 +208,6 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.EnableVpcClassicLink(input); err != nil { return fmt.Errorf("error enabling VPC (%s) ClassicLink: %s", d.Id(), err) } - - d.SetPartial("enable_classiclink") } if d.Get("enable_classiclink_dns_support").(bool) { @@ -228,8 +218,6 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.EnableVpcClassicLinkDnsSupport(input); err != nil { return fmt.Errorf("error enabling VPC (%s) ClassicLink DNS support: %s", d.Id(), err) } - - d.SetPartial("enable_classiclink_dns_support") } if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { @@ -255,12 +243,8 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { if err != nil { return fmt.Errorf("error adding tags: %s", err) } - - d.SetPartial("tags") } - d.Partial(false) - return resourceAwsVpcRead(d, meta) } @@ -399,8 +383,6 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - // Turn on partial mode - d.Partial(true) vpcid := d.Id() if d.HasChange("enable_dns_hostnames") { val := d.Get("enable_dns_hostnames").(bool) @@ -417,8 +399,6 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil { return err } - - d.SetPartial("enable_dns_hostnames") } _, hasEnableDnsSupportOption := d.GetOk("enable_dns_support") @@ -438,8 +418,6 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.ModifyVpcAttribute(modifyOpts); err != nil { return err } - - d.SetPartial("enable_dns_support") } if d.HasChange("enable_classiclink") { @@ -465,8 +443,6 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { return err } } - - d.SetPartial("enable_classiclink") } if d.HasChange("enable_classiclink_dns_support") { @@ -492,8 +468,6 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { return err } } - - d.SetPartial("enable_classiclink_dns_support") } if d.HasChange("assign_generated_ipv6_cidr_block") { @@ -533,8 +507,6 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error waiting for EC2 VPC (%s) IPv6 CIDR to become disassociated: %s", d.Id(), err) } } - - d.SetPartial("assign_generated_ipv6_cidr_block") } if d.HasChange("instance_tenancy") { @@ -548,8 +520,6 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { if _, err := conn.ModifyVpcTenancy(modifyOpts); err != nil { return err } - - d.SetPartial("instance_tenancy") } if d.HasChange("tags") { @@ -558,11 +528,8 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating tags: %s", err) } - - d.SetPartial("tags") } - d.Partial(false) return resourceAwsVpcRead(d, meta) } diff --git a/aws/resource_aws_vpc_endpoint_service.go b/aws/resource_aws_vpc_endpoint_service.go index 823ed654216..06e0d4600d6 100644 --- a/aws/resource_aws_vpc_endpoint_service.go +++ b/aws/resource_aws_vpc_endpoint_service.go @@ -178,7 +178,6 @@ func resourceAwsVpcEndpointServiceRead(d *schema.ResourceData, meta interface{}) func resourceAwsVpcEndpointServiceUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) svcId := d.Id() modifyCfgReq := &ec2.ModifyVpcEndpointServiceConfigurationInput{ @@ -201,8 +200,6 @@ func resourceAwsVpcEndpointServiceUpdate(d *schema.ResourceData, meta interface{ if err := vpcEndpointServiceWaitUntilAvailable(d, conn); err != nil { return err } - - d.SetPartial("network_load_balancer_arns") } modifyPermReq := &ec2.ModifyVpcEndpointServicePermissionsInput{ @@ -214,8 +211,6 @@ func resourceAwsVpcEndpointServiceUpdate(d *schema.ResourceData, meta interface{ if _, err := conn.ModifyVpcEndpointServicePermissions(modifyPermReq); err != nil { return fmt.Errorf("Error modifying VPC Endpoint Service permissions: %s", err.Error()) } - - d.SetPartial("allowed_principals") } if d.HasChange("tags") { @@ -226,7 +221,6 @@ func resourceAwsVpcEndpointServiceUpdate(d *schema.ResourceData, meta interface{ } } - d.Partial(false) return resourceAwsVpcEndpointServiceRead(d, meta) }