Open totobarbar opened 1 month ago
This comment is added to every new Issue to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! :rocket:
Terraform and AWS Provider Version
Affected Resource(s) or Data Source(s)
aws_vpc_endpoint
Expected Behavior
Hello, I tried to create a policy for a svc endpoint with Terraform. After some searches, it seems to be impossible to perform that. The problem is that Terraform succeed to carry out a plan, so I tried to apply and I got an error:
I wanted to rollback this policy
Actual Behavior
The problem is that when I wanted to rollback, I tested a plan but I got this error:
But there is not more policy on my code... I'm not able to rollback the policy I tried to add previously
Relevant Error/Panic Output
Sample Terraform Configuration
Configuration with Policy
```hcl resource "aws_vpc_endpoint" "my_vpc_endpoint" { service_name = "com.amazonaws.vpce.eu-west-3.vpce-svc-xxxx" vpc_endpoint_type = "Interface" vpc_id = module.my_vpc.vpc_id private_dns_enabled = false subnet_ids = "${module.my_vpc.my_subnets}" policy = jsonencode({ "Version" : "2012-10-17", "Statement" : [ { "Sid" : "DenyIfNotOnVPC", "Effect" : "Deny", "Principal" : { "Type" : "*", "Indentifiers" : ["*"] }, "Resource" : "*", "Condition" : { "StringNotLike" : { "aws:sourceVpc" : "${module.my_vpc.vpc_id}" } } } ]}) security_group_ids = ["${module.my_sg.security_group_id}"] } ```Configuration without Policy (after rollback)
```hcl resource "aws_vpc_endpoint" "my_vpc_endpoint" { service_name = "com.amazonaws.vpce.eu-west-3.vpce-svc-xxxx" vpc_endpoint_type = "Interface" vpc_id = module.my_vpc.vpc_id private_dns_enabled = false subnet_ids = "${module.my_vpc.my_subnets}" security_group_ids = ["${module.my_sg.security_group_id}"] } ```Steps to Reproduce
I have this issue on my development environment, I never tried to create another vpce svc with a policy anywhere else
Debug Logging
n/a
GenAI / LLM Assisted Development
n/a
Important Facts and References
I also tried to remove my vpce from Terraform but I got the same error without file informations:
Would you like to implement a fix?
No