github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lightsail/database.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package lightsail 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a Lightsail Database. Amazon Lightsail is a service to provide easy virtual private servers 16 // with custom software already setup. See [What is Amazon Lightsail?](https://lightsail.aws.amazon.com/ls/docs/getting-started/article/what-is-amazon-lightsail) 17 // for more information. 18 // 19 // > **Note:** Lightsail is currently only supported in a limited number of AWS Regions, please see ["Regions and Availability Zones"](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/) for more details 20 // 21 // ## Example Usage 22 // 23 // ### Basic mysql blueprint 24 // 25 // <!--Start PulumiCodeChooser --> 26 // ```go 27 // package main 28 // 29 // import ( 30 // 31 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 32 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 33 // 34 // ) 35 // 36 // func main() { 37 // pulumi.Run(func(ctx *pulumi.Context) error { 38 // _, err := lightsail.NewDatabase(ctx, "test", &lightsail.DatabaseArgs{ 39 // RelationalDatabaseName: pulumi.String("test"), 40 // AvailabilityZone: pulumi.String("us-east-1a"), 41 // MasterDatabaseName: pulumi.String("testdatabasename"), 42 // MasterPassword: pulumi.String("testdatabasepassword"), 43 // MasterUsername: pulumi.String("test"), 44 // BlueprintId: pulumi.String("mysql_8_0"), 45 // BundleId: pulumi.String("micro_1_0"), 46 // }) 47 // if err != nil { 48 // return err 49 // } 50 // return nil 51 // }) 52 // } 53 // 54 // ``` 55 // <!--End PulumiCodeChooser --> 56 // 57 // ### Basic postrgres blueprint 58 // 59 // <!--Start PulumiCodeChooser --> 60 // ```go 61 // package main 62 // 63 // import ( 64 // 65 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 66 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 67 // 68 // ) 69 // 70 // func main() { 71 // pulumi.Run(func(ctx *pulumi.Context) error { 72 // _, err := lightsail.NewDatabase(ctx, "test", &lightsail.DatabaseArgs{ 73 // RelationalDatabaseName: pulumi.String("test"), 74 // AvailabilityZone: pulumi.String("us-east-1a"), 75 // MasterDatabaseName: pulumi.String("testdatabasename"), 76 // MasterPassword: pulumi.String("testdatabasepassword"), 77 // MasterUsername: pulumi.String("test"), 78 // BlueprintId: pulumi.String("postgres_12"), 79 // BundleId: pulumi.String("micro_1_0"), 80 // }) 81 // if err != nil { 82 // return err 83 // } 84 // return nil 85 // }) 86 // } 87 // 88 // ``` 89 // <!--End PulumiCodeChooser --> 90 // 91 // ### Custom backup and maintenance windows 92 // 93 // Below is an example that sets a custom backup and maintenance window. Times are specified in UTC. This example will allow daily backups to take place between 16:00 and 16:30 each day. This example also requires any maintiance tasks (anything that would cause an outage, including changing some attributes) to take place on Tuesdays between 17:00 and 17:30. An action taken against this database that would cause an outage will wait until this time window to make the requested changes. 94 // 95 // <!--Start PulumiCodeChooser --> 96 // ```go 97 // package main 98 // 99 // import ( 100 // 101 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 102 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 103 // 104 // ) 105 // 106 // func main() { 107 // pulumi.Run(func(ctx *pulumi.Context) error { 108 // _, err := lightsail.NewDatabase(ctx, "test", &lightsail.DatabaseArgs{ 109 // RelationalDatabaseName: pulumi.String("test"), 110 // AvailabilityZone: pulumi.String("us-east-1a"), 111 // MasterDatabaseName: pulumi.String("testdatabasename"), 112 // MasterPassword: pulumi.String("testdatabasepassword"), 113 // MasterUsername: pulumi.String("test"), 114 // BlueprintId: pulumi.String("postgres_12"), 115 // BundleId: pulumi.String("micro_1_0"), 116 // PreferredBackupWindow: pulumi.String("16:00-16:30"), 117 // PreferredMaintenanceWindow: pulumi.String("Tue:17:00-Tue:17:30"), 118 // }) 119 // if err != nil { 120 // return err 121 // } 122 // return nil 123 // }) 124 // } 125 // 126 // ``` 127 // <!--End PulumiCodeChooser --> 128 // 129 // ### Final Snapshots 130 // 131 // To enable creating a final snapshot of your database on deletion, use the `finalSnapshotName` argument to provide a name to be used for the snapshot. 132 // 133 // <!--Start PulumiCodeChooser --> 134 // ```go 135 // package main 136 // 137 // import ( 138 // 139 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 140 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 141 // 142 // ) 143 // 144 // func main() { 145 // pulumi.Run(func(ctx *pulumi.Context) error { 146 // _, err := lightsail.NewDatabase(ctx, "test", &lightsail.DatabaseArgs{ 147 // RelationalDatabaseName: pulumi.String("test"), 148 // AvailabilityZone: pulumi.String("us-east-1a"), 149 // MasterDatabaseName: pulumi.String("testdatabasename"), 150 // MasterPassword: pulumi.String("testdatabasepassword"), 151 // MasterUsername: pulumi.String("test"), 152 // BlueprintId: pulumi.String("postgres_12"), 153 // BundleId: pulumi.String("micro_1_0"), 154 // PreferredBackupWindow: pulumi.String("16:00-16:30"), 155 // PreferredMaintenanceWindow: pulumi.String("Tue:17:00-Tue:17:30"), 156 // FinalSnapshotName: pulumi.String("MyFinalSnapshot"), 157 // }) 158 // if err != nil { 159 // return err 160 // } 161 // return nil 162 // }) 163 // } 164 // 165 // ``` 166 // <!--End PulumiCodeChooser --> 167 // 168 // ### Apply Immediately 169 // 170 // To enable applying changes immediately instead of waiting for a maintiance window, use the `applyImmediately` argument. 171 // 172 // <!--Start PulumiCodeChooser --> 173 // ```go 174 // package main 175 // 176 // import ( 177 // 178 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail" 179 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 180 // 181 // ) 182 // 183 // func main() { 184 // pulumi.Run(func(ctx *pulumi.Context) error { 185 // _, err := lightsail.NewDatabase(ctx, "test", &lightsail.DatabaseArgs{ 186 // RelationalDatabaseName: pulumi.String("test"), 187 // AvailabilityZone: pulumi.String("us-east-1a"), 188 // MasterDatabaseName: pulumi.String("testdatabasename"), 189 // MasterPassword: pulumi.String("testdatabasepassword"), 190 // MasterUsername: pulumi.String("test"), 191 // BlueprintId: pulumi.String("postgres_12"), 192 // BundleId: pulumi.String("micro_1_0"), 193 // ApplyImmediately: pulumi.Bool(true), 194 // }) 195 // if err != nil { 196 // return err 197 // } 198 // return nil 199 // }) 200 // } 201 // 202 // ``` 203 // <!--End PulumiCodeChooser --> 204 // 205 // ## Blueprint Ids 206 // 207 // A list of all available Lightsail Blueprints for Relational Databases the [aws lightsail get-relational-database-blueprints](https://docs.aws.amazon.com/cli/latest/reference/lightsail/get-relational-database-blueprints.html) aws cli command. 208 // 209 // ### Examples 210 // 211 // - `mysql80` 212 // - `postgres12` 213 // 214 // ### Prefix 215 // 216 // A Blueprint ID starts with a prefix of the engine type. 217 // 218 // ### Suffix 219 // 220 // A Blueprint ID has a sufix of the engine version. 221 // 222 // ## Bundles 223 // 224 // A list of all available Lightsail Bundles for Relational Databases the [aws lightsail get-relational-database-bundles](https://docs.aws.amazon.com/cli/latest/reference/lightsail/get-relational-database-bundles.html) aws cli command. 225 // 226 // ### Examples 227 // 228 // - `small10` 229 // - `smallHa10` 230 // - `large10` 231 // - `largeHa10` 232 // 233 // ### Prefix 234 // 235 // A Bundle ID starts with one of the below size prefixes: 236 // 237 // - `micro_` 238 // - `small_` 239 // - `medium_` 240 // - `large_` 241 // 242 // ### Infixes (Optional for HA Database) 243 // 244 // A Bundle Id can have the following infix added in order to use the HA option of the selected bundle. 245 // 246 // - `ha_` 247 // 248 // ### Suffix 249 // 250 // A Bundle ID ends with one of the following suffix: `10` 251 // 252 // ## Import 253 // 254 // Using `pulumi import`, import Lightsail Databases using their name. For example: 255 // 256 // ```sh 257 // $ pulumi import aws:lightsail/database:Database foo 'bar' 258 // ``` 259 type Database struct { 260 pulumi.CustomResourceState 261 262 // When true , applies changes immediately. When false , applies changes during the preferred maintenance window. Some changes may cause an outage. 263 ApplyImmediately pulumi.BoolOutput `pulumi:"applyImmediately"` 264 // The ARN of the Lightsail instance (matches `id`). 265 Arn pulumi.StringOutput `pulumi:"arn"` 266 // The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format. 267 AvailabilityZone pulumi.StringOutput `pulumi:"availabilityZone"` 268 // When true, enables automated backup retention for your database. When false, disables automated backup retention for your database. Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database. 269 BackupRetentionEnabled pulumi.BoolPtrOutput `pulumi:"backupRetentionEnabled"` 270 // The blueprint ID for your new database. A blueprint describes the major engine version of a database. You can get a list of database blueprints IDs by using the AWS CLI command: `aws lightsail get-relational-database-blueprints` 271 BlueprintId pulumi.StringOutput `pulumi:"blueprintId"` 272 // The bundle ID for your new database. A bundle describes the performance specifications for your database (see list below). You can get a list of database bundle IDs by using the AWS CLI command: `aws lightsail get-relational-database-bundles`. 273 BundleId pulumi.StringOutput `pulumi:"bundleId"` 274 // The certificate associated with the database. 275 CaCertificateIdentifier pulumi.StringOutput `pulumi:"caCertificateIdentifier"` 276 // The number of vCPUs for the database. 277 CpuCount pulumi.IntOutput `pulumi:"cpuCount"` 278 // The timestamp when the instance was created. 279 CreatedAt pulumi.StringOutput `pulumi:"createdAt"` 280 // The size of the disk for the database. 281 DiskSize pulumi.Float64Output `pulumi:"diskSize"` 282 // The database software (for example, MySQL). 283 Engine pulumi.StringOutput `pulumi:"engine"` 284 // The database engine version (for example, 5.7.23). 285 EngineVersion pulumi.StringOutput `pulumi:"engineVersion"` 286 // The name of the database snapshot created if skip final snapshot is false, which is the default value for that parameter. 287 FinalSnapshotName pulumi.StringPtrOutput `pulumi:"finalSnapshotName"` 288 // The name of the master database created when the Lightsail database resource is created. 289 MasterDatabaseName pulumi.StringOutput `pulumi:"masterDatabaseName"` 290 // The master endpoint fqdn for the database. 291 MasterEndpointAddress pulumi.StringOutput `pulumi:"masterEndpointAddress"` 292 // The master endpoint network port for the database. 293 MasterEndpointPort pulumi.IntOutput `pulumi:"masterEndpointPort"` 294 // The password for the master user of your new database. The password can include any printable ASCII character except "/", """, or "@". 295 MasterPassword pulumi.StringOutput `pulumi:"masterPassword"` 296 // The master user name for your new database. 297 MasterUsername pulumi.StringOutput `pulumi:"masterUsername"` 298 // The daily time range during which automated backups are created for your new database if automated backups are enabled. Must be in the hh24:mi-hh24:mi format. Example: `16:00-16:30`. Specified in Coordinated Universal Time (UTC). 299 PreferredBackupWindow pulumi.StringOutput `pulumi:"preferredBackupWindow"` 300 // The weekly time range during which system maintenance can occur on your new database. Must be in the ddd:hh24:mi-ddd:hh24:mi format. Specified in Coordinated Universal Time (UTC). Example: `Tue:17:00-Tue:17:30` 301 PreferredMaintenanceWindow pulumi.StringOutput `pulumi:"preferredMaintenanceWindow"` 302 // Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database. 303 PubliclyAccessible pulumi.BoolPtrOutput `pulumi:"publiclyAccessible"` 304 // The amount of RAM in GB for the database. 305 RamSize pulumi.Float64Output `pulumi:"ramSize"` 306 // The name to use for your new Lightsail database resource. Names be unique within each AWS Region in your Lightsail account. 307 RelationalDatabaseName pulumi.StringOutput `pulumi:"relationalDatabaseName"` 308 // Describes the secondary Availability Zone of a high availability database. The secondary database is used for failover support of a high availability database. 309 SecondaryAvailabilityZone pulumi.StringOutput `pulumi:"secondaryAvailabilityZone"` 310 // Determines whether a final database snapshot is created before your database is deleted. If true is specified, no database snapshot is created. If false is specified, a database snapshot is created before your database is deleted. You must specify the final relational database snapshot name parameter if the skip final snapshot parameter is false. 311 SkipFinalSnapshot pulumi.BoolPtrOutput `pulumi:"skipFinalSnapshot"` 312 // The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily. 313 SupportCode pulumi.StringOutput `pulumi:"supportCode"` 314 // A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. 315 Tags pulumi.StringMapOutput `pulumi:"tags"` 316 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 317 // 318 // Deprecated: Please use `tags` instead. 319 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 320 } 321 322 // NewDatabase registers a new resource with the given unique name, arguments, and options. 323 func NewDatabase(ctx *pulumi.Context, 324 name string, args *DatabaseArgs, opts ...pulumi.ResourceOption) (*Database, error) { 325 if args == nil { 326 return nil, errors.New("missing one or more required arguments") 327 } 328 329 if args.BlueprintId == nil { 330 return nil, errors.New("invalid value for required argument 'BlueprintId'") 331 } 332 if args.BundleId == nil { 333 return nil, errors.New("invalid value for required argument 'BundleId'") 334 } 335 if args.MasterDatabaseName == nil { 336 return nil, errors.New("invalid value for required argument 'MasterDatabaseName'") 337 } 338 if args.MasterPassword == nil { 339 return nil, errors.New("invalid value for required argument 'MasterPassword'") 340 } 341 if args.MasterUsername == nil { 342 return nil, errors.New("invalid value for required argument 'MasterUsername'") 343 } 344 if args.RelationalDatabaseName == nil { 345 return nil, errors.New("invalid value for required argument 'RelationalDatabaseName'") 346 } 347 if args.MasterPassword != nil { 348 args.MasterPassword = pulumi.ToSecret(args.MasterPassword).(pulumi.StringInput) 349 } 350 secrets := pulumi.AdditionalSecretOutputs([]string{ 351 "masterPassword", 352 }) 353 opts = append(opts, secrets) 354 opts = internal.PkgResourceDefaultOpts(opts) 355 var resource Database 356 err := ctx.RegisterResource("aws:lightsail/database:Database", name, args, &resource, opts...) 357 if err != nil { 358 return nil, err 359 } 360 return &resource, nil 361 } 362 363 // GetDatabase gets an existing Database resource's state with the given name, ID, and optional 364 // state properties that are used to uniquely qualify the lookup (nil if not required). 365 func GetDatabase(ctx *pulumi.Context, 366 name string, id pulumi.IDInput, state *DatabaseState, opts ...pulumi.ResourceOption) (*Database, error) { 367 var resource Database 368 err := ctx.ReadResource("aws:lightsail/database:Database", name, id, state, &resource, opts...) 369 if err != nil { 370 return nil, err 371 } 372 return &resource, nil 373 } 374 375 // Input properties used for looking up and filtering Database resources. 376 type databaseState struct { 377 // When true , applies changes immediately. When false , applies changes during the preferred maintenance window. Some changes may cause an outage. 378 ApplyImmediately *bool `pulumi:"applyImmediately"` 379 // The ARN of the Lightsail instance (matches `id`). 380 Arn *string `pulumi:"arn"` 381 // The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format. 382 AvailabilityZone *string `pulumi:"availabilityZone"` 383 // When true, enables automated backup retention for your database. When false, disables automated backup retention for your database. Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database. 384 BackupRetentionEnabled *bool `pulumi:"backupRetentionEnabled"` 385 // The blueprint ID for your new database. A blueprint describes the major engine version of a database. You can get a list of database blueprints IDs by using the AWS CLI command: `aws lightsail get-relational-database-blueprints` 386 BlueprintId *string `pulumi:"blueprintId"` 387 // The bundle ID for your new database. A bundle describes the performance specifications for your database (see list below). You can get a list of database bundle IDs by using the AWS CLI command: `aws lightsail get-relational-database-bundles`. 388 BundleId *string `pulumi:"bundleId"` 389 // The certificate associated with the database. 390 CaCertificateIdentifier *string `pulumi:"caCertificateIdentifier"` 391 // The number of vCPUs for the database. 392 CpuCount *int `pulumi:"cpuCount"` 393 // The timestamp when the instance was created. 394 CreatedAt *string `pulumi:"createdAt"` 395 // The size of the disk for the database. 396 DiskSize *float64 `pulumi:"diskSize"` 397 // The database software (for example, MySQL). 398 Engine *string `pulumi:"engine"` 399 // The database engine version (for example, 5.7.23). 400 EngineVersion *string `pulumi:"engineVersion"` 401 // The name of the database snapshot created if skip final snapshot is false, which is the default value for that parameter. 402 FinalSnapshotName *string `pulumi:"finalSnapshotName"` 403 // The name of the master database created when the Lightsail database resource is created. 404 MasterDatabaseName *string `pulumi:"masterDatabaseName"` 405 // The master endpoint fqdn for the database. 406 MasterEndpointAddress *string `pulumi:"masterEndpointAddress"` 407 // The master endpoint network port for the database. 408 MasterEndpointPort *int `pulumi:"masterEndpointPort"` 409 // The password for the master user of your new database. The password can include any printable ASCII character except "/", """, or "@". 410 MasterPassword *string `pulumi:"masterPassword"` 411 // The master user name for your new database. 412 MasterUsername *string `pulumi:"masterUsername"` 413 // The daily time range during which automated backups are created for your new database if automated backups are enabled. Must be in the hh24:mi-hh24:mi format. Example: `16:00-16:30`. Specified in Coordinated Universal Time (UTC). 414 PreferredBackupWindow *string `pulumi:"preferredBackupWindow"` 415 // The weekly time range during which system maintenance can occur on your new database. Must be in the ddd:hh24:mi-ddd:hh24:mi format. Specified in Coordinated Universal Time (UTC). Example: `Tue:17:00-Tue:17:30` 416 PreferredMaintenanceWindow *string `pulumi:"preferredMaintenanceWindow"` 417 // Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database. 418 PubliclyAccessible *bool `pulumi:"publiclyAccessible"` 419 // The amount of RAM in GB for the database. 420 RamSize *float64 `pulumi:"ramSize"` 421 // The name to use for your new Lightsail database resource. Names be unique within each AWS Region in your Lightsail account. 422 RelationalDatabaseName *string `pulumi:"relationalDatabaseName"` 423 // Describes the secondary Availability Zone of a high availability database. The secondary database is used for failover support of a high availability database. 424 SecondaryAvailabilityZone *string `pulumi:"secondaryAvailabilityZone"` 425 // Determines whether a final database snapshot is created before your database is deleted. If true is specified, no database snapshot is created. If false is specified, a database snapshot is created before your database is deleted. You must specify the final relational database snapshot name parameter if the skip final snapshot parameter is false. 426 SkipFinalSnapshot *bool `pulumi:"skipFinalSnapshot"` 427 // The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily. 428 SupportCode *string `pulumi:"supportCode"` 429 // A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. 430 Tags map[string]string `pulumi:"tags"` 431 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 432 // 433 // Deprecated: Please use `tags` instead. 434 TagsAll map[string]string `pulumi:"tagsAll"` 435 } 436 437 type DatabaseState struct { 438 // When true , applies changes immediately. When false , applies changes during the preferred maintenance window. Some changes may cause an outage. 439 ApplyImmediately pulumi.BoolPtrInput 440 // The ARN of the Lightsail instance (matches `id`). 441 Arn pulumi.StringPtrInput 442 // The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format. 443 AvailabilityZone pulumi.StringPtrInput 444 // When true, enables automated backup retention for your database. When false, disables automated backup retention for your database. Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database. 445 BackupRetentionEnabled pulumi.BoolPtrInput 446 // The blueprint ID for your new database. A blueprint describes the major engine version of a database. You can get a list of database blueprints IDs by using the AWS CLI command: `aws lightsail get-relational-database-blueprints` 447 BlueprintId pulumi.StringPtrInput 448 // The bundle ID for your new database. A bundle describes the performance specifications for your database (see list below). You can get a list of database bundle IDs by using the AWS CLI command: `aws lightsail get-relational-database-bundles`. 449 BundleId pulumi.StringPtrInput 450 // The certificate associated with the database. 451 CaCertificateIdentifier pulumi.StringPtrInput 452 // The number of vCPUs for the database. 453 CpuCount pulumi.IntPtrInput 454 // The timestamp when the instance was created. 455 CreatedAt pulumi.StringPtrInput 456 // The size of the disk for the database. 457 DiskSize pulumi.Float64PtrInput 458 // The database software (for example, MySQL). 459 Engine pulumi.StringPtrInput 460 // The database engine version (for example, 5.7.23). 461 EngineVersion pulumi.StringPtrInput 462 // The name of the database snapshot created if skip final snapshot is false, which is the default value for that parameter. 463 FinalSnapshotName pulumi.StringPtrInput 464 // The name of the master database created when the Lightsail database resource is created. 465 MasterDatabaseName pulumi.StringPtrInput 466 // The master endpoint fqdn for the database. 467 MasterEndpointAddress pulumi.StringPtrInput 468 // The master endpoint network port for the database. 469 MasterEndpointPort pulumi.IntPtrInput 470 // The password for the master user of your new database. The password can include any printable ASCII character except "/", """, or "@". 471 MasterPassword pulumi.StringPtrInput 472 // The master user name for your new database. 473 MasterUsername pulumi.StringPtrInput 474 // The daily time range during which automated backups are created for your new database if automated backups are enabled. Must be in the hh24:mi-hh24:mi format. Example: `16:00-16:30`. Specified in Coordinated Universal Time (UTC). 475 PreferredBackupWindow pulumi.StringPtrInput 476 // The weekly time range during which system maintenance can occur on your new database. Must be in the ddd:hh24:mi-ddd:hh24:mi format. Specified in Coordinated Universal Time (UTC). Example: `Tue:17:00-Tue:17:30` 477 PreferredMaintenanceWindow pulumi.StringPtrInput 478 // Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database. 479 PubliclyAccessible pulumi.BoolPtrInput 480 // The amount of RAM in GB for the database. 481 RamSize pulumi.Float64PtrInput 482 // The name to use for your new Lightsail database resource. Names be unique within each AWS Region in your Lightsail account. 483 RelationalDatabaseName pulumi.StringPtrInput 484 // Describes the secondary Availability Zone of a high availability database. The secondary database is used for failover support of a high availability database. 485 SecondaryAvailabilityZone pulumi.StringPtrInput 486 // Determines whether a final database snapshot is created before your database is deleted. If true is specified, no database snapshot is created. If false is specified, a database snapshot is created before your database is deleted. You must specify the final relational database snapshot name parameter if the skip final snapshot parameter is false. 487 SkipFinalSnapshot pulumi.BoolPtrInput 488 // The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily. 489 SupportCode pulumi.StringPtrInput 490 // A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. 491 Tags pulumi.StringMapInput 492 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 493 // 494 // Deprecated: Please use `tags` instead. 495 TagsAll pulumi.StringMapInput 496 } 497 498 func (DatabaseState) ElementType() reflect.Type { 499 return reflect.TypeOf((*databaseState)(nil)).Elem() 500 } 501 502 type databaseArgs struct { 503 // When true , applies changes immediately. When false , applies changes during the preferred maintenance window. Some changes may cause an outage. 504 ApplyImmediately *bool `pulumi:"applyImmediately"` 505 // The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format. 506 AvailabilityZone *string `pulumi:"availabilityZone"` 507 // When true, enables automated backup retention for your database. When false, disables automated backup retention for your database. Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database. 508 BackupRetentionEnabled *bool `pulumi:"backupRetentionEnabled"` 509 // The blueprint ID for your new database. A blueprint describes the major engine version of a database. You can get a list of database blueprints IDs by using the AWS CLI command: `aws lightsail get-relational-database-blueprints` 510 BlueprintId string `pulumi:"blueprintId"` 511 // The bundle ID for your new database. A bundle describes the performance specifications for your database (see list below). You can get a list of database bundle IDs by using the AWS CLI command: `aws lightsail get-relational-database-bundles`. 512 BundleId string `pulumi:"bundleId"` 513 // The name of the database snapshot created if skip final snapshot is false, which is the default value for that parameter. 514 FinalSnapshotName *string `pulumi:"finalSnapshotName"` 515 // The name of the master database created when the Lightsail database resource is created. 516 MasterDatabaseName string `pulumi:"masterDatabaseName"` 517 // The password for the master user of your new database. The password can include any printable ASCII character except "/", """, or "@". 518 MasterPassword string `pulumi:"masterPassword"` 519 // The master user name for your new database. 520 MasterUsername string `pulumi:"masterUsername"` 521 // The daily time range during which automated backups are created for your new database if automated backups are enabled. Must be in the hh24:mi-hh24:mi format. Example: `16:00-16:30`. Specified in Coordinated Universal Time (UTC). 522 PreferredBackupWindow *string `pulumi:"preferredBackupWindow"` 523 // The weekly time range during which system maintenance can occur on your new database. Must be in the ddd:hh24:mi-ddd:hh24:mi format. Specified in Coordinated Universal Time (UTC). Example: `Tue:17:00-Tue:17:30` 524 PreferredMaintenanceWindow *string `pulumi:"preferredMaintenanceWindow"` 525 // Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database. 526 PubliclyAccessible *bool `pulumi:"publiclyAccessible"` 527 // The name to use for your new Lightsail database resource. Names be unique within each AWS Region in your Lightsail account. 528 RelationalDatabaseName string `pulumi:"relationalDatabaseName"` 529 // Determines whether a final database snapshot is created before your database is deleted. If true is specified, no database snapshot is created. If false is specified, a database snapshot is created before your database is deleted. You must specify the final relational database snapshot name parameter if the skip final snapshot parameter is false. 530 SkipFinalSnapshot *bool `pulumi:"skipFinalSnapshot"` 531 // A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. 532 Tags map[string]string `pulumi:"tags"` 533 } 534 535 // The set of arguments for constructing a Database resource. 536 type DatabaseArgs struct { 537 // When true , applies changes immediately. When false , applies changes during the preferred maintenance window. Some changes may cause an outage. 538 ApplyImmediately pulumi.BoolPtrInput 539 // The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format. 540 AvailabilityZone pulumi.StringPtrInput 541 // When true, enables automated backup retention for your database. When false, disables automated backup retention for your database. Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database. 542 BackupRetentionEnabled pulumi.BoolPtrInput 543 // The blueprint ID for your new database. A blueprint describes the major engine version of a database. You can get a list of database blueprints IDs by using the AWS CLI command: `aws lightsail get-relational-database-blueprints` 544 BlueprintId pulumi.StringInput 545 // The bundle ID for your new database. A bundle describes the performance specifications for your database (see list below). You can get a list of database bundle IDs by using the AWS CLI command: `aws lightsail get-relational-database-bundles`. 546 BundleId pulumi.StringInput 547 // The name of the database snapshot created if skip final snapshot is false, which is the default value for that parameter. 548 FinalSnapshotName pulumi.StringPtrInput 549 // The name of the master database created when the Lightsail database resource is created. 550 MasterDatabaseName pulumi.StringInput 551 // The password for the master user of your new database. The password can include any printable ASCII character except "/", """, or "@". 552 MasterPassword pulumi.StringInput 553 // The master user name for your new database. 554 MasterUsername pulumi.StringInput 555 // The daily time range during which automated backups are created for your new database if automated backups are enabled. Must be in the hh24:mi-hh24:mi format. Example: `16:00-16:30`. Specified in Coordinated Universal Time (UTC). 556 PreferredBackupWindow pulumi.StringPtrInput 557 // The weekly time range during which system maintenance can occur on your new database. Must be in the ddd:hh24:mi-ddd:hh24:mi format. Specified in Coordinated Universal Time (UTC). Example: `Tue:17:00-Tue:17:30` 558 PreferredMaintenanceWindow pulumi.StringPtrInput 559 // Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database. 560 PubliclyAccessible pulumi.BoolPtrInput 561 // The name to use for your new Lightsail database resource. Names be unique within each AWS Region in your Lightsail account. 562 RelationalDatabaseName pulumi.StringInput 563 // Determines whether a final database snapshot is created before your database is deleted. If true is specified, no database snapshot is created. If false is specified, a database snapshot is created before your database is deleted. You must specify the final relational database snapshot name parameter if the skip final snapshot parameter is false. 564 SkipFinalSnapshot pulumi.BoolPtrInput 565 // A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. 566 Tags pulumi.StringMapInput 567 } 568 569 func (DatabaseArgs) ElementType() reflect.Type { 570 return reflect.TypeOf((*databaseArgs)(nil)).Elem() 571 } 572 573 type DatabaseInput interface { 574 pulumi.Input 575 576 ToDatabaseOutput() DatabaseOutput 577 ToDatabaseOutputWithContext(ctx context.Context) DatabaseOutput 578 } 579 580 func (*Database) ElementType() reflect.Type { 581 return reflect.TypeOf((**Database)(nil)).Elem() 582 } 583 584 func (i *Database) ToDatabaseOutput() DatabaseOutput { 585 return i.ToDatabaseOutputWithContext(context.Background()) 586 } 587 588 func (i *Database) ToDatabaseOutputWithContext(ctx context.Context) DatabaseOutput { 589 return pulumi.ToOutputWithContext(ctx, i).(DatabaseOutput) 590 } 591 592 // DatabaseArrayInput is an input type that accepts DatabaseArray and DatabaseArrayOutput values. 593 // You can construct a concrete instance of `DatabaseArrayInput` via: 594 // 595 // DatabaseArray{ DatabaseArgs{...} } 596 type DatabaseArrayInput interface { 597 pulumi.Input 598 599 ToDatabaseArrayOutput() DatabaseArrayOutput 600 ToDatabaseArrayOutputWithContext(context.Context) DatabaseArrayOutput 601 } 602 603 type DatabaseArray []DatabaseInput 604 605 func (DatabaseArray) ElementType() reflect.Type { 606 return reflect.TypeOf((*[]*Database)(nil)).Elem() 607 } 608 609 func (i DatabaseArray) ToDatabaseArrayOutput() DatabaseArrayOutput { 610 return i.ToDatabaseArrayOutputWithContext(context.Background()) 611 } 612 613 func (i DatabaseArray) ToDatabaseArrayOutputWithContext(ctx context.Context) DatabaseArrayOutput { 614 return pulumi.ToOutputWithContext(ctx, i).(DatabaseArrayOutput) 615 } 616 617 // DatabaseMapInput is an input type that accepts DatabaseMap and DatabaseMapOutput values. 618 // You can construct a concrete instance of `DatabaseMapInput` via: 619 // 620 // DatabaseMap{ "key": DatabaseArgs{...} } 621 type DatabaseMapInput interface { 622 pulumi.Input 623 624 ToDatabaseMapOutput() DatabaseMapOutput 625 ToDatabaseMapOutputWithContext(context.Context) DatabaseMapOutput 626 } 627 628 type DatabaseMap map[string]DatabaseInput 629 630 func (DatabaseMap) ElementType() reflect.Type { 631 return reflect.TypeOf((*map[string]*Database)(nil)).Elem() 632 } 633 634 func (i DatabaseMap) ToDatabaseMapOutput() DatabaseMapOutput { 635 return i.ToDatabaseMapOutputWithContext(context.Background()) 636 } 637 638 func (i DatabaseMap) ToDatabaseMapOutputWithContext(ctx context.Context) DatabaseMapOutput { 639 return pulumi.ToOutputWithContext(ctx, i).(DatabaseMapOutput) 640 } 641 642 type DatabaseOutput struct{ *pulumi.OutputState } 643 644 func (DatabaseOutput) ElementType() reflect.Type { 645 return reflect.TypeOf((**Database)(nil)).Elem() 646 } 647 648 func (o DatabaseOutput) ToDatabaseOutput() DatabaseOutput { 649 return o 650 } 651 652 func (o DatabaseOutput) ToDatabaseOutputWithContext(ctx context.Context) DatabaseOutput { 653 return o 654 } 655 656 // When true , applies changes immediately. When false , applies changes during the preferred maintenance window. Some changes may cause an outage. 657 func (o DatabaseOutput) ApplyImmediately() pulumi.BoolOutput { 658 return o.ApplyT(func(v *Database) pulumi.BoolOutput { return v.ApplyImmediately }).(pulumi.BoolOutput) 659 } 660 661 // The ARN of the Lightsail instance (matches `id`). 662 func (o DatabaseOutput) Arn() pulumi.StringOutput { 663 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 664 } 665 666 // The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format. 667 func (o DatabaseOutput) AvailabilityZone() pulumi.StringOutput { 668 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.AvailabilityZone }).(pulumi.StringOutput) 669 } 670 671 // When true, enables automated backup retention for your database. When false, disables automated backup retention for your database. Disabling backup retention deletes all automated database backups. Before disabling this, you may want to create a snapshot of your database. 672 func (o DatabaseOutput) BackupRetentionEnabled() pulumi.BoolPtrOutput { 673 return o.ApplyT(func(v *Database) pulumi.BoolPtrOutput { return v.BackupRetentionEnabled }).(pulumi.BoolPtrOutput) 674 } 675 676 // The blueprint ID for your new database. A blueprint describes the major engine version of a database. You can get a list of database blueprints IDs by using the AWS CLI command: `aws lightsail get-relational-database-blueprints` 677 func (o DatabaseOutput) BlueprintId() pulumi.StringOutput { 678 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.BlueprintId }).(pulumi.StringOutput) 679 } 680 681 // The bundle ID for your new database. A bundle describes the performance specifications for your database (see list below). You can get a list of database bundle IDs by using the AWS CLI command: `aws lightsail get-relational-database-bundles`. 682 func (o DatabaseOutput) BundleId() pulumi.StringOutput { 683 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.BundleId }).(pulumi.StringOutput) 684 } 685 686 // The certificate associated with the database. 687 func (o DatabaseOutput) CaCertificateIdentifier() pulumi.StringOutput { 688 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.CaCertificateIdentifier }).(pulumi.StringOutput) 689 } 690 691 // The number of vCPUs for the database. 692 func (o DatabaseOutput) CpuCount() pulumi.IntOutput { 693 return o.ApplyT(func(v *Database) pulumi.IntOutput { return v.CpuCount }).(pulumi.IntOutput) 694 } 695 696 // The timestamp when the instance was created. 697 func (o DatabaseOutput) CreatedAt() pulumi.StringOutput { 698 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput) 699 } 700 701 // The size of the disk for the database. 702 func (o DatabaseOutput) DiskSize() pulumi.Float64Output { 703 return o.ApplyT(func(v *Database) pulumi.Float64Output { return v.DiskSize }).(pulumi.Float64Output) 704 } 705 706 // The database software (for example, MySQL). 707 func (o DatabaseOutput) Engine() pulumi.StringOutput { 708 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.Engine }).(pulumi.StringOutput) 709 } 710 711 // The database engine version (for example, 5.7.23). 712 func (o DatabaseOutput) EngineVersion() pulumi.StringOutput { 713 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.EngineVersion }).(pulumi.StringOutput) 714 } 715 716 // The name of the database snapshot created if skip final snapshot is false, which is the default value for that parameter. 717 func (o DatabaseOutput) FinalSnapshotName() pulumi.StringPtrOutput { 718 return o.ApplyT(func(v *Database) pulumi.StringPtrOutput { return v.FinalSnapshotName }).(pulumi.StringPtrOutput) 719 } 720 721 // The name of the master database created when the Lightsail database resource is created. 722 func (o DatabaseOutput) MasterDatabaseName() pulumi.StringOutput { 723 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.MasterDatabaseName }).(pulumi.StringOutput) 724 } 725 726 // The master endpoint fqdn for the database. 727 func (o DatabaseOutput) MasterEndpointAddress() pulumi.StringOutput { 728 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.MasterEndpointAddress }).(pulumi.StringOutput) 729 } 730 731 // The master endpoint network port for the database. 732 func (o DatabaseOutput) MasterEndpointPort() pulumi.IntOutput { 733 return o.ApplyT(func(v *Database) pulumi.IntOutput { return v.MasterEndpointPort }).(pulumi.IntOutput) 734 } 735 736 // The password for the master user of your new database. The password can include any printable ASCII character except "/", """, or "@". 737 func (o DatabaseOutput) MasterPassword() pulumi.StringOutput { 738 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.MasterPassword }).(pulumi.StringOutput) 739 } 740 741 // The master user name for your new database. 742 func (o DatabaseOutput) MasterUsername() pulumi.StringOutput { 743 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.MasterUsername }).(pulumi.StringOutput) 744 } 745 746 // The daily time range during which automated backups are created for your new database if automated backups are enabled. Must be in the hh24:mi-hh24:mi format. Example: `16:00-16:30`. Specified in Coordinated Universal Time (UTC). 747 func (o DatabaseOutput) PreferredBackupWindow() pulumi.StringOutput { 748 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.PreferredBackupWindow }).(pulumi.StringOutput) 749 } 750 751 // The weekly time range during which system maintenance can occur on your new database. Must be in the ddd:hh24:mi-ddd:hh24:mi format. Specified in Coordinated Universal Time (UTC). Example: `Tue:17:00-Tue:17:30` 752 func (o DatabaseOutput) PreferredMaintenanceWindow() pulumi.StringOutput { 753 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.PreferredMaintenanceWindow }).(pulumi.StringOutput) 754 } 755 756 // Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database. 757 func (o DatabaseOutput) PubliclyAccessible() pulumi.BoolPtrOutput { 758 return o.ApplyT(func(v *Database) pulumi.BoolPtrOutput { return v.PubliclyAccessible }).(pulumi.BoolPtrOutput) 759 } 760 761 // The amount of RAM in GB for the database. 762 func (o DatabaseOutput) RamSize() pulumi.Float64Output { 763 return o.ApplyT(func(v *Database) pulumi.Float64Output { return v.RamSize }).(pulumi.Float64Output) 764 } 765 766 // The name to use for your new Lightsail database resource. Names be unique within each AWS Region in your Lightsail account. 767 func (o DatabaseOutput) RelationalDatabaseName() pulumi.StringOutput { 768 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.RelationalDatabaseName }).(pulumi.StringOutput) 769 } 770 771 // Describes the secondary Availability Zone of a high availability database. The secondary database is used for failover support of a high availability database. 772 func (o DatabaseOutput) SecondaryAvailabilityZone() pulumi.StringOutput { 773 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.SecondaryAvailabilityZone }).(pulumi.StringOutput) 774 } 775 776 // Determines whether a final database snapshot is created before your database is deleted. If true is specified, no database snapshot is created. If false is specified, a database snapshot is created before your database is deleted. You must specify the final relational database snapshot name parameter if the skip final snapshot parameter is false. 777 func (o DatabaseOutput) SkipFinalSnapshot() pulumi.BoolPtrOutput { 778 return o.ApplyT(func(v *Database) pulumi.BoolPtrOutput { return v.SkipFinalSnapshot }).(pulumi.BoolPtrOutput) 779 } 780 781 // The support code for the database. Include this code in your email to support when you have questions about a database in Lightsail. This code enables our support team to look up your Lightsail information more easily. 782 func (o DatabaseOutput) SupportCode() pulumi.StringOutput { 783 return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.SupportCode }).(pulumi.StringOutput) 784 } 785 786 // A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. 787 func (o DatabaseOutput) Tags() pulumi.StringMapOutput { 788 return o.ApplyT(func(v *Database) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 789 } 790 791 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 792 // 793 // Deprecated: Please use `tags` instead. 794 func (o DatabaseOutput) TagsAll() pulumi.StringMapOutput { 795 return o.ApplyT(func(v *Database) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 796 } 797 798 type DatabaseArrayOutput struct{ *pulumi.OutputState } 799 800 func (DatabaseArrayOutput) ElementType() reflect.Type { 801 return reflect.TypeOf((*[]*Database)(nil)).Elem() 802 } 803 804 func (o DatabaseArrayOutput) ToDatabaseArrayOutput() DatabaseArrayOutput { 805 return o 806 } 807 808 func (o DatabaseArrayOutput) ToDatabaseArrayOutputWithContext(ctx context.Context) DatabaseArrayOutput { 809 return o 810 } 811 812 func (o DatabaseArrayOutput) Index(i pulumi.IntInput) DatabaseOutput { 813 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Database { 814 return vs[0].([]*Database)[vs[1].(int)] 815 }).(DatabaseOutput) 816 } 817 818 type DatabaseMapOutput struct{ *pulumi.OutputState } 819 820 func (DatabaseMapOutput) ElementType() reflect.Type { 821 return reflect.TypeOf((*map[string]*Database)(nil)).Elem() 822 } 823 824 func (o DatabaseMapOutput) ToDatabaseMapOutput() DatabaseMapOutput { 825 return o 826 } 827 828 func (o DatabaseMapOutput) ToDatabaseMapOutputWithContext(ctx context.Context) DatabaseMapOutput { 829 return o 830 } 831 832 func (o DatabaseMapOutput) MapIndex(k pulumi.StringInput) DatabaseOutput { 833 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Database { 834 return vs[0].(map[string]*Database)[vs[1].(string)] 835 }).(DatabaseOutput) 836 } 837 838 func init() { 839 pulumi.RegisterInputType(reflect.TypeOf((*DatabaseInput)(nil)).Elem(), &Database{}) 840 pulumi.RegisterInputType(reflect.TypeOf((*DatabaseArrayInput)(nil)).Elem(), DatabaseArray{}) 841 pulumi.RegisterInputType(reflect.TypeOf((*DatabaseMapInput)(nil)).Elem(), DatabaseMap{}) 842 pulumi.RegisterOutputType(DatabaseOutput{}) 843 pulumi.RegisterOutputType(DatabaseArrayOutput{}) 844 pulumi.RegisterOutputType(DatabaseMapOutput{}) 845 }