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

[Bug]: Error: setting forward_path_component on aws_ec2_network_insights_analysis #28683

Closed
it-happens-nl opened this issue Jan 5, 2023 · 4 comments · Fixed by #33168
Closed
Labels
bug Addresses a defect in current functionality. service/vpc Issues and PRs that pertain to the vpc service.
Milestone

Comments

@it-happens-nl
Copy link

Terraform Core Version

v1.0.1, v1.3.7

AWS Provider Version

v4.48.0

Affected Resource(s)

aws_ec2_network_insights_analysis

Expected Behavior

After setting "aws_ec2_network_insights_path" "source" to "aws_network_interface.arn" instead of "aws_network_interface.id" (to allow for cross-account connectivity testing) a path analysis should be triggered without errors as with "source" set to "aws_network_interface.id"

Actual Behavior

Terraform plan/apply fail with an error after setting "aws_ec2_network_insights_path" "source" to "aws_network_interface.arn". The analysis is created successfully in AWS, but the plan/apply fail because of this error. The error doesn't occur with "aws_ec2_network_insights_path" "source" set to "aws_network_interface.id"

Relevant Error/Panic Output Snippet

Error: setting forward_path_components: Invalid address to set: []string{"forward_path_components", "13", "transit_gateway_route_table_route", "0", "route_orign"}

Terraform Configuration Files

#---------                    Test to egress public                    ---------
resource "aws_ec2_network_insights_path" "egress_path" {
  provider    = aws.local
  source      = aws_network_interface.connectivity_test.arn
  destination = var.egress_connectivity_test_nic_id
  protocol    = "tcp"
}

resource "aws_ec2_network_insights_analysis" "egress_analysis" {
  provider                 = aws.local
  network_insights_path_id = aws_ec2_network_insights_path.egress_path.id
}

Steps to Reproduce

Plan/apply resource to see the error.
Change to:

resource "aws_ec2_network_insights_path" "egress_path" {
  provider    = aws.local
  source      = aws_network_interface.connectivity_test.id
  destination = var.egress_connectivity_test_nic_id
  protocol    = "tcp"
}

to see resource being created without error

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@it-happens-nl it-happens-nl added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jan 5, 2023
@github-actions
Copy link

github-actions bot commented Jan 5, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/vpc Issues and PRs that pertain to the vpc service. label Jan 5, 2023
@it-happens-nl it-happens-nl changed the title [Bug]: [Bug]: Error: setting forward_path_component on aws_ec2_network_insights_analysis Jan 5, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jan 6, 2023
@odg0318
Copy link

odg0318 commented Jul 7, 2023

I am struggling with this issue. I also share my terraform log using TF_LOG=debug. I found http.status_code=200 in response as below but terraform plan failed.

