Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/aws_launch_template: some more fixes #4367

Merged
merged 1 commit into from
May 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws/resource_aws_launch_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ func readNetworkInterfacesFromConfig(ni map[string]interface{}) *ec2.LaunchTempl
networkInterface.Description = aws.String(v)
}

if v, ok := ni["device_index"].(int); ok && v != 0 {
if v, ok := ni["device_index"].(int); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please switch to just this change so we can close #4475 for now?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not suffice. I had the resource created without this change, then changed the code, then did terraform apply again. Terraform wasn't going to update/recreate the resource, I had to destroy it manually.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it automatically assign device_index 0? I believe that's the behavior when its not supplied (auto incrementing from there).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was missing completely. DescribeLaunchTemplateVersions returned:

"NetworkInterfaces": [
    {
        "AssociatePublicIpAddress": false,
        "DeleteOnTermination": false,
        "Ipv6AddressCount": 0,
        "SecondaryPrivateIpAddressCount": 0,
        "SubnetId": "subnet-xxxxxxxx"
    }
],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bflad Done, sorry about the delay. I haven't had time to check back on this.

networkInterface.DeviceIndex = aws.Int64(int64(v))
}

Expand Down