Skip to content

Commit

Permalink
Use aws.StringValue
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonbondon committed Aug 2, 2021
1 parent 82039aa commit 3c07cf5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -2052,11 +2052,7 @@ func fetchLaunchTemplateAmi(specs []interface{}, conn *ec2.EC2) (string, error)
return "", fmt.Errorf("failed fetching Launch Template AMI ID: %w", err)
}

if ltData.ImageId != nil {
return *ltData.ImageId, nil
}

return "", nil
return aws.StringValue(ltData.ImageId), nil
}

func fetchLaunchTemplateData(specs []interface{}, conn *ec2.EC2) (*ec2.ResponseLaunchTemplateData, error) {
Expand Down Expand Up @@ -2595,9 +2591,7 @@ func buildAwsInstanceOpts(d *schema.ResourceData, meta interface{}) (*awsInstanc
}

if ltData.InstanceMarketOptions != nil && ltData.InstanceMarketOptions.SpotOptions != nil {
if v := ltData.InstanceMarketOptions.SpotOptions.InstanceInterruptionBehavior; v != nil {
interruptionBehavior = *v
}
interruptionBehavior = aws.StringValue(ltData.InstanceMarketOptions.SpotOptions.InstanceInterruptionBehavior)
}
}

Expand Down

0 comments on commit 3c07cf5

Please sign in to comment.