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

aws_rds_global_cluster: Add endpoint attribute for DB writer endpoint #39960

Merged
merged 8 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/39960.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_rds_global_cluster: Add `endpoint` argument to point to the writer DB instance in the current primary cluster
```
5 changes: 5 additions & 0 deletions internal/service/rds/global_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func resourceGlobalCluster() *schema.Resource {
Optional: true,
Default: false,
},
names.AttrEndpoint: {
Type: schema.TypeString,
Computed: true,
},
names.AttrEngine: {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -210,6 +214,7 @@ func resourceGlobalClusterRead(ctx context.Context, d *schema.ResourceData, meta
d.Set(names.AttrARN, globalCluster.GlobalClusterArn)
d.Set(names.AttrDatabaseName, globalCluster.DatabaseName)
d.Set(names.AttrDeletionProtection, globalCluster.DeletionProtection)
d.Set(names.AttrEndpoint, globalCluster.Endpoint)
d.Set(names.AttrEngine, globalCluster.Engine)
d.Set("engine_lifecycle_support", globalCluster.EngineLifecycleSupport)
d.Set("global_cluster_identifier", globalCluster.GlobalClusterIdentifier)
Expand Down
1 change: 1 addition & 0 deletions internal/service/rds/global_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func TestAccRDSGlobalCluster_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "global_cluster_identifier", rName),
resource.TestMatchResourceAttr(resourceName, "global_cluster_resource_id", regexache.MustCompile(`cluster-.+`)),
resource.TestCheckResourceAttr(resourceName, names.AttrStorageEncrypted, acctest.CtFalse),
resource.TestCheckResourceAttrSet(resourceName, names.AttrEndpoint),
),
},
{
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/rds_global_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ This resource supports the following arguments:
This resource exports the following attributes in addition to the arguments above:

* `arn` - RDS Global Cluster Amazon Resource Name (ARN)
* `endpoint` - Writer endpoint for the new global database cluster. This endpoint always points to the writer DB instance in the current primary cluster.
* `global_cluster_members` - Set of objects containing Global Cluster members.
* `db_cluster_arn` - Amazon Resource Name (ARN) of member DB Cluster
* `is_writer` - Whether the member is the primary DB Cluster
Expand Down
Loading