hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.87k stars 9.21k forks source link

[Enhancement]: aws_rds_cluster doesn't expose publicly_accessible #39618

Open colemickens opened 1 month ago

colemickens commented 1 month ago

Description

AWS makes it confusing enough to understand clusters and their public accessibility.

  1. If you don't specify it via the API, it is implicitly determined based on if the VPC has a IG.
  2. The docs say NOTHING about changing the public accessibility of cluster endpoints after creation.
  3. The dashboard just... doesn't show the same option for public access after creation

So:

Ask:

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

colemickens commented 1 month ago

To further elaborate on my confusion, ModifyClusterRequest doesn't let you change PubliclyAvailable, yet I can make the individual under-lying instances public still?

colemickens commented 1 month ago

Actually, much more concerningly, this seems to mean there's no way to preclude public access if you happen to be creating the RDS cluster attached to a VPC that happens to have an IG enabled...

colemickens commented 1 month ago

Oh, the cluster endpoint appears to CNAME to the instance anyway. Why oh why can't AWS just document things like this?

dreid commented 2 weeks ago
  • If you don't specify it via the API, it is implicitly determined based on if the VPC has a IG.

I do not believe the AWS docs are correct here, (if they are then the configuration is more nuanced than the AWS docs say) afaict it is only possible to get a publicly accessible multi-az rds cluster by specifying PubliclyAccessible at create time.

I can confirm that it does not appear to be possible to specify this at modify time, and at least when you have a Multi-AZ/non-aurora cluster it is not possible to directly modify the db instances.