2023-07-07T17:53:51.043+0900 [DEBUG] provider.terraform-provider-aws_v5.7.0_x5: HTTP Request Sent: aws.sdk=aws-sdk-go aws.service=EC2 http.flavor=1.1 http.request.body="Acti******************************yses&Netw*****************isId.1=nia-0572*********c609&Version=2016-11-15
" http.request.header.x_amz_security_token=***** tf_resource_type=aws_ec2_network_insights_analysis tf_provider_addr=registry.terraform.io/hashicorp/aws @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.32/logger.go:96 @module=aws http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA************TJDD********7/ap-northeast-2/ec2/aws4_request, Sign*************tent-length;content-type;host;x-amz-date;x-amz-security-token, Signature=*****" http.url=https://ec2.ap-northeast-2.amazonaws.com/ net.peer.name=ec2.ap-northeast-2.amazonaws.com tf_mux_provider=*schema.GRPCProviderServer tf_req_id=6d3ec2bd-a09d-4b2d-c022-af9a744d7576 aws.operation=DescribeNetworkInsightsAnalyses http.method=POST http.request.header.content_type="application/x-www-form-urlencoded; charset=utf-8" aws.region=ap-northeast-2 http.request.header.x_amz_date=20230707T085351Z http.request_content_length=107 http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.2.9 (+https://www.terraform.io) terraform-provider-aws/5.7.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.44.297 (go1.20.5; darwin; arm64)" tf_rpc=ReadResource timestamp=2023-07-07T17:53:51.043+0900
2023-07-07T17:53:51.109+0900 [DEBUG] provider.terraform-provider-aws_v5.7.0_x5: HTTP Response Received: @module=aws aws.operation=DescribeNetworkInsightsAnalyses aws.service=EC2 http.response.header.cache_control="no-cache, no-store" tf_mux_provider=*schema.GRPCProviderServer tf_req_id=3730fc57-61e5-9073-b9f6-bb492c912a3a aws.sdk=aws-sdk-go http.response.header.content_type=text/xml;charset=UTF-8 http.response.header.x_amzn_requestid=615d504a-23f6-47c8-8a34-2a0ad83f6751 http.response.header.date="Fri, 07 Jul 2023 08:53:50 GMT" http.response.header.server=AmazonEC2 http.response.header.vary=accept-encoding http.status_code=200 tf_rpc=ReadResource http.response.header.strict_transport_security="max-age=31536000; includeSubDomains" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_resource_type=aws_ec2_network_insights_analysis @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.32/logger.go:144 aws.region=ap-northeast-2 http.duration=82 http.response.body="<?xml version="1.0" encoding="UTF-8"?>
<Desc*******************************onse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>615d504a-23f6-47c8-8a34-2a0ad83f6751</requestId>
    <netw******************sSet>
        <item>
            <forw***************tSet>
                <item>
                    <addi************Set/>
                    <attachedTo>
                        <arn>arn:aws:ec2:ap-northeast-2:842134318810:transit-gateway/tgw-0844*********c3e7</arn>
                        <id>tgw-0844*********c3e7</id>
                        <name>tgw-tmapcore-seoul-65412</name>
                    </attachedTo>
                    <component>
                        <arn>arn:aws:ec2:ap-northeast-2:624347164499:transit-gateway-attachment/tgw-attach-074c*********f55c</arn>
                        <id>tgw-attach-074c*********f55c</id>
                        <name>vpc/tmobi/tmap-mdp/mdp-prd</name>
                    </component>
                    <explanationSet/>
                    <outboundHeader>
                        <dest*************sSet>
                            <item>100.64.22.128/27</item>
                        </des**************sSet>
                        <dest***************eSet>
                            <item>
                                <from>0</from>
                                <to>65535</to>
                            </item>
                        </des****************eSet>
                        <protocol>6</protocol>
                        <sour********sSet>
                            <item>0.0.0.0/0</item>
                        </sou*********sSet>
                        <sour**********eSet>
                            <item>
                                <from>0</from>
                                <to>65535</to>
                            </item>
                        </sou***********eSet>
                    </outboundHeader>
                    <sequenceNumber>1</sequenceNumber>
                    <transitGateway>
                        <arn>arn:aws:ec2:ap-northeast-2:842134318810:transit-gateway/tgw-0844*********c3e7</arn>
                        <id>tgw-0844*********c3e7</id>
                        <name>tgw-tmapcore-seoul-65412</name>
                    </transitGateway>
                </item>
                <item>
                    <addi************Set/>
                    <component>
                        <arn>arn:aws:ec2:ap-northeast-2:842134318810:transit-gateway-route-table/tgw-rtb-0a75*********2d30</arn>
                        <id>tgw-rtb-0a75*********2d30</id>
                        <name>tgw-rtb-prdstg</name>
                    </component>
                    <explanationSet/>
                    <sequenceNumber>2</sequenceNumber>
                    <transitGateway>
                        <arn>arn:aws:ec2:ap-northeast-2:842134318810:transit-gateway/tgw-0844*********c3e7</arn>
                        <id>tgw-0844*********c3e7</id>
                        <name>tgw-tmapcore-seoul-65412</name>
                    </transitGateway>
                    <tran*********************oute>
                        <attachmentId>tgw-attach-0f07*********aaa7</attachmentId>
                        <destinationCidr>100.64.22.128/27</des********Cidr>
                        <resourceId>vpc-03d2*********85d8</resourceId>
                        <resourceType>vpc</resourceType>
                        <routeOrigin>propagated</routeOrigin>
                        <state>active</state>
                    </tra**********************oute>
                </item>
                <item>
                    <addi***********lSet>
                        <item>
                            <addi************Type>UNIDIRECTIONAL_PATH_ANALYSIS_ONLY</add*************Type>
                        </item>
                    </add************lSet>
                    <attachedTo>
                        <arn>arn:aws:ec2:ap-northeast-2:842134318810:transit-gateway/tgw-0844*********c3e7</arn>
                        <id>tgw-0844*********c3e7</id>
                        <name>tgw-tmapcore-seoul-65412</name>
[truncated...]" timestamp=2023-07-07T17:53:51.108+0900
2023-07-07T17:53:51.109+0900 [ERROR] provider.terraform-provider-aws_v5.7.0_x5: [ERROR] setting state: Invalid address to set: []string{"forward_path_components", "1", "transit_gateway_route_table_route", "0", "route_orign"}
2023-07-07T17:53:51.109+0900 [ERROR] provider.terraform-provider-aws_v5.7.0_x5: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.17.0/tfprotov5/internal/diag/diagnostics.go:58 tf_proto_version=5.3 @module=sdk.proto diagnostic_detail= diagnostic_severity=ERROR diagnostic_summary="setting forward_path_components: Invalid address to set: []string{"forward_path_components", "1", "transit_gateway_route_table_route", "0", "route_orign"}" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=3730fc57-61e5-9073-b9f6-bb492c912a3a tf_resource_type=aws_ec2_network_insights_analysis tf_rpc=ReadResource timestamp=2023-07-07T17:53:51.109+0900

@github-actions
Copy link

This functionality has been released in v5.14.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/vpc Issues and PRs that pertain to the vpc service.
Projects
None yet
3 participants