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

Terraform plan reports change when there is no change to apply #1730

Closed
sarahhodne opened this Issue Apr 29, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@sarahhodne
Contributor

sarahhodne commented Apr 29, 2015

We have something like this in a Terraform file:

resource "aws_vpn_gateway" "vgw" {
  vpc_id = "${aws_vpc.main.id}"
  tags {
    Name = "vpn-gateway"
  }
}

Every time we run terraform plan, we get a plan that looks like this:

~ aws_vpn_gateway.vgw
    availability_zone: "us-east-1b" => ""

Applying doesn’t actually change anything, but we keep getting that plan. If I add availability_zone = "us-east-1b" to the Terraform file, this step of the plan goes away.

Looks like the differ doesn’t take into account that the availability zone isn’t set in the Terraform file?

@catsby

This comment has been minimized.

Show comment
Hide comment
@catsby

catsby Apr 29, 2015

Member

Hey @henrikhodne – what eversion of Terraform are you using? I can't seem to reproduce this on either the latest v0.4.2 or the current master branch. If you're not on v0.4.2, can you try updating?

Member

catsby commented Apr 29, 2015

Hey @henrikhodne – what eversion of Terraform are you using? I can't seem to reproduce this on either the latest v0.4.2 or the current master branch. If you're not on v0.4.2, can you try updating?

@sarahhodne

This comment has been minimized.

Show comment
Hide comment
@sarahhodne

sarahhodne Apr 29, 2015

Contributor

I was on 0.4.1, but I can reproduce this on 0.4.2 as well.

Contributor

sarahhodne commented Apr 29, 2015

I was on 0.4.1, but I can reproduce this on 0.4.2 as well.

@catsby

This comment has been minimized.

Show comment
Hide comment
@catsby

catsby Apr 29, 2015

Member

Interesting, I'll take another look...

Member

catsby commented Apr 29, 2015

Interesting, I'll take another look...

@catsby

This comment has been minimized.

Show comment
Hide comment
@catsby

catsby Apr 29, 2015

Member

I've managed to reproduce this on v0.4.2, but still can't on master, so I suspect this is "resolved" in the upcoming release

Member

catsby commented Apr 29, 2015

I've managed to reproduce this on v0.4.2, but still can't on master, so I suspect this is "resolved" in the upcoming release

@catsby

This comment has been minimized.

Show comment
Hide comment
@catsby

catsby Apr 29, 2015

Member

I may be totally off but it seems that on line 91 of vpn_gateway.go, vpnGateway.AvailabilityZone has a value when I use us-east-1 (like yourself), but is nil/empty when I use us-west-2 or eu-west-1 region 😦

Member

catsby commented Apr 29, 2015

I may be totally off but it seems that on line 91 of vpn_gateway.go, vpnGateway.AvailabilityZone has a value when I use us-east-1 (like yourself), but is nil/empty when I use us-west-2 or eu-west-1 region 😦

@catsby

This comment has been minimized.

Show comment
Hide comment
@catsby

catsby Apr 29, 2015

Member

@henrikhodne can you tell if the availability zone is even actually important here? The API docs list it, but for regions beyond EAST I'm not seeing it even returned, even with the AWS CLI tool:

$ aws ec2 describe-vpn-gateways --vpn-gateway-ids vgw-eb6cb0f5
--------------------------------------------
|            DescribeVpnGateways           |
+------------------------------------------+
||               VpnGateways              ||
|+-----------+-----------+----------------+|
||   State   |   Type    | VpnGatewayId   ||
|+-----------+-----------+----------------+|
||  available|  ipsec.1  |  vgw-eb6cb0f5  ||
|+-----------+-----------+----------------+|
|||                 Tags                 |||
||+------------+-------------------------+||
|||     Key    |          Value          |||
||+------------+-------------------------+||
|||  Name      |  vpn-gateway            |||
||+------------+-------------------------+||
|||            VpcAttachments            |||
||+---------------+----------------------+||
|||     State     |        VpcId         |||
||+---------------+----------------------+||
|||  attached     |  vpc-74901611        |||
||+---------------+----------------------+||

