Skip to content

sql: add replication_lag_max_seconds to google_sql_database_instance - #18572

Open
KyriosGN0 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
KyriosGN0:sql-replication-lag-max-seconds
Open

sql: add replication_lag_max_seconds to google_sql_database_instance#18572
KyriosGN0 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
KyriosGN0:sql-replication-lag-max-seconds

Conversation

@KyriosGN0

Copy link
Copy Markdown
Contributor

What

Adds replication_lag_max_seconds to the settings block of google_sql_database_instance, wiring the existing Cloud SQL Admin API field Settings.replicationLagMaxSeconds.

  • Schema: TypeInt, optional/computed, validation.IntAtLeast(0).
  • Expand/flatten added to expandSqlDatabaseInstanceSettings / flattenSettings.
  • Docs bullet + acceptance test TestAccSqlDatabaseInstance_replicationLagMaxSeconds.

Why

The field is GA in the Cloud SQL Admin API (present in both v1 and v1beta4) but was not exposed by the provider. It controls automatic read-replica recreation once replication lag exceeds the threshold (0 disables the check), so users relying on replica-freshness could not manage it declaratively.

No dependency bump: google.golang.org/api already vendors Settings.ReplicationLagMaxSeconds.

sql: added `replication_lag_max_seconds` to `google_sql_database_instance`

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 8, 2026
@google-cla

google-cla Bot commented Aug 8, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@c2thorn, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions
github-actions Bot requested a review from c2thorn August 8, 2026 06:50
@KyriosGN0
KyriosGN0 force-pushed the sql-replication-lag-max-seconds branch from 44ce94c to 966c5d4 Compare August 8, 2026 06:56
Exposes settings.replicationLagMaxSeconds (GA in the Cloud SQL Admin API)
on google_sql_database_instance. Controls read-replica recreation after
sustained replication lag; 0 disables the check.

Signed-off-by: AvivGuiser <avivguiser@gmail.com>
@KyriosGN0
KyriosGN0 force-pushed the sql-replication-lag-max-seconds branch from 966c5d4 to 4929f32 Compare August 8, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants