Skip to content

AWS Lightsail Database (HA) fails to create #26137

Closed
@include

Description

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v1.2.6
on darwin_amd64

Affected Resource(s)

  • aws_lightsail_database

Terraform Configuration Files

resource "aws_lightsail_database" "this" {
  relational_database_name     = "lightsail"
  availability_zone            = "eu-west-1a"
  master_database_name         = "foo"
  master_username              = "bar"
  master_password              = "baz123$$$"
  blueprint_id                 = "mysql_8_0"
  bundle_id                    = "small_ha_1_0"
}

Debug Output

If I change to another instance type without HA, like small_1_0 it deploys correctly. If I change back the bundle_id to small_ha_1_0, it breaks with the following error (see bellow).
`

Panic Output

aws_lightsail_database.this: Creating...
╷
│ Error: InvalidInputException: Sorry, you cannot request a specific availability zone for a High Availability database
│ {
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "7f4db6a6-e936-4236-8055-ae9869e17552"
│   },
│   Code_: "InvalidParams",
│   Message_: "Sorry, you cannot request a specific availability zone for a High Availability database"
│ }
│
│   with aws_lightsail_database.this,
│   on main.tf line 43, in resource "aws_lightsail_database" "this":
│   43: resource "aws_lightsail_database" "this" {
│
╵

Expected Behavior

Being able to create the HA Lightsail Database.

Actual Behavior

Breaks because aws_lightsail_database mandates the presence of availability_zone parameter, which receives a string and can't receive a list to handle more than one AZ.

Steps to Reproduce

  1. terraform apply

Important Factoids

None.

References

None.

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.good first issueCall to action for new contributors looking for a place to start. Smaller or straightforward issues.service/lightsailIssues and PRs that pertain to the lightsail service.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions