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

resource/aws_ec2_client_vpn_endpoint: Properly set status value into Terraform state #11497

Merged
merged 1 commit into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion aws/resource_aws_ec2_client_vpn_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ func resourceAwsEc2ClientVpnEndpointRead(d *schema.ResourceData, meta interface{
d.Set("server_certificate_arn", result.ClientVpnEndpoints[0].ServerCertificateArn)
d.Set("transport_protocol", result.ClientVpnEndpoints[0].TransportProtocol)
d.Set("dns_name", result.ClientVpnEndpoints[0].DnsName)
d.Set("status", result.ClientVpnEndpoints[0].Status)

if result.ClientVpnEndpoints[0].Status != nil {
d.Set("status", result.ClientVpnEndpoints[0].Status.Code)
}

d.Set("split_tunnel", result.ClientVpnEndpoints[0].SplitTunnel)

err = d.Set("authentication_options", flattenAuthOptsConfig(result.ClientVpnEndpoints[0].AuthenticationOptions))
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_ec2_client_vpn_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func TestAccAwsEc2ClientVpnEndpoint_basic(t *testing.T) {
testAccCheckAwsEc2ClientVpnEndpointExists("aws_ec2_client_vpn_endpoint.test"),
resource.TestCheckResourceAttr("aws_ec2_client_vpn_endpoint.test", "authentication_options.#", "1"),
resource.TestCheckResourceAttr("aws_ec2_client_vpn_endpoint.test", "authentication_options.0.type", "certificate-authentication"),
resource.TestCheckResourceAttr("aws_ec2_client_vpn_endpoint.test", "status", ec2.ClientVpnEndpointStatusCodePendingAssociate),
),
},

Expand Down