From 5cfb1c5c17bb0a46d3e52f980256caf4b3947d00 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Tue, 8 Dec 2020 20:48:21 -0500 Subject: [PATCH 1/3] autofix extraneous value conversion in resources --- aws/resource_aws_appsync_function.go | 14 +++++----- aws/resource_aws_appsync_graphql_api.go | 2 +- ...ource_aws_autoscalingplans_scaling_plan.go | 2 +- ..._aws_cloudwatch_log_subscription_filter.go | 10 +++---- aws/resource_aws_codepipeline_webhook.go | 8 +++--- aws/resource_aws_cur_report_definition.go | 6 ++--- aws/resource_aws_dax_cluster.go | 4 +-- ...esource_aws_directory_service_directory.go | 4 +-- aws/resource_aws_dx_gateway.go | 4 +-- ...rce_aws_dx_gateway_association_proposal.go | 6 ++--- aws/resource_aws_ebs_encryption_by_default.go | 3 +-- aws/resource_aws_ec2_transit_gateway.go | 2 +- ...rce_aws_ec2_transit_gateway_route_table.go | 6 ++--- ...transit_gateway_route_table_association.go | 6 ++--- ...transit_gateway_route_table_propagation.go | 6 ++--- ..._aws_ec2_transit_gateway_vpc_attachment.go | 6 ++--- ...transit_gateway_vpc_attachment_accepter.go | 8 +++--- aws/resource_aws_elasticache_cluster.go | 2 +- aws/resource_aws_elasticsearch_domain.go | 2 +- aws/resource_aws_emr_cluster.go | 2 +- aws/resource_aws_glue_job.go | 8 +++--- aws/resource_aws_glue_ml_transform.go | 10 +++---- aws/resource_aws_iam_user_login_profile.go | 2 +- ...ource_aws_kinesis_analytics_application.go | 2 +- ...urce_aws_kinesisanalyticsv2_application.go | 2 +- ...aws_lambda_function_event_invoke_config.go | 4 +-- ...s_lambda_provisioned_concurrency_config.go | 2 +- aws/resource_aws_msk_cluster.go | 10 +++---- aws/resource_aws_msk_configuration.go | 8 +++--- aws/resource_aws_pinpoint_email_channel.go | 2 +- aws/resource_aws_pinpoint_sms_channel.go | 4 +-- aws/resource_aws_rds_cluster.go | 2 +- aws/resource_aws_resourcegroups_group.go | 4 +-- aws/resource_aws_s3_bucket_inventory.go | 4 +-- aws/resource_aws_ses_configuration_set.go | 2 +- aws/resource_aws_sns_topic.go | 26 +++++++++---------- aws/resource_aws_spot_fleet_request.go | 20 +++++++------- ..._aws_storagegateway_cached_iscsi_volume.go | 14 +++++----- aws/resource_aws_storagegateway_gateway.go | 4 +-- aws/resource_aws_storagegateway_tape_pool.go | 8 +++--- aws/resource_aws_transfer_server.go | 4 +-- aws/resource_aws_wafv2_ip_set.go | 10 +++---- aws/resource_aws_wafv2_regex_pattern_set.go | 8 +++--- aws/resource_aws_wafv2_rule_group.go | 10 +++---- aws/resource_aws_wafv2_web_acl.go | 10 +++---- aws/resource_aws_worklink_fleet.go | 8 +++--- 46 files changed, 144 insertions(+), 147 deletions(-) diff --git a/aws/resource_aws_appsync_function.go b/aws/resource_aws_appsync_function.go index 42d4566f4e50..51c7045d314d 100644 --- a/aws/resource_aws_appsync_function.go +++ b/aws/resource_aws_appsync_function.go @@ -132,13 +132,13 @@ func resourceAwsAppsyncFunctionRead(d *schema.ResourceData, meta interface{}) er d.Set("api_id", apiID) d.Set("function_id", functionID) - d.Set("data_source", aws.StringValue(resp.FunctionConfiguration.DataSourceName)) - d.Set("description", aws.StringValue(resp.FunctionConfiguration.Description)) - d.Set("arn", aws.StringValue(resp.FunctionConfiguration.FunctionArn)) - d.Set("function_version", aws.StringValue(resp.FunctionConfiguration.FunctionVersion)) - d.Set("name", aws.StringValue(resp.FunctionConfiguration.Name)) - d.Set("request_mapping_template", aws.StringValue(resp.FunctionConfiguration.RequestMappingTemplate)) - d.Set("response_mapping_template", aws.StringValue(resp.FunctionConfiguration.ResponseMappingTemplate)) + d.Set("data_source", resp.FunctionConfiguration.DataSourceName) + d.Set("description", resp.FunctionConfiguration.Description) + d.Set("arn", resp.FunctionConfiguration.FunctionArn) + d.Set("function_version", resp.FunctionConfiguration.FunctionVersion) + d.Set("name", resp.FunctionConfiguration.Name) + d.Set("request_mapping_template", resp.FunctionConfiguration.RequestMappingTemplate) + d.Set("response_mapping_template", resp.FunctionConfiguration.ResponseMappingTemplate) return nil } diff --git a/aws/resource_aws_appsync_graphql_api.go b/aws/resource_aws_appsync_graphql_api.go index af4988538c28..ab2d067aa09b 100644 --- a/aws/resource_aws_appsync_graphql_api.go +++ b/aws/resource_aws_appsync_graphql_api.go @@ -299,7 +299,7 @@ func resourceAwsAppsyncGraphqlApiRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error setting tags: %s", err) } - if err := d.Set("xray_enabled", aws.BoolValue(resp.GraphqlApi.XrayEnabled)); err != nil { + if err := d.Set("xray_enabled", resp.GraphqlApi.XrayEnabled); err != nil { return fmt.Errorf("error setting xray_enabled: %s", err) } diff --git a/aws/resource_aws_autoscalingplans_scaling_plan.go b/aws/resource_aws_autoscalingplans_scaling_plan.go index df99d0517f26..eb8f1c70fcbc 100644 --- a/aws/resource_aws_autoscalingplans_scaling_plan.go +++ b/aws/resource_aws_autoscalingplans_scaling_plan.go @@ -367,7 +367,7 @@ func resourceAwsAutoScalingPlansScalingPlanRead(d *schema.ResourceData, meta int if err != nil { return fmt.Errorf("error setting application_source: %w", err) } - d.Set("scaling_plan_version", int(aws.Int64Value(scalingPlan.ScalingPlanVersion))) + d.Set("scaling_plan_version", scalingPlan.ScalingPlanVersion) return nil } diff --git a/aws/resource_aws_cloudwatch_log_subscription_filter.go b/aws/resource_aws_cloudwatch_log_subscription_filter.go index 6ebdc048f65a..9ca21dfd244e 100644 --- a/aws/resource_aws_cloudwatch_log_subscription_filter.go +++ b/aws/resource_aws_cloudwatch_log_subscription_filter.go @@ -175,11 +175,11 @@ func resourceAwsCloudwatchLogSubscriptionFilterRead(d *schema.ResourceData, meta for _, subscriptionFilter := range resp.SubscriptionFilters { if aws.StringValue(subscriptionFilter.LogGroupName) == log_group_name { d.SetId(cloudwatchLogsSubscriptionFilterId(log_group_name)) - d.Set("destination_arn", aws.StringValue(subscriptionFilter.DestinationArn)) - d.Set("distribution", aws.StringValue(subscriptionFilter.Distribution)) - d.Set("filter_pattern", aws.StringValue(subscriptionFilter.FilterPattern)) - d.Set("log_group_name", aws.StringValue(subscriptionFilter.LogGroupName)) - d.Set("role_arn", aws.StringValue(subscriptionFilter.RoleArn)) + d.Set("destination_arn", subscriptionFilter.DestinationArn) + d.Set("distribution", subscriptionFilter.Distribution) + d.Set("filter_pattern", subscriptionFilter.FilterPattern) + d.Set("log_group_name", subscriptionFilter.LogGroupName) + d.Set("role_arn", subscriptionFilter.RoleArn) return nil // OK, matching subscription filter found } } diff --git a/aws/resource_aws_codepipeline_webhook.go b/aws/resource_aws_codepipeline_webhook.go index 94413d1039ab..33882ec0ad08 100644 --- a/aws/resource_aws_codepipeline_webhook.go +++ b/aws/resource_aws_codepipeline_webhook.go @@ -249,17 +249,17 @@ func resourceAwsCodePipelineWebhookRead(d *schema.ResourceData, meta interface{} } d.Set("name", name) - d.Set("url", aws.StringValue(webhook.Url)) + d.Set("url", webhook.Url) - if err := d.Set("target_action", aws.StringValue(webhook.Definition.TargetAction)); err != nil { + if err := d.Set("target_action", webhook.Definition.TargetAction); err != nil { return err } - if err := d.Set("target_pipeline", aws.StringValue(webhook.Definition.TargetPipeline)); err != nil { + if err := d.Set("target_pipeline", webhook.Definition.TargetPipeline); err != nil { return err } - if err := d.Set("authentication", aws.StringValue(webhook.Definition.Authentication)); err != nil { + if err := d.Set("authentication", webhook.Definition.Authentication); err != nil { return err } diff --git a/aws/resource_aws_cur_report_definition.go b/aws/resource_aws_cur_report_definition.go index badfcbb53245..13b9aed53fbb 100644 --- a/aws/resource_aws_cur_report_definition.go +++ b/aws/resource_aws_cur_report_definition.go @@ -189,9 +189,9 @@ func resourceAwsCurReportDefinitionRead(d *schema.ResourceData, meta interface{} d.Set("format", matchingReportDefinition.Format) d.Set("compression", matchingReportDefinition.Compression) d.Set("additional_schema_elements", aws.StringValueSlice(matchingReportDefinition.AdditionalSchemaElements)) - d.Set("s3_bucket", aws.StringValue(matchingReportDefinition.S3Bucket)) - d.Set("s3_prefix", aws.StringValue(matchingReportDefinition.S3Prefix)) - d.Set("s3_region", aws.StringValue(matchingReportDefinition.S3Region)) + d.Set("s3_bucket", matchingReportDefinition.S3Bucket) + d.Set("s3_prefix", matchingReportDefinition.S3Prefix) + d.Set("s3_region", matchingReportDefinition.S3Region) d.Set("additional_artifacts", aws.StringValueSlice(matchingReportDefinition.AdditionalArtifacts)) d.Set("refresh_closed_reports", matchingReportDefinition.RefreshClosedReports) d.Set("report_versioning", matchingReportDefinition.ReportVersioning) diff --git a/aws/resource_aws_dax_cluster.go b/aws/resource_aws_dax_cluster.go index 7382a03c3b21..8d04c12c3a60 100644 --- a/aws/resource_aws_dax_cluster.go +++ b/aws/resource_aws_dax_cluster.go @@ -303,9 +303,9 @@ func resourceAwsDaxClusterRead(d *schema.ResourceData, meta interface{}) error { d.Set("replication_factor", c.TotalNodes) if c.ClusterDiscoveryEndpoint != nil { - d.Set("port", aws.Int64Value(c.ClusterDiscoveryEndpoint.Port)) + d.Set("port", c.ClusterDiscoveryEndpoint.Port) d.Set("configuration_endpoint", fmt.Sprintf("%s:%d", aws.StringValue(c.ClusterDiscoveryEndpoint.Address), aws.Int64Value(c.ClusterDiscoveryEndpoint.Port))) - d.Set("cluster_address", aws.StringValue(c.ClusterDiscoveryEndpoint.Address)) + d.Set("cluster_address", c.ClusterDiscoveryEndpoint.Address) } d.Set("subnet_group_name", c.SubnetGroup) diff --git a/aws/resource_aws_directory_service_directory.go b/aws/resource_aws_directory_service_directory.go index 13e8f41d55a6..3fbb8a36232a 100644 --- a/aws/resource_aws_directory_service_directory.go +++ b/aws/resource_aws_directory_service_directory.go @@ -499,9 +499,9 @@ func resourceAwsDirectoryServiceDirectoryRead(d *schema.ResourceData, meta inter d.Set("enable_sso", dir.SsoEnabled) if aws.StringValue(dir.Type) == directoryservice.DirectoryTypeAdconnector { - d.Set("security_group_id", aws.StringValue(dir.ConnectSettings.SecurityGroupId)) + d.Set("security_group_id", dir.ConnectSettings.SecurityGroupId) } else { - d.Set("security_group_id", aws.StringValue(dir.VpcSettings.SecurityGroupId)) + d.Set("security_group_id", dir.VpcSettings.SecurityGroupId) } tags, err := keyvaluetags.DirectoryserviceListTags(dsconn, d.Id()) diff --git a/aws/resource_aws_dx_gateway.go b/aws/resource_aws_dx_gateway.go index 74e95f243c96..8a2b70de3098 100644 --- a/aws/resource_aws_dx_gateway.go +++ b/aws/resource_aws_dx_gateway.go @@ -98,9 +98,9 @@ func resourceAwsDxGatewayRead(d *schema.ResourceData, meta interface{}) error { } dxGw := dxGwRaw.(*directconnect.Gateway) - d.Set("name", aws.StringValue(dxGw.DirectConnectGatewayName)) + d.Set("name", dxGw.DirectConnectGatewayName) d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(dxGw.AmazonSideAsn), 10)) - d.Set("owner_account_id", aws.StringValue(dxGw.OwnerAccount)) + d.Set("owner_account_id", dxGw.OwnerAccount) return nil } diff --git a/aws/resource_aws_dx_gateway_association_proposal.go b/aws/resource_aws_dx_gateway_association_proposal.go index e77a1814c693..9716ff0c908e 100644 --- a/aws/resource_aws_dx_gateway_association_proposal.go +++ b/aws/resource_aws_dx_gateway_association_proposal.go @@ -123,11 +123,11 @@ func resourceAwsDxGatewayAssociationProposalRead(d *schema.ResourceData, meta in return fmt.Errorf("error setting allowed_prefixes: %s", err) } - d.Set("associated_gateway_id", aws.StringValue(proposal.AssociatedGateway.Id)) + d.Set("associated_gateway_id", proposal.AssociatedGateway.Id) d.Set("associated_gateway_owner_account_id", proposal.AssociatedGateway.OwnerAccount) d.Set("associated_gateway_type", proposal.AssociatedGateway.Type) - d.Set("dx_gateway_id", aws.StringValue(proposal.DirectConnectGatewayId)) - d.Set("dx_gateway_owner_account_id", aws.StringValue(proposal.DirectConnectGatewayOwnerAccount)) + d.Set("dx_gateway_id", proposal.DirectConnectGatewayId) + d.Set("dx_gateway_owner_account_id", proposal.DirectConnectGatewayOwnerAccount) return nil } diff --git a/aws/resource_aws_ebs_encryption_by_default.go b/aws/resource_aws_ebs_encryption_by_default.go index 5a3def6d6cc8..adbb240f6f8a 100644 --- a/aws/resource_aws_ebs_encryption_by_default.go +++ b/aws/resource_aws_ebs_encryption_by_default.go @@ -3,7 +3,6 @@ package aws import ( "fmt" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -48,7 +47,7 @@ func resourceAwsEbsEncryptionByDefaultRead(d *schema.ResourceData, meta interfac return fmt.Errorf("error reading EBS encryption by default: %s", err) } - d.Set("enabled", aws.BoolValue(resp.EbsEncryptionByDefault)) + d.Set("enabled", resp.EbsEncryptionByDefault) return nil } diff --git a/aws/resource_aws_ec2_transit_gateway.go b/aws/resource_aws_ec2_transit_gateway.go index 681a7d558bd2..63cb38964ece 100644 --- a/aws/resource_aws_ec2_transit_gateway.go +++ b/aws/resource_aws_ec2_transit_gateway.go @@ -182,7 +182,7 @@ func resourceAwsEc2TransitGatewayRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error reading EC2 Transit Gateway (%s): missing options", d.Id()) } - d.Set("amazon_side_asn", aws.Int64Value(transitGateway.Options.AmazonSideAsn)) + d.Set("amazon_side_asn", transitGateway.Options.AmazonSideAsn) d.Set("arn", transitGateway.TransitGatewayArn) d.Set("association_default_route_table_id", transitGateway.Options.AssociationDefaultRouteTableId) d.Set("auto_accept_shared_attachments", transitGateway.Options.AutoAcceptSharedAttachments) diff --git a/aws/resource_aws_ec2_transit_gateway_route_table.go b/aws/resource_aws_ec2_transit_gateway_route_table.go index 634446aa3024..db2f55503771 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_table.go +++ b/aws/resource_aws_ec2_transit_gateway_route_table.go @@ -97,14 +97,14 @@ func resourceAwsEc2TransitGatewayRouteTableRead(d *schema.ResourceData, meta int return nil } - d.Set("default_association_route_table", aws.BoolValue(transitGatewayRouteTable.DefaultAssociationRouteTable)) - d.Set("default_propagation_route_table", aws.BoolValue(transitGatewayRouteTable.DefaultPropagationRouteTable)) + d.Set("default_association_route_table", transitGatewayRouteTable.DefaultAssociationRouteTable) + d.Set("default_propagation_route_table", transitGatewayRouteTable.DefaultPropagationRouteTable) if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayRouteTable.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } - d.Set("transit_gateway_id", aws.StringValue(transitGatewayRouteTable.TransitGatewayId)) + d.Set("transit_gateway_id", transitGatewayRouteTable.TransitGatewayId) arn := arn.ARN{ Partition: meta.(*AWSClient).partition, diff --git a/aws/resource_aws_ec2_transit_gateway_route_table_association.go b/aws/resource_aws_ec2_transit_gateway_route_table_association.go index 74279bbb4b18..30c3e6326f7b 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_table_association.go +++ b/aws/resource_aws_ec2_transit_gateway_route_table_association.go @@ -101,9 +101,9 @@ func resourceAwsEc2TransitGatewayRouteTableAssociationRead(d *schema.ResourceDat return nil } - d.Set("resource_id", aws.StringValue(transitGatewayAssociation.ResourceId)) - d.Set("resource_type", aws.StringValue(transitGatewayAssociation.ResourceType)) - d.Set("transit_gateway_attachment_id", aws.StringValue(transitGatewayAssociation.TransitGatewayAttachmentId)) + d.Set("resource_id", transitGatewayAssociation.ResourceId) + d.Set("resource_type", transitGatewayAssociation.ResourceType) + d.Set("transit_gateway_attachment_id", transitGatewayAssociation.TransitGatewayAttachmentId) d.Set("transit_gateway_route_table_id", transitGatewayRouteTableID) return nil diff --git a/aws/resource_aws_ec2_transit_gateway_route_table_propagation.go b/aws/resource_aws_ec2_transit_gateway_route_table_propagation.go index bb8d92598396..628ce7c16dfd 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_table_propagation.go +++ b/aws/resource_aws_ec2_transit_gateway_route_table_propagation.go @@ -102,9 +102,9 @@ func resourceAwsEc2TransitGatewayRouteTablePropagationRead(d *schema.ResourceDat return nil } - d.Set("resource_id", aws.StringValue(transitGatewayPropagation.ResourceId)) - d.Set("resource_type", aws.StringValue(transitGatewayPropagation.ResourceType)) - d.Set("transit_gateway_attachment_id", aws.StringValue(transitGatewayPropagation.TransitGatewayAttachmentId)) + d.Set("resource_id", transitGatewayPropagation.ResourceId) + d.Set("resource_type", transitGatewayPropagation.ResourceType) + d.Set("transit_gateway_attachment_id", transitGatewayPropagation.TransitGatewayAttachmentId) d.Set("transit_gateway_route_table_id", transitGatewayRouteTableID) return nil diff --git a/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go b/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go index 331b9cd33948..e9108b43a6c1 100644 --- a/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go +++ b/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go @@ -209,9 +209,9 @@ func resourceAwsEc2TransitGatewayVpcAttachmentRead(d *schema.ResourceData, meta d.Set("transit_gateway_default_route_table_association", (transitGatewayDefaultRouteTableAssociation != nil)) d.Set("transit_gateway_default_route_table_propagation", (transitGatewayDefaultRouteTablePropagation != nil)) - d.Set("transit_gateway_id", aws.StringValue(transitGatewayVpcAttachment.TransitGatewayId)) - d.Set("vpc_id", aws.StringValue(transitGatewayVpcAttachment.VpcId)) - d.Set("vpc_owner_id", aws.StringValue(transitGatewayVpcAttachment.VpcOwnerId)) + d.Set("transit_gateway_id", transitGatewayVpcAttachment.TransitGatewayId) + d.Set("vpc_id", transitGatewayVpcAttachment.VpcId) + d.Set("vpc_owner_id", transitGatewayVpcAttachment.VpcOwnerId) return nil } diff --git a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go index 744d990cf810..a259b46112ee 100644 --- a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go +++ b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go @@ -182,12 +182,12 @@ func resourceAwsEc2TransitGatewayVpcAttachmentAccepterRead(d *schema.ResourceDat return fmt.Errorf("error setting tags: %s", err) } - d.Set("transit_gateway_attachment_id", aws.StringValue(transitGatewayVpcAttachment.TransitGatewayAttachmentId)) + d.Set("transit_gateway_attachment_id", transitGatewayVpcAttachment.TransitGatewayAttachmentId) d.Set("transit_gateway_default_route_table_association", (transitGatewayDefaultRouteTableAssociation != nil)) d.Set("transit_gateway_default_route_table_propagation", (transitGatewayDefaultRouteTablePropagation != nil)) - d.Set("transit_gateway_id", aws.StringValue(transitGatewayVpcAttachment.TransitGatewayId)) - d.Set("vpc_id", aws.StringValue(transitGatewayVpcAttachment.VpcId)) - d.Set("vpc_owner_id", aws.StringValue(transitGatewayVpcAttachment.VpcOwnerId)) + d.Set("transit_gateway_id", transitGatewayVpcAttachment.TransitGatewayId) + d.Set("vpc_id", transitGatewayVpcAttachment.VpcId) + d.Set("vpc_owner_id", transitGatewayVpcAttachment.VpcOwnerId) return nil } diff --git a/aws/resource_aws_elasticache_cluster.go b/aws/resource_aws_elasticache_cluster.go index 2c21551107ea..3fc8fa3c2f5c 100644 --- a/aws/resource_aws_elasticache_cluster.go +++ b/aws/resource_aws_elasticache_cluster.go @@ -447,7 +447,7 @@ func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{}) d.Set("configuration_endpoint", aws.String(fmt.Sprintf("%s:%d", aws.StringValue(c.ConfigurationEndpoint.Address), aws.Int64Value(c.ConfigurationEndpoint.Port)))) d.Set("cluster_address", c.ConfigurationEndpoint.Address) } else if len(c.CacheNodes) > 0 { - d.Set("port", int(aws.Int64Value(c.CacheNodes[0].Endpoint.Port))) + d.Set("port", c.CacheNodes[0].Endpoint.Port)) } if c.ReplicationGroupId != nil { diff --git a/aws/resource_aws_elasticsearch_domain.go b/aws/resource_aws_elasticsearch_domain.go index 2918414b37dc..1b7d74cde509 100644 --- a/aws/resource_aws_elasticsearch_domain.go +++ b/aws/resource_aws_elasticsearch_domain.go @@ -743,7 +743,7 @@ func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{} } } else { if ds.Endpoint != nil { - d.Set("endpoint", aws.StringValue(ds.Endpoint)) + d.Set("endpoint", ds.Endpoint) d.Set("kibana_endpoint", getKibanaEndpoint(d)) } if ds.Endpoints != nil { diff --git a/aws/resource_aws_emr_cluster.go b/aws/resource_aws_emr_cluster.go index 0b028fa250c9..a988055cdf0d 100644 --- a/aws/resource_aws_emr_cluster.go +++ b/aws/resource_aws_emr_cluster.go @@ -1013,7 +1013,7 @@ func resourceAwsEMRClusterRead(d *schema.ResourceData, meta interface{}) error { d.Set("cluster_state", state) - d.Set("arn", aws.StringValue(cluster.ClusterArn)) + d.Set("arn", cluster.ClusterArn) } instanceGroups, err := fetchAllEMRInstanceGroups(emrconn, d.Id()) diff --git a/aws/resource_aws_glue_job.go b/aws/resource_aws_glue_job.go index 0702af39c8f4..8d4be507b685 100644 --- a/aws/resource_aws_glue_job.go +++ b/aws/resource_aws_glue_job.go @@ -279,8 +279,8 @@ func resourceAwsGlueJobRead(d *schema.ResourceData, meta interface{}) error { if err := d.Set("execution_property", flattenGlueExecutionProperty(job.ExecutionProperty)); err != nil { return fmt.Errorf("error setting execution_property: %s", err) } - d.Set("max_capacity", aws.Float64Value(job.MaxCapacity)) - d.Set("max_retries", int(aws.Int64Value(job.MaxRetries))) + d.Set("max_capacity", job.MaxCapacity) + d.Set("max_retries", job.MaxRetries) if err := d.Set("notification_property", flattenGlueNotificationProperty(job.NotificationProperty)); err != nil { return fmt.Errorf("error setting notification_property: #{err}") } @@ -297,13 +297,13 @@ func resourceAwsGlueJobRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting tags: %s", err) } - d.Set("timeout", int(aws.Int64Value(job.Timeout))) + d.Set("timeout", job.Timeout) if err := d.Set("security_configuration", job.SecurityConfiguration); err != nil { return fmt.Errorf("error setting security_configuration: %s", err) } d.Set("worker_type", job.WorkerType) - d.Set("number_of_workers", int(aws.Int64Value(job.NumberOfWorkers))) + d.Set("number_of_workers", job.NumberOfWorkers) return nil } diff --git a/aws/resource_aws_glue_ml_transform.go b/aws/resource_aws_glue_ml_transform.go index b2a01c3901b9..4140142de5a2 100644 --- a/aws/resource_aws_glue_ml_transform.go +++ b/aws/resource_aws_glue_ml_transform.go @@ -255,14 +255,14 @@ func resourceAwsGlueMLTransformRead(d *schema.ResourceData, meta interface{}) er d.Set("description", output.Description) d.Set("glue_version", output.GlueVersion) - d.Set("max_capacity", aws.Float64Value(output.MaxCapacity)) - d.Set("max_retries", int(aws.Int64Value(output.MaxRetries))) + d.Set("max_capacity", output.MaxCapacity) + d.Set("max_retries", output.MaxRetries) d.Set("name", output.Name) d.Set("role_arn", output.Role) - d.Set("timeout", int(aws.Int64Value(output.Timeout))) + d.Set("timeout", output.Timeout) d.Set("worker_type", output.WorkerType) - d.Set("number_of_workers", int(aws.Int64Value(output.NumberOfWorkers))) - d.Set("label_count", int(aws.Int64Value(output.LabelCount))) + d.Set("number_of_workers", output.NumberOfWorkers) + d.Set("label_count", output.LabelCount) if err := d.Set("input_record_tables", flattenGlueMLTransformInputRecordTables(output.InputRecordTables)); err != nil { return fmt.Errorf("error setting input_record_tables: %w", err) diff --git a/aws/resource_aws_iam_user_login_profile.go b/aws/resource_aws_iam_user_login_profile.go index da557e85d360..64176c4232e3 100644 --- a/aws/resource_aws_iam_user_login_profile.go +++ b/aws/resource_aws_iam_user_login_profile.go @@ -185,7 +185,7 @@ func resourceAwsIamUserLoginProfileRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error getting IAM User Login Profile (%s): empty response", d.Id()) } - d.Set("user", aws.StringValue(output.LoginProfile.UserName)) + d.Set("user", output.LoginProfile.UserName) return nil } diff --git a/aws/resource_aws_kinesis_analytics_application.go b/aws/resource_aws_kinesis_analytics_application.go index 0080c57dbfe1..3c2358462bd7 100644 --- a/aws/resource_aws_kinesis_analytics_application.go +++ b/aws/resource_aws_kinesis_analytics_application.go @@ -718,7 +718,7 @@ func resourceAwsKinesisAnalyticsApplicationRead(d *schema.ResourceData, meta int d.Set("last_update_timestamp", aws.TimeValue(application.LastUpdateTimestamp).Format(time.RFC3339)) d.Set("name", application.ApplicationName) d.Set("status", application.ApplicationStatus) - d.Set("version", int(aws.Int64Value(application.ApplicationVersionId))) + d.Set("version", application.ApplicationVersionId) if err := d.Set("cloudwatch_logging_options", flattenKinesisAnalyticsCloudWatchLoggingOptionDescriptions(application.CloudWatchLoggingOptionDescriptions)); err != nil { return fmt.Errorf("error setting cloudwatch_logging_options: %w", err) diff --git a/aws/resource_aws_kinesisanalyticsv2_application.go b/aws/resource_aws_kinesisanalyticsv2_application.go index 928033636fe2..e6bacfddb185 100644 --- a/aws/resource_aws_kinesisanalyticsv2_application.go +++ b/aws/resource_aws_kinesisanalyticsv2_application.go @@ -910,7 +910,7 @@ func resourceAwsKinesisAnalyticsV2ApplicationRead(d *schema.ResourceData, meta i d.Set("runtime_environment", application.RuntimeEnvironment) d.Set("service_execution_role", application.ServiceExecutionRole) d.Set("status", application.ApplicationStatus) - d.Set("version_id", int(aws.Int64Value(application.ApplicationVersionId))) + d.Set("version_id", application.ApplicationVersionId) if err := d.Set("application_configuration", flattenKinesisAnalyticsV2ApplicationConfigurationDescription(application.ApplicationConfigurationDescription)); err != nil { return fmt.Errorf("error setting application_configuration: %w", err) diff --git a/aws/resource_aws_lambda_function_event_invoke_config.go b/aws/resource_aws_lambda_function_event_invoke_config.go index 5c76740024fd..009dd905eacc 100644 --- a/aws/resource_aws_lambda_function_event_invoke_config.go +++ b/aws/resource_aws_lambda_function_event_invoke_config.go @@ -182,8 +182,8 @@ func resourceAwsLambdaFunctionEventInvokeConfigRead(d *schema.ResourceData, meta } d.Set("function_name", functionName) - d.Set("maximum_event_age_in_seconds", aws.Int64Value(output.MaximumEventAgeInSeconds)) - d.Set("maximum_retry_attempts", aws.Int64Value(output.MaximumRetryAttempts)) + d.Set("maximum_event_age_in_seconds", output.MaximumEventAgeInSeconds) + d.Set("maximum_retry_attempts", output.MaximumRetryAttempts) d.Set("qualifier", qualifier) return nil diff --git a/aws/resource_aws_lambda_provisioned_concurrency_config.go b/aws/resource_aws_lambda_provisioned_concurrency_config.go index 164d9f1292cf..b5ee216dd04f 100644 --- a/aws/resource_aws_lambda_provisioned_concurrency_config.go +++ b/aws/resource_aws_lambda_provisioned_concurrency_config.go @@ -102,7 +102,7 @@ func resourceAwsLambdaProvisionedConcurrencyConfigRead(d *schema.ResourceData, m } d.Set("function_name", functionName) - d.Set("provisioned_concurrent_executions", aws.Int64Value(output.AllocatedProvisionedConcurrentExecutions)) + d.Set("provisioned_concurrent_executions", output.AllocatedProvisionedConcurrentExecutions) d.Set("qualifier", qualifier) return nil diff --git a/aws/resource_aws_msk_cluster.go b/aws/resource_aws_msk_cluster.go index cc79dfb5a2c9..01587a6c469e 100644 --- a/aws/resource_aws_msk_cluster.go +++ b/aws/resource_aws_msk_cluster.go @@ -469,21 +469,21 @@ func resourceAwsMskClusterRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting configuration_info: %s", err) } - d.Set("cluster_name", aws.StringValue(cluster.ClusterName)) + d.Set("cluster_name", cluster.ClusterName) if err := d.Set("configuration_info", flattenMskConfigurationInfo(cluster.CurrentBrokerSoftwareInfo)); err != nil { return fmt.Errorf("error setting configuration_info: %s", err) } - d.Set("current_version", aws.StringValue(cluster.CurrentVersion)) - d.Set("enhanced_monitoring", aws.StringValue(cluster.EnhancedMonitoring)) + d.Set("current_version", cluster.CurrentVersion) + d.Set("enhanced_monitoring", cluster.EnhancedMonitoring) if err := d.Set("encryption_info", flattenMskEncryptionInfo(cluster.EncryptionInfo)); err != nil { return fmt.Errorf("error setting encryption_info: %s", err) } - d.Set("kafka_version", aws.StringValue(cluster.CurrentBrokerSoftwareInfo.KafkaVersion)) - d.Set("number_of_broker_nodes", aws.Int64Value(cluster.NumberOfBrokerNodes)) + d.Set("kafka_version", cluster.CurrentBrokerSoftwareInfo.KafkaVersion) + d.Set("number_of_broker_nodes", cluster.NumberOfBrokerNodes) if err := d.Set("tags", keyvaluetags.KafkaKeyValueTags(cluster.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) diff --git a/aws/resource_aws_msk_configuration.go b/aws/resource_aws_msk_configuration.go index 345aa0eed1a9..ee1ac1abf6a9 100644 --- a/aws/resource_aws_msk_configuration.go +++ b/aws/resource_aws_msk_configuration.go @@ -122,15 +122,15 @@ func resourceAwsMskConfigurationRead(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("error describing MSK Configuration (%s) Revision (%d): missing result", d.Id(), aws.Int64Value(revision)) } - d.Set("arn", aws.StringValue(configurationOutput.Arn)) - d.Set("description", aws.StringValue(revisionOutput.Description)) + d.Set("arn", configurationOutput.Arn) + d.Set("description", revisionOutput.Description) if err := d.Set("kafka_versions", aws.StringValueSlice(configurationOutput.KafkaVersions)); err != nil { return fmt.Errorf("error setting kafka_versions: %s", err) } - d.Set("latest_revision", aws.Int64Value(revision)) - d.Set("name", aws.StringValue(configurationOutput.Name)) + d.Set("latest_revision", revision) + d.Set("name", configurationOutput.Name) d.Set("server_properties", string(revisionOutput.ServerProperties)) return nil diff --git a/aws/resource_aws_pinpoint_email_channel.go b/aws/resource_aws_pinpoint_email_channel.go index 41ddb56470c0..c87d53f67b1a 100644 --- a/aws/resource_aws_pinpoint_email_channel.go +++ b/aws/resource_aws_pinpoint_email_channel.go @@ -113,7 +113,7 @@ func resourceAwsPinpointEmailChannelRead(d *schema.ResourceData, meta interface{ d.Set("identity", res.Identity) d.Set("role_arn", res.RoleArn) d.Set("configuration_set", res.ConfigurationSet) - d.Set("messages_per_second", aws.Int64Value(res.MessagesPerSecond)) + d.Set("messages_per_second", res.MessagesPerSecond) return nil } diff --git a/aws/resource_aws_pinpoint_sms_channel.go b/aws/resource_aws_pinpoint_sms_channel.go index e781c6e68aa8..183285a7f7e4 100644 --- a/aws/resource_aws_pinpoint_sms_channel.go +++ b/aws/resource_aws_pinpoint_sms_channel.go @@ -105,8 +105,8 @@ func resourceAwsPinpointSMSChannelRead(d *schema.ResourceData, meta interface{}) d.Set("enabled", res.Enabled) d.Set("sender_id", res.SenderId) d.Set("short_code", res.ShortCode) - d.Set("promotional_messages_per_second", aws.Int64Value(res.PromotionalMessagesPerSecond)) - d.Set("transactional_messages_per_second", aws.Int64Value(res.TransactionalMessagesPerSecond)) + d.Set("promotional_messages_per_second", res.PromotionalMessagesPerSecond) + d.Set("transactional_messages_per_second", res.TransactionalMessagesPerSecond) return nil } diff --git a/aws/resource_aws_rds_cluster.go b/aws/resource_aws_rds_cluster.go index db0ea10ffb43..4e1edb97d169 100644 --- a/aws/resource_aws_rds_cluster.go +++ b/aws/resource_aws_rds_cluster.go @@ -1015,7 +1015,7 @@ func resourceAwsRDSClusterRead(d *schema.ResourceData, meta interface{}) error { } d.Set("arn", dbc.DBClusterArn) - d.Set("backtrack_window", int(aws.Int64Value(dbc.BacktrackWindow))) + d.Set("backtrack_window", dbc.BacktrackWindow) d.Set("backup_retention_period", dbc.BackupRetentionPeriod) d.Set("cluster_identifier", dbc.DBClusterIdentifier) d.Set("copy_tags_to_snapshot", dbc.CopyTagsToSnapshot) diff --git a/aws/resource_aws_resourcegroups_group.go b/aws/resource_aws_resourcegroups_group.go index 2c7558db14c6..b00ffd3db15f 100644 --- a/aws/resource_aws_resourcegroups_group.go +++ b/aws/resource_aws_resourcegroups_group.go @@ -115,8 +115,8 @@ func resourceAwsResourceGroupsGroupRead(d *schema.ResourceData, meta interface{} } arn := aws.StringValue(g.Group.GroupArn) - d.Set("name", aws.StringValue(g.Group.Name)) - d.Set("description", aws.StringValue(g.Group.Description)) + d.Set("name", g.Group.Name) + d.Set("description", g.Group.Description) d.Set("arn", arn) q, err := conn.GetGroupQuery(&resourcegroups.GetGroupQueryInput{ diff --git a/aws/resource_aws_s3_bucket_inventory.go b/aws/resource_aws_s3_bucket_inventory.go index 2d86bf46f17c..438f718d0bb3 100644 --- a/aws/resource_aws_s3_bucket_inventory.go +++ b/aws/resource_aws_s3_bucket_inventory.go @@ -329,8 +329,8 @@ func resourceAwsS3BucketInventoryRead(d *schema.ResourceData, meta interface{}) return nil } - d.Set("enabled", aws.BoolValue(output.InventoryConfiguration.IsEnabled)) - d.Set("included_object_versions", aws.StringValue(output.InventoryConfiguration.IncludedObjectVersions)) + d.Set("enabled", output.InventoryConfiguration.IsEnabled) + d.Set("included_object_versions", output.InventoryConfiguration.IncludedObjectVersions) if err := d.Set("optional_fields", flattenStringList(output.InventoryConfiguration.OptionalFields)); err != nil { return fmt.Errorf("error setting optional_fields: %s", err) diff --git a/aws/resource_aws_ses_configuration_set.go b/aws/resource_aws_ses_configuration_set.go index ac1e080d0fdf..ef27a9f03e68 100644 --- a/aws/resource_aws_ses_configuration_set.go +++ b/aws/resource_aws_ses_configuration_set.go @@ -107,7 +107,7 @@ func resourceAwsSesConfigurationSetRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error setting delivery_options: %w", err) } - d.Set("name", aws.StringValue(response.ConfigurationSet.Name)) + d.Set("name", response.ConfigurationSet.Name) arn := arn.ARN{ Partition: meta.(*AWSClient).partition, diff --git a/aws/resource_aws_sns_topic.go b/aws/resource_aws_sns_topic.go index ac9bdc0e0039..93ed21400112 100644 --- a/aws/resource_aws_sns_topic.go +++ b/aws/resource_aws_sns_topic.go @@ -401,19 +401,19 @@ func resourceAwsSnsTopicRead(d *schema.ResourceData, meta interface{}) error { // set the mutable attributes if attributeOutput.Attributes != nil && len(attributeOutput.Attributes) > 0 { // set the string values - d.Set("application_failure_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["ApplicationFailureFeedbackRoleArn"])) - d.Set("application_success_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["ApplicationSuccessFeedbackRoleArn"])) - d.Set("arn", aws.StringValue(attributeOutput.Attributes["TopicArn"])) - d.Set("delivery_policy", aws.StringValue(attributeOutput.Attributes["DeliveryPolicy"])) - d.Set("display_name", aws.StringValue(attributeOutput.Attributes["DisplayName"])) - d.Set("http_failure_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["HTTPFailureFeedbackRoleArn"])) - d.Set("http_success_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["HTTPSuccessFeedbackRoleArn"])) - d.Set("kms_master_key_id", aws.StringValue(attributeOutput.Attributes["KmsMasterKeyId"])) - d.Set("lambda_failure_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["LambdaFailureFeedbackRoleArn"])) - d.Set("lambda_success_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["LambdaSuccessFeedbackRoleArn"])) - d.Set("policy", aws.StringValue(attributeOutput.Attributes["Policy"])) - d.Set("sqs_failure_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["SQSFailureFeedbackRoleArn"])) - d.Set("sqs_success_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["SQSSuccessFeedbackRoleArn"])) + d.Set("application_failure_feedback_role_arn", attributeOutput.Attributes["ApplicationFailureFeedbackRoleArn"]) + d.Set("application_success_feedback_role_arn", attributeOutput.Attributes["ApplicationSuccessFeedbackRoleArn"]) + d.Set("arn", attributeOutput.Attributes["TopicArn"]) + d.Set("delivery_policy", attributeOutput.Attributes["DeliveryPolicy"]) + d.Set("display_name", attributeOutput.Attributes["DisplayName"]) + d.Set("http_failure_feedback_role_arn", attributeOutput.Attributes["HTTPFailureFeedbackRoleArn"]) + d.Set("http_success_feedback_role_arn", attributeOutput.Attributes["HTTPSuccessFeedbackRoleArn"]) + d.Set("kms_master_key_id", attributeOutput.Attributes["KmsMasterKeyId"]) + d.Set("lambda_failure_feedback_role_arn", attributeOutput.Attributes["LambdaFailureFeedbackRoleArn"]) + d.Set("lambda_success_feedback_role_arn", attributeOutput.Attributes["LambdaSuccessFeedbackRoleArn"]) + d.Set("policy", attributeOutput.Attributes["Policy"]) + d.Set("sqs_failure_feedback_role_arn", attributeOutput.Attributes["SQSFailureFeedbackRoleArn"]) + d.Set("sqs_success_feedback_role_arn", attributeOutput.Attributes["SQSSuccessFeedbackRoleArn"]) // set the number values var vStr string diff --git a/aws/resource_aws_spot_fleet_request.go b/aws/resource_aws_spot_fleet_request.go index 39a852836d06..20f52611cecf 100644 --- a/aws/resource_aws_spot_fleet_request.go +++ b/aws/resource_aws_spot_fleet_request.go @@ -1230,44 +1230,42 @@ func resourceAwsSpotFleetRequestRead(d *schema.ResourceData, meta interface{}) e } d.SetId(aws.StringValue(sfr.SpotFleetRequestId)) - d.Set("spot_request_state", aws.StringValue(sfr.SpotFleetRequestState)) + d.Set("spot_request_state", sfr.SpotFleetRequestState) config := sfr.SpotFleetRequestConfig if config.AllocationStrategy != nil { - d.Set("allocation_strategy", aws.StringValue(config.AllocationStrategy)) + d.Set("allocation_strategy", config.AllocationStrategy) } if config.InstancePoolsToUseCount != nil { - d.Set("instance_pools_to_use_count", aws.Int64Value(config.InstancePoolsToUseCount)) + d.Set("instance_pools_to_use_count", config.InstancePoolsToUseCount) } if config.ClientToken != nil { - d.Set("client_token", aws.StringValue(config.ClientToken)) + d.Set("client_token", config.ClientToken) } if config.ExcessCapacityTerminationPolicy != nil { - d.Set("excess_capacity_termination_policy", - aws.StringValue(config.ExcessCapacityTerminationPolicy)) + d.Set("excess_capacity_termination_policy", config.ExcessCapacityTerminationPolicy) } if config.IamFleetRole != nil { - d.Set("iam_fleet_role", aws.StringValue(config.IamFleetRole)) + d.Set("iam_fleet_role", config.IamFleetRole) } d.Set("spot_maintenance_strategies", flattenSpotMaintenanceStrategies(config.SpotMaintenanceStrategies)) if config.SpotPrice != nil { - d.Set("spot_price", aws.StringValue(config.SpotPrice)) + d.Set("spot_price", config.SpotPrice) } if config.TargetCapacity != nil { - d.Set("target_capacity", aws.Int64Value(config.TargetCapacity)) + d.Set("target_capacity", config.TargetCapacity) } if config.TerminateInstancesWithExpiration != nil { - d.Set("terminate_instances_with_expiration", - aws.BoolValue(config.TerminateInstancesWithExpiration)) + d.Set("terminate_instances_with_expiration", config.TerminateInstancesWithExpiration) } if config.ValidFrom != nil { diff --git a/aws/resource_aws_storagegateway_cached_iscsi_volume.go b/aws/resource_aws_storagegateway_cached_iscsi_volume.go index c56811ea6d5e..0993ef180973 100644 --- a/aws/resource_aws_storagegateway_cached_iscsi_volume.go +++ b/aws/resource_aws_storagegateway_cached_iscsi_volume.go @@ -185,10 +185,10 @@ func resourceAwsStorageGatewayCachedIscsiVolumeRead(d *schema.ResourceData, meta arn := aws.StringValue(volume.VolumeARN) d.Set("arn", arn) - d.Set("snapshot_id", aws.StringValue(volume.SourceSnapshotId)) + d.Set("snapshot_id", volume.SourceSnapshotId) d.Set("volume_arn", arn) - d.Set("volume_id", aws.StringValue(volume.VolumeId)) - d.Set("volume_size_in_bytes", int(aws.Int64Value(volume.VolumeSizeInBytes))) + d.Set("volume_id", volume.VolumeId) + d.Set("volume_size_in_bytes", volume.VolumeSizeInBytes) d.Set("kms_key", volume.KMSKey) if volume.KMSKey != nil { d.Set("kms_encrypted", true) @@ -205,10 +205,10 @@ func resourceAwsStorageGatewayCachedIscsiVolumeRead(d *schema.ResourceData, meta } if volume.VolumeiSCSIAttributes != nil { - d.Set("chap_enabled", aws.BoolValue(volume.VolumeiSCSIAttributes.ChapEnabled)) - d.Set("lun_number", int(aws.Int64Value(volume.VolumeiSCSIAttributes.LunNumber))) - d.Set("network_interface_id", aws.StringValue(volume.VolumeiSCSIAttributes.NetworkInterfaceId)) - d.Set("network_interface_port", int(aws.Int64Value(volume.VolumeiSCSIAttributes.NetworkInterfacePort))) + d.Set("chap_enabled", volume.VolumeiSCSIAttributes.ChapEnabled) + d.Set("lun_number", volume.VolumeiSCSIAttributes.LunNumber) + d.Set("network_interface_id", volume.VolumeiSCSIAttributes.NetworkInterfaceId) + d.Set("network_interface_port", volume.VolumeiSCSIAttributes.NetworkInterfacePort) targetARN := aws.StringValue(volume.VolumeiSCSIAttributes.TargetARN) d.Set("target_arn", targetARN) diff --git a/aws/resource_aws_storagegateway_gateway.go b/aws/resource_aws_storagegateway_gateway.go index 9a14e3fc0e9c..4c0cd665403f 100644 --- a/aws/resource_aws_storagegateway_gateway.go +++ b/aws/resource_aws_storagegateway_gateway.go @@ -562,8 +562,8 @@ func resourceAwsStorageGatewayGatewayRead(d *schema.ResourceData, meta interface return fmt.Errorf("error reading Storage Gateway Bandwidth rate limit: %s", err) } if err == nil { - d.Set("average_download_rate_limit_in_bits_per_sec", aws.Int64Value(bandwidthOutput.AverageDownloadRateLimitInBitsPerSec)) - d.Set("average_upload_rate_limit_in_bits_per_sec", aws.Int64Value(bandwidthOutput.AverageUploadRateLimitInBitsPerSec)) + d.Set("average_download_rate_limit_in_bits_per_sec", bandwidthOutput.AverageDownloadRateLimitInBitsPerSec) + d.Set("average_upload_rate_limit_in_bits_per_sec", bandwidthOutput.AverageUploadRateLimitInBitsPerSec) } return nil diff --git a/aws/resource_aws_storagegateway_tape_pool.go b/aws/resource_aws_storagegateway_tape_pool.go index ba59e417dfdd..5677bd5fd334 100644 --- a/aws/resource_aws_storagegateway_tape_pool.go +++ b/aws/resource_aws_storagegateway_tape_pool.go @@ -117,10 +117,10 @@ func resourceAwsStorageGatewayTapePoolRead(d *schema.ResourceData, meta interfac poolArn := aws.StringValue(pool.PoolARN) d.Set("arn", poolArn) - d.Set("pool_name", aws.StringValue(pool.PoolName)) - d.Set("retention_lock_time_in_days", aws.Int64Value(pool.RetentionLockTimeInDays)) - d.Set("retention_lock_type", aws.StringValue(pool.RetentionLockType)) - d.Set("storage_class", aws.StringValue(pool.StorageClass)) + d.Set("pool_name", pool.PoolName) + d.Set("retention_lock_time_in_days", pool.RetentionLockTimeInDays) + d.Set("retention_lock_type", pool.RetentionLockType) + d.Set("storage_class", pool.StorageClass) tags, err := keyvaluetags.StoragegatewayListTags(conn, poolArn) if err != nil { diff --git a/aws/resource_aws_transfer_server.go b/aws/resource_aws_transfer_server.go index 5e1bf47b88ff..0bbfb547efde 100644 --- a/aws/resource_aws_transfer_server.go +++ b/aws/resource_aws_transfer_server.go @@ -280,8 +280,8 @@ func resourceAwsTransferServerRead(d *schema.ResourceData, meta interface{}) err d.Set("invocation_role", "") d.Set("url", "") if resp.Server.IdentityProviderDetails != nil { - d.Set("invocation_role", aws.StringValue(resp.Server.IdentityProviderDetails.InvocationRole)) - d.Set("url", aws.StringValue(resp.Server.IdentityProviderDetails.Url)) + d.Set("invocation_role", resp.Server.IdentityProviderDetails.InvocationRole) + d.Set("url", resp.Server.IdentityProviderDetails.Url) } d.Set("endpoint_type", resp.Server.EndpointType) d.Set("endpoint_details", flattenTransferServerEndpointDetails(resp.Server.EndpointDetails)) diff --git a/aws/resource_aws_wafv2_ip_set.go b/aws/resource_aws_wafv2_ip_set.go index 39dd91e64b96..f89ce0a06f10 100644 --- a/aws/resource_aws_wafv2_ip_set.go +++ b/aws/resource_aws_wafv2_ip_set.go @@ -166,11 +166,11 @@ func resourceAwsWafv2IPSetRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error reading WAFv2 IPSet") } - d.Set("name", aws.StringValue(resp.IPSet.Name)) - d.Set("description", aws.StringValue(resp.IPSet.Description)) - d.Set("ip_address_version", aws.StringValue(resp.IPSet.IPAddressVersion)) - d.Set("arn", aws.StringValue(resp.IPSet.ARN)) - d.Set("lock_token", aws.StringValue(resp.LockToken)) + d.Set("name", resp.IPSet.Name) + d.Set("description", resp.IPSet.Description) + d.Set("ip_address_version", resp.IPSet.IPAddressVersion) + d.Set("arn", resp.IPSet.ARN) + d.Set("lock_token", resp.LockToken) if err := d.Set("addresses", flattenStringSet(resp.IPSet.Addresses)); err != nil { return fmt.Errorf("Error setting addresses: %s", err) diff --git a/aws/resource_aws_wafv2_regex_pattern_set.go b/aws/resource_aws_wafv2_regex_pattern_set.go index 2440ecabb9c3..abb8fb7fb639 100644 --- a/aws/resource_aws_wafv2_regex_pattern_set.go +++ b/aws/resource_aws_wafv2_regex_pattern_set.go @@ -142,10 +142,10 @@ func resourceAwsWafv2RegexPatternSetRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("Error getting WAFv2 RegexPatternSet") } - d.Set("name", aws.StringValue(resp.RegexPatternSet.Name)) - d.Set("description", aws.StringValue(resp.RegexPatternSet.Description)) - d.Set("arn", aws.StringValue(resp.RegexPatternSet.ARN)) - d.Set("lock_token", aws.StringValue(resp.LockToken)) + d.Set("name", resp.RegexPatternSet.Name) + d.Set("description", resp.RegexPatternSet.Description) + d.Set("arn", resp.RegexPatternSet.ARN) + d.Set("lock_token", resp.LockToken) if err := d.Set("regular_expression", flattenWafv2RegexPatternSet(resp.RegexPatternSet.RegularExpressionList)); err != nil { return fmt.Errorf("Error setting regular_expression: %s", err) diff --git a/aws/resource_aws_wafv2_rule_group.go b/aws/resource_aws_wafv2_rule_group.go index b523161891a9..95ca54abcf3b 100644 --- a/aws/resource_aws_wafv2_rule_group.go +++ b/aws/resource_aws_wafv2_rule_group.go @@ -185,11 +185,11 @@ func resourceAwsWafv2RuleGroupRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error getting WAFv2 RuleGroup") } - d.Set("name", aws.StringValue(resp.RuleGroup.Name)) - d.Set("capacity", aws.Int64Value(resp.RuleGroup.Capacity)) - d.Set("description", aws.StringValue(resp.RuleGroup.Description)) - d.Set("arn", aws.StringValue(resp.RuleGroup.ARN)) - d.Set("lock_token", aws.StringValue(resp.LockToken)) + d.Set("name", resp.RuleGroup.Name) + d.Set("capacity", resp.RuleGroup.Capacity) + d.Set("description", resp.RuleGroup.Description) + d.Set("arn", resp.RuleGroup.ARN) + d.Set("lock_token", resp.LockToken) if err := d.Set("rule", flattenWafv2Rules(resp.RuleGroup.Rules)); err != nil { return fmt.Errorf("Error setting rule: %s", err) diff --git a/aws/resource_aws_wafv2_web_acl.go b/aws/resource_aws_wafv2_web_acl.go index aa000a37e477..7c41381663d9 100644 --- a/aws/resource_aws_wafv2_web_acl.go +++ b/aws/resource_aws_wafv2_web_acl.go @@ -212,11 +212,11 @@ func resourceAwsWafv2WebACLRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("Error getting WAFv2 WebACL") } - d.Set("name", aws.StringValue(resp.WebACL.Name)) - d.Set("capacity", aws.Int64Value(resp.WebACL.Capacity)) - d.Set("description", aws.StringValue(resp.WebACL.Description)) - d.Set("arn", aws.StringValue(resp.WebACL.ARN)) - d.Set("lock_token", aws.StringValue(resp.LockToken)) + d.Set("name", resp.WebACL.Name) + d.Set("capacity", resp.WebACL.Capacity) + d.Set("description", resp.WebACL.Description) + d.Set("arn", resp.WebACL.ARN) + d.Set("lock_token", resp.LockToken) if err := d.Set("default_action", flattenWafv2DefaultAction(resp.WebACL.DefaultAction)); err != nil { return fmt.Errorf("Error setting default_action: %w", err) diff --git a/aws/resource_aws_worklink_fleet.go b/aws/resource_aws_worklink_fleet.go index a08d6556111f..be2e04b2fe3f 100644 --- a/aws/resource_aws_worklink_fleet.go +++ b/aws/resource_aws_worklink_fleet.go @@ -173,10 +173,10 @@ func resourceAwsWorkLinkFleetRead(d *schema.ResourceData, meta interface{}) erro } d.Set("arn", d.Id()) - d.Set("name", aws.StringValue(resp.FleetName)) - d.Set("display_name", aws.StringValue(resp.DisplayName)) - d.Set("optimize_for_end_user_location", aws.BoolValue(resp.OptimizeForEndUserLocation)) - d.Set("company_code", aws.StringValue(resp.CompanyCode)) + d.Set("name", resp.FleetName) + d.Set("display_name", resp.DisplayName) + d.Set("optimize_for_end_user_location", resp.OptimizeForEndUserLocation) + d.Set("company_code", resp.CompanyCode) d.Set("created_time", resp.CreatedTime.Format(time.RFC3339)) if resp.LastUpdatedTime != nil { d.Set("last_updated_time", resp.LastUpdatedTime.Format(time.RFC3339)) From f0075a267c9ad636dc0831c17317c6b880877e09 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 31 Mar 2021 16:59:41 -0400 Subject: [PATCH 2/3] fix linter error --- aws/resource_aws_elasticache_cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_elasticache_cluster.go b/aws/resource_aws_elasticache_cluster.go index 3fc8fa3c2f5c..0c45f0e410c1 100644 --- a/aws/resource_aws_elasticache_cluster.go +++ b/aws/resource_aws_elasticache_cluster.go @@ -447,7 +447,7 @@ func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{}) d.Set("configuration_endpoint", aws.String(fmt.Sprintf("%s:%d", aws.StringValue(c.ConfigurationEndpoint.Address), aws.Int64Value(c.ConfigurationEndpoint.Port)))) d.Set("cluster_address", c.ConfigurationEndpoint.Address) } else if len(c.CacheNodes) > 0 { - d.Set("port", c.CacheNodes[0].Endpoint.Port)) + d.Set("port", c.CacheNodes[0].Endpoint.Port) } if c.ReplicationGroupId != nil { From a2759b8f2930914a88d50c9290ae6b5081f2a6c2 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 31 Mar 2021 20:50:49 -0400 Subject: [PATCH 3/3] additional removals --- aws/cloudfront_cache_policy_structure.go | 10 +++++----- aws/resource_aws_acmpca_certificate.go | 4 ++-- ...e_aws_acmpca_certificate_authority_certificate.go | 4 ++-- aws/resource_aws_cloudfront_cache_policy.go | 2 +- aws/resource_aws_cloudfront_origin_request_policy.go | 6 +++--- aws/resource_aws_cloudfront_realtime_log_config.go | 2 +- aws/resource_aws_cloudwatch_query_definition.go | 8 ++++---- aws/resource_aws_fms_policy.go | 12 ++++++------ aws/resource_aws_lb_target_group.go | 2 +- aws/resource_aws_lightsail_instance.go | 2 +- aws/resource_aws_msk_cluster.go | 2 +- aws/resource_aws_ssm_patch_group.go | 2 +- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/aws/cloudfront_cache_policy_structure.go b/aws/cloudfront_cache_policy_structure.go index 7412bb16cd9a..1a8e0b0ffaad 100644 --- a/aws/cloudfront_cache_policy_structure.go +++ b/aws/cloudfront_cache_policy_structure.go @@ -224,10 +224,10 @@ func setParametersConfig(parametersConfig *cloudfront.ParametersInCacheKeyAndFor } func setCloudFrontCachePolicy(d *schema.ResourceData, cachePolicy *cloudfront.CachePolicyConfig) { - d.Set("comment", aws.StringValue(cachePolicy.Comment)) - d.Set("default_ttl", aws.Int64Value(cachePolicy.DefaultTTL)) - d.Set("max_ttl", aws.Int64Value(cachePolicy.MaxTTL)) - d.Set("min_ttl", aws.Int64Value(cachePolicy.MinTTL)) - d.Set("name", aws.StringValue(cachePolicy.Name)) + d.Set("comment", cachePolicy.Comment) + d.Set("default_ttl", cachePolicy.DefaultTTL) + d.Set("max_ttl", cachePolicy.MaxTTL) + d.Set("min_ttl", cachePolicy.MinTTL) + d.Set("name", cachePolicy.Name) d.Set("parameters_in_cache_key_and_forwarded_to_origin", setParametersConfig(cachePolicy.ParametersInCacheKeyAndForwardedToOrigin)) } diff --git a/aws/resource_aws_acmpca_certificate.go b/aws/resource_aws_acmpca_certificate.go index afbcb51f8a3c..457a01b3905f 100644 --- a/aws/resource_aws_acmpca_certificate.go +++ b/aws/resource_aws_acmpca_certificate.go @@ -185,8 +185,8 @@ func resourceAwsAcmpcaCertificateRead(d *schema.ResourceData, meta interface{}) } d.Set("arn", d.Id()) - d.Set("certificate", aws.StringValue(certificateOutput.Certificate)) - d.Set("certificate_chain", aws.StringValue(certificateOutput.CertificateChain)) + d.Set("certificate", certificateOutput.Certificate) + d.Set("certificate_chain", certificateOutput.CertificateChain) return nil } diff --git a/aws/resource_aws_acmpca_certificate_authority_certificate.go b/aws/resource_aws_acmpca_certificate_authority_certificate.go index 9309f8cf6ece..26bfaba4a8ee 100644 --- a/aws/resource_aws_acmpca_certificate_authority_certificate.go +++ b/aws/resource_aws_acmpca_certificate_authority_certificate.go @@ -82,8 +82,8 @@ func resourceAwsAcmpcaCertificateAuthorityCertificateRead(d *schema.ResourceData } d.Set("certificate_authority_arn", d.Id()) - d.Set("certificate", aws.StringValue(output.Certificate)) - d.Set("certificate_chain", aws.StringValue(output.CertificateChain)) + d.Set("certificate", output.Certificate) + d.Set("certificate_chain", output.CertificateChain) return nil } diff --git a/aws/resource_aws_cloudfront_cache_policy.go b/aws/resource_aws_cloudfront_cache_policy.go index 334271f12ece..ca2a3c44f5cc 100644 --- a/aws/resource_aws_cloudfront_cache_policy.go +++ b/aws/resource_aws_cloudfront_cache_policy.go @@ -189,7 +189,7 @@ func resourceAwsCloudFrontCachePolicyRead(d *schema.ResourceData, meta interface if err != nil { return err } - d.Set("etag", aws.StringValue(resp.ETag)) + d.Set("etag", resp.ETag) setCloudFrontCachePolicy(d, resp.CachePolicy.CachePolicyConfig) diff --git a/aws/resource_aws_cloudfront_origin_request_policy.go b/aws/resource_aws_cloudfront_origin_request_policy.go index b04e490b9c30..3893da88c9ef 100644 --- a/aws/resource_aws_cloudfront_origin_request_policy.go +++ b/aws/resource_aws_cloudfront_origin_request_policy.go @@ -162,11 +162,11 @@ func resourceAwsCloudFrontOriginRequestPolicyRead(d *schema.ResourceData, meta i return fmt.Errorf("error reading CloudFront Origin Request Policy (%s): empty response", d.Id()) } - d.Set("etag", aws.StringValue(resp.ETag)) + d.Set("etag", resp.ETag) originRequestPolicy := resp.OriginRequestPolicy.OriginRequestPolicyConfig - d.Set("comment", aws.StringValue(originRequestPolicy.Comment)) - d.Set("name", aws.StringValue(originRequestPolicy.Name)) + d.Set("comment", originRequestPolicy.Comment) + d.Set("name", originRequestPolicy.Name) d.Set("cookies_config", flattenCloudFrontOriginRequestPolicyCookiesConfig(originRequestPolicy.CookiesConfig)) d.Set("headers_config", flattenCloudFrontOriginRequestPolicyHeadersConfig(originRequestPolicy.HeadersConfig)) d.Set("query_strings_config", flattenCloudFrontOriginRequestPolicyQueryStringsConfig(originRequestPolicy.QueryStringsConfig)) diff --git a/aws/resource_aws_cloudfront_realtime_log_config.go b/aws/resource_aws_cloudfront_realtime_log_config.go index 51c4b0a5c3d3..fbcd61da9cc5 100644 --- a/aws/resource_aws_cloudfront_realtime_log_config.go +++ b/aws/resource_aws_cloudfront_realtime_log_config.go @@ -142,7 +142,7 @@ func resourceAwsCloudFrontRealtimeLogConfigRead(d *schema.ResourceData, meta int return fmt.Errorf("error setting fields: %w", err) } d.Set("name", logConfig.Name) - d.Set("sampling_rate", int(aws.Int64Value(logConfig.SamplingRate))) + d.Set("sampling_rate", logConfig.SamplingRate) return nil } diff --git a/aws/resource_aws_cloudwatch_query_definition.go b/aws/resource_aws_cloudwatch_query_definition.go index 2259059bc85f..4df80c908663 100644 --- a/aws/resource_aws_cloudwatch_query_definition.go +++ b/aws/resource_aws_cloudwatch_query_definition.go @@ -64,7 +64,7 @@ func resourceAwsCloudWatchQueryDefinitionCreate(ctx context.Context, d *schema.R } d.SetId(aws.StringValue(r.QueryDefinitionId)) - d.Set("query_definition_id", aws.StringValue(r.QueryDefinitionId)) // TODO: is this needed? + d.Set("query_definition_id", r.QueryDefinitionId) // TODO: is this needed? return resourceAwsCloudWatchQueryDefinitionRead(ctx, d, meta) } @@ -98,9 +98,9 @@ func resourceAwsCloudWatchQueryDefinitionRead(ctx context.Context, d *schema.Res return nil } - d.Set("name", aws.StringValue(result.Name)) - d.Set("query_string", aws.StringValue(result.QueryString)) - d.Set("query_definition_id", aws.StringValue(result.QueryDefinitionId)) + d.Set("name", result.Name) + d.Set("query_string", result.QueryString) + d.Set("query_definition_id", result.QueryDefinitionId) if err := d.Set("log_group_names", aws.StringValueSlice(result.LogGroupNames)); err != nil { return diag.FromErr(fmt.Errorf("error setting log_group_names: %w", err)) } diff --git a/aws/resource_aws_fms_policy.go b/aws/resource_aws_fms_policy.go index 9d704aafed18..3c02908680f0 100644 --- a/aws/resource_aws_fms_policy.go +++ b/aws/resource_aws_fms_policy.go @@ -198,22 +198,22 @@ func resourceAwsFmsPolicyRead(d *schema.ResourceData, meta interface{}) error { } func resourceAwsFmsPolicyFlattenPolicy(d *schema.ResourceData, resp *fms.GetPolicyOutput) error { - d.Set("arn", aws.StringValue(resp.PolicyArn)) + d.Set("arn", resp.PolicyArn) - d.Set("name", aws.StringValue(resp.Policy.PolicyName)) - d.Set("exclude_resource_tags", aws.BoolValue(resp.Policy.ExcludeResourceTags)) + d.Set("name", resp.Policy.PolicyName) + d.Set("exclude_resource_tags", resp.Policy.ExcludeResourceTags) if err := d.Set("exclude_map", flattenFMSPolicyMap(resp.Policy.ExcludeMap)); err != nil { return err } if err := d.Set("include_map", flattenFMSPolicyMap(resp.Policy.IncludeMap)); err != nil { return err } - d.Set("remediation_enabled", aws.BoolValue(resp.Policy.RemediationEnabled)) + d.Set("remediation_enabled", resp.Policy.RemediationEnabled) if err := d.Set("resource_type_list", resp.Policy.ResourceTypeList); err != nil { return err } - d.Set("resource_type", aws.StringValue(resp.Policy.ResourceType)) - d.Set("policy_update_token", aws.StringValue(resp.Policy.PolicyUpdateToken)) + d.Set("resource_type", resp.Policy.ResourceType) + d.Set("policy_update_token", resp.Policy.PolicyUpdateToken) if err := d.Set("resource_tags", flattenFMSResourceTags(resp.Policy.ResourceTags)); err != nil { return err } diff --git a/aws/resource_aws_lb_target_group.go b/aws/resource_aws_lb_target_group.go index 79c78db8c2aa..4998ba5555ae 100644 --- a/aws/resource_aws_lb_target_group.go +++ b/aws/resource_aws_lb_target_group.go @@ -736,7 +736,7 @@ func flattenAwsLbTargetGroupResource(d *schema.ResourceData, meta interface{}, t if err != nil { return fmt.Errorf("error converting preserve_client_ip.enabled to bool: %s", aws.StringValue(attr.Value)) } - d.Set("preserve_client_ip", aws.StringValue(attr.Value)) + d.Set("preserve_client_ip", attr.Value) } } diff --git a/aws/resource_aws_lightsail_instance.go b/aws/resource_aws_lightsail_instance.go index 09e1be108f47..3455a5b7fdf8 100644 --- a/aws/resource_aws_lightsail_instance.go +++ b/aws/resource_aws_lightsail_instance.go @@ -218,7 +218,7 @@ func resourceAwsLightsailInstanceRead(d *schema.ResourceData, meta interface{}) // Deprecated: AWS Go SDK v1.36.25 removed Ipv6Address field if len(i.Ipv6Addresses) > 0 { - d.Set("ipv6_address", aws.StringValue(i.Ipv6Addresses[0])) + d.Set("ipv6_address", i.Ipv6Addresses[0]) } d.Set("ipv6_addresses", aws.StringValueSlice(i.Ipv6Addresses)) diff --git a/aws/resource_aws_msk_cluster.go b/aws/resource_aws_msk_cluster.go index 01587a6c469e..34c9d91f99f4 100644 --- a/aws/resource_aws_msk_cluster.go +++ b/aws/resource_aws_msk_cluster.go @@ -456,7 +456,7 @@ func resourceAwsMskClusterRead(d *schema.ResourceData, meta interface{}) error { cluster := out.ClusterInfo - d.Set("arn", aws.StringValue(cluster.ClusterArn)) + d.Set("arn", cluster.ClusterArn) d.Set("bootstrap_brokers", sortMskClusterEndpoints(aws.StringValue(brokerOut.BootstrapBrokerString))) d.Set("bootstrap_brokers_sasl_scram", sortMskClusterEndpoints(aws.StringValue(brokerOut.BootstrapBrokerStringSaslScram))) d.Set("bootstrap_brokers_tls", sortMskClusterEndpoints(aws.StringValue(brokerOut.BootstrapBrokerStringTls))) diff --git a/aws/resource_aws_ssm_patch_group.go b/aws/resource_aws_ssm_patch_group.go index 2d33eda19092..dda0684c895a 100644 --- a/aws/resource_aws_ssm_patch_group.go +++ b/aws/resource_aws_ssm_patch_group.go @@ -93,7 +93,7 @@ func resourceAwsSsmPatchGroupRead(d *schema.ResourceData, meta interface{}) erro } d.Set("baseline_id", groupBaselineId) - d.Set("patch_group", aws.StringValue(group.PatchGroup)) + d.Set("patch_group", group.PatchGroup) return nil