How to start an existing GCP SQL instance?TypeScript
Currently, there's no direct way to start an existing GCP SQL instance using Pulumi as it's not an exposed functionality of the Google Cloud SQL Admin API that Pulumi could leverage.
However, if you need to control the state of a GCP SQL instance, you could potentially manage the
activationPolicysetting of the
gcp.sql.DatabaseInstanceresource in Pulumi, which indirectly affects whether the instance is started or stopped. Here's how you could do it:
activationPolicyparameter can have one of three values:
"ALWAYS": The instance is always up and can accept connections. It consumes resources even if no connections are made and you are billed for the resources.
"NEVER": The instance never starts. This mode is used when the instance should not be running most of the time. In this mode, you are not billed for CPU or storage usage, but IP addresses do have associated costs.
"ON_DEMAND": The instance starts upon receiving requests and stops when not in use. At least one instance per project works in
By changing this value and running
pulumi up, you can control the running state of your SQL instance.
Caution! Please ensure you understand the implications to your billing and application connectivity before changing
For more details about the
activationPolicyand other settings you can control, please refer to Pulumi's GCP SQL DatabaseInstance documentation.