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]: Unable to specify only prefix_list_ids under network_access_control in aws_grafana_workspace #30062

Open
dannygoulder opened this issue Mar 16, 2023 · 4 comments
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/grafana Issues and PRs that pertain to the grafana service.

Comments

@dannygoulder
Copy link

Terraform Core Version

1.3.7

AWS Provider Version

4.58.0

Affected Resource(s)

  • aws_grafana_workspace

Expected Behavior

When using the configuration

resource "aws_grafana_workspace" "grafana" {
  ...
  network_access_control {
    prefix_list_ids = ["pl-fedabeef"]
    vpce_ids        = []
  }
}

To add access control to an existing aws_grafana_workspace I expect that the prefix lists get added to the workspace configuration.

Actual Behavior

The plan succeeds, but apply fails, with the following error:
Error: updating Grafana Workspace (g-deadbeef): InvalidParameter: 1 validation error(s) found. - missing required field, UpdateWorkspaceInput.NetworkAccessControl.VpceIds.
with module.local_grafana.aws_grafana_workspace.grafana
on .terraform/modules/local_grafana/main.tf line 1, in resource "aws_grafana_workspace" "grafana":
resource "aws_grafana_workspace" "grafana" {

When using the AWS portal to make the same configuration change, it works correctly. Cloudtrail logs confirm that the vpce_ids is provided to the AWS API as an empty set and the API accepts the configuration.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_grafana_workspace" "grafana" {
  ...
  network_access_control {
    prefix_list_ids = ["pl-fedabeef"]
    vpce_ids        = []
  }
}

Steps to Reproduce

Create a grafana workspace. Create a prefix list with public IP range(s) (e.g. 33.22.11.0/24).
Reconfigure the grafana workspace with the above network_access_control block, specifying the prefix_list_ids and an empty set of vpce_ids (you can provide [] or toset([]) and the same behaviour occurs)
Plan will succeed, but apply will fail.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@dannygoulder dannygoulder added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Mar 16, 2023
@github-actions github-actions bot added the service/grafana Issues and PRs that pertain to the grafana service. label Mar 16, 2023
@github-actions
Copy link

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.

@justinretzolk justinretzolk added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 16, 2023
@zvickery
Copy link

There is a very similar issue with only specifying vpce_ids as well. The empty string within prefix_list_ids is required to have a successful apply. Additionally, the below code causes a spurious diff as well on each subsequent apply.

  network_access_control {
    prefix_list_ids        = [""]
    vpce_ids               = [aws_vpc_endpoint.my-grafana.id]
  }

Subsequent diff:

       ~ network_access_control {
           ~ prefix_list_ids = [
              + "",
             ]
            # (1 unchanged attribute hidden)
        }

@gingersnapz
Copy link

Since it seems AWS has no intention of fixing the bad design, toting "security",, can we default the backend behavior of Terraform to pass the empty string and resolve the diff?

@d4vidin0
Copy link

Is there any update for this issue? Is it possible to get a quick fix as per @gingersnapz suggestion? Thanks

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. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/grafana Issues and PRs that pertain to the grafana service.
Projects
None yet
Development

No branches or pull requests

5 participants