$ aws ec2 describe-vpn-gateways --vpn-gateway-ids vgw-eb6cb0f5 --output=json
{
    "VpnGateways": [
        {
            "State": "available",
            "Tags": [
                {
                    "Value": "vpn-gateway",
                    "Key": "Name"
                }
            ],
            "Type": "ipsec.1",
            "VpnGatewayId": "vgw-eb6cb0f5",
            "VpcAttachments": [
                {
                    "State": "attached",
                    "VpcId": "vpc-74901611"
                }
            ]
        }
    ]
}

For an EAST vgw:

$ AWS_DEFAULT_REGION=us-east-1 aws ec2 describe-vpn-gateways --vpn-gateway-ids vgw-8f8865e6 --output=json
{
    "VpnGateways": [
        {
            "AvailabilityZone": "us-east-1d",
            "Tags": [
                {
                    "Value": "vpn-gateway",
                    "Key": "Name"
                }
            ],
            "VpcAttachments": [
                {
                    "State": "attached",
                    "VpcId": "vpc-564d6033"
                }
            ],
            "State": "available",
            "VpnGatewayId": "vgw-8f8865e6",
            "Type": "ipsec.1"
        }
    ]
}
Member

catsby commented Apr 29, 2015

@henrikhodne can you tell if the availability zone is even actually important here? The API docs list it, but for regions beyond EAST I'm not seeing it even returned, even with the AWS CLI tool:

$ aws ec2 describe-vpn-gateways --vpn-gateway-ids vgw-eb6cb0f5
--------------------------------------------
|            DescribeVpnGateways           |
+------------------------------------------+
||               VpnGateways              ||
|+-----------+-----------+----------------+|
||   State   |   Type    | VpnGatewayId   ||
|+-----------+-----------+----------------+|
||  available|  ipsec.1  |  vgw-eb6cb0f5  ||
|+-----------+-----------+----------------+|
|||                 Tags                 |||
||+------------+-------------------------+||
|||     Key    |          Value          |||
||+------------+-------------------------+||
|||  Name      |  vpn-gateway            |||
||+------------+-------------------------+||
|||            VpcAttachments            |||
||+---------------+----------------------+||
|||     State     |        VpcId         |||
||+---------------+----------------------+||
|||  attached     |  vpc-74901611        |||
||+---------------+----------------------+||

$ aws ec2 describe-vpn-gateways --vpn-gateway-ids vgw-eb6cb0f5 --output=json
{
    "VpnGateways": [
        {
            "State": "available",
            "Tags": [
                {
                    "Value": "vpn-gateway",
                    "Key": "Name"
                }
            ],
            "Type": "ipsec.1",
            "VpnGatewayId": "vgw-eb6cb0f5",
            "VpcAttachments": [
                {
                    "State": "attached",
                    "VpcId": "vpc-74901611"
                }
            ]
        }
    ]
}

For an EAST vgw:

$ AWS_DEFAULT_REGION=us-east-1 aws ec2 describe-vpn-gateways --vpn-gateway-ids vgw-8f8865e6 --output=json
{
    "VpnGateways": [
        {
            "AvailabilityZone": "us-east-1d",
            "Tags": [
                {
                    "Value": "vpn-gateway",
                    "Key": "Name"
                }
            ],
            "VpcAttachments": [
                {
                    "State": "attached",
                    "VpcId": "vpc-564d6033"
                }
            ],
            "State": "available",
            "VpnGatewayId": "vgw-8f8865e6",
            "Type": "ipsec.1"
        }
    ]
}
@mitchellh

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh Jun 27, 2015

Member

Closing due to lack of response, can't fix without it. Feel free to open a new issue with the data and we'll look back at it. Thanks!

Member

mitchellh commented Jun 27, 2015

Closing due to lack of response, can't fix without it. Feel free to open a new issue with the data and we'll look back at it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment