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]: Message: "$.network-function-groups: null found, array expected" even when there is a network function group defined #38255

Open
sameesin opened this issue Jul 4, 2024 · 1 comment
Labels
bug Addresses a defect in current functionality. service/networkmanager Issues and PRs that pertain to the networkmanager service.

Comments

@sameesin
Copy link

sameesin commented Jul 4, 2024

Terraform Core Version

1.9.1

AWS Provider Version

5.57.0

Affected Resource(s)

data source - "aws_networkmanager_core_network_policy_document"

data "aws_networkmanager_core_network_policy_document" "policy1" {
  core_network_configuration {
    asn_ranges = ["65022-65534"]

    edge_locations {
      location = "ap-south-1"
    }
  }

  segments {
    name = "segment1"
    require_attachment_acceptance = false
  }

  network_function_groups {
    name = "ftdgroup"
    require_attachment_acceptance = false
  }
}

Expected Behavior

The core network should get created but the code fails with an error stating incorrect policy

Actual Behavior

{
│ RespMetadata: {
│ StatusCode: 400,
│ RequestID: "<>"
│ },
│ Errors: [{
│ ErrorCode: "TYPE_MISMATCH",
│ Message: "$.network-function-groups: null found, array expected",
│ Path: "$.network-function-groups"
│ }],
│ Message_: "Incorrect policy."
│ }

Relevant Error/Panic Output Snippet

{
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "<>"
│   },
│   Errors: [{
│       ErrorCode: "TYPE_MISMATCH",
│       Message: "$.network-function-groups: null found, array expected",
│       Path: "$.network-function-groups"
│     }],
│   Message_: "Incorrect policy."
│ }

Terraform Configuration Files

resource "aws_networkmanager_global_network" "cloudwan-automation-test" {
  description = "cloudwan-automation-test"
}

data "aws_networkmanager_core_network_policy_document" "policy1" {
  core_network_configuration {
    asn_ranges = ["65022-65534"]

    edge_locations {
      location = "ap-south-1"
    }
  }

  segments {
    name = "segment1"
    require_attachment_acceptance = false
  }

  network_function_groups {
    name = "ftdgroup"
    require_attachment_acceptance = false
  }
}

resource "aws_networkmanager_core_network" "core_network" {
  global_network_id = aws_networkmanager_global_network.cloudwan-automation-test.id
  create_base_policy = true
}

resource "aws_networkmanager_core_network_policy_attachment" "policy_attachment" {
  core_network_id = aws_networkmanager_core_network.core_network.id
  policy_document = data.aws_networkmanager_core_network_policy_document.policy1.json
}

Steps to Reproduce

terraform init
terraform plan --out t
terraform apply t

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

@sameesin sameesin added the bug Addresses a defect in current functionality. label Jul 4, 2024
Copy link

github-actions bot commented Jul 4, 2024

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/networkmanager Issues and PRs that pertain to the networkmanager service. label Jul 4, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 4, 2024
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/networkmanager Issues and PRs that pertain to the networkmanager service.
Projects
None yet
Development

No branches or pull requests

2 participants