Skip to content

Commit

Permalink
Merge pull request #16671 from hashicorp/td-files-changed-for-semgrep…
Browse files Browse the repository at this point in the history
…-extraneous-wrapping-rule-resources

tech-debt/resources:autofix extraneous value conversion for d.Set() of primitives
  • Loading branch information
anGie44 committed Apr 1, 2021
2 parents 1a598d5 + a2759b8 commit d89359b
Show file tree
Hide file tree
Showing 57 changed files with 172 additions and 175 deletions.
10 changes: 5 additions & 5 deletions aws/cloudfront_cache_policy_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
4 changes: 2 additions & 2 deletions aws/resource_aws_acmpca_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_acmpca_certificate_authority_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
14 changes: 7 additions & 7 deletions aws/resource_aws_appsync_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_appsync_graphql_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_autoscalingplans_scaling_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_cloudfront_cache_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_cloudfront_origin_request_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_cloudfront_realtime_log_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 5 additions & 5 deletions aws/resource_aws_cloudwatch_log_subscription_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
8 changes: 4 additions & 4 deletions aws/resource_aws_cloudwatch_query_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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))
}
Expand Down
8 changes: 4 additions & 4 deletions aws/resource_aws_codepipeline_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_cur_report_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_dax_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_directory_service_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_dx_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_dx_gateway_association_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions aws/resource_aws_ebs_encryption_by_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_ec2_transit_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_ec2_transit_gateway_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_ec2_transit_gateway_vpc_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_elasticache_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_elasticsearch_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,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 {
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_emr_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
12 changes: 6 additions & 6 deletions aws/resource_aws_fms_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading

0 comments on commit d89359b

Please sign in to comment.