Astra CDC and Streaming have been added as of version 2.1.0!
As of version 2.1.1, the format for access_lists Resources is chnaging from:
resource "astra_access_list" "example" {
database_id = "a6bc9c26-e7ce-424f-84c7-0a00afb12588"
enabled = true
addresses {
request {
address = "0.0.0.1/0"
enabled = true
}
request {
address = "0.0.0.2/0"
enabled = true
}
request {
address = "0.0.0.3/0"
enabled = true
}
}
}
to:
resource "astra_access_list" "example" {
database_id = "a6bc9c26-e7ce-424f-84c7-0a00afb12588"
enabled = true
addresses {
address = "0.0.0.1/0"
enabled = true
}
addresses {
address = "0.0.0.2/0"
enabled = true
}
addresses {
address = "0.0.0.3/0"
enabled = true
}
}
Also, the access_list data source format is changing to match more closely the changes made to the resource.
The Multi-Region support feature has changed the Terraform resource structure for Databases.
Specifically, the region
field has been renamed to regions
, and is now an array of strings,
as opposed to a single string. When updating the plugin from 1.x to 2.x, you will have to
perform a manual Terraform state migration in order to keep existing databases under Terraform
plugin management.
Please follow the below steps to migrate your configurations:
For each Datatbase under Terraform management:
- Obtain the database id (ex.
b3107622-429d-45ab-a6da-0252cb091c86
) - Obtain the Terraform resource name for the database (ex.
my_db
, from the resource line in your Terraform.tf
file) - Remove the database from the Terraform state
terraform state rm astra_database.my_db
- Edit your Terraform resource file and convert the
region
field toregions
, and the value from a string to an array
region = "us-east1"
to
regions = ["us-east1"]
- Import the database back into the Terraform state
terraform import astra_database.my_db b3107622-429d-45ab-a6da-0252cb091c86
- To verify, execute
terraform show
which should show that the deployed region
is now a regions
attribute with a list of a single string.
If you define any external Astra Database Data Sources, you will need to update the definitions for them as well. The same change made in the Resource schema has been made in the Data Source schema. However, for Data Sources, you only need to remove the definition, apply, then re-add the definition and apply again.
- Comment out (or remove) any
data
definitions for Astra databases in your Terraform files.
#data "astra_database" "my_ext_db" {
# database_id = "b3107622-429d-45ab-a6da-0252cb091c86"
#}
- Apply the change
terraform apply
- Re-add the
data
definition.
data "astra_database" "my_ext_db" {
database_id = "b3107622-429d-45ab-a6da-0252cb091c86"
}
- Apply the change
terraform apply
As of version 2.0.0, the Astra provider now supports deploying to multiple regions. This can be done in a
single Terraform apply (with all regions specified in the regions
array when creating your Astra database),
or with an incremental approach (by creating your database with 1 region in the array and then adding new
regions one by one). However, there are a few caveats:
Currently, there is a bug in Astra that doesn't allow for a database to be terminated if the database has
more than one datacenter in multiple regions. If you try to remove a database that has multiple regions, it
may get stuck in the MAINTENANCE
or TERMINATING
states. To avoid this, you should apply changes to your
database so that it only has a single region and is ACTIVE
before attempting to terminate the database.
The first region defined in your database regions
definition will be the region that the database is
initially created in. While you can add multiple regions, you can NOT remove the initial region, even if
your database is successfully deployed to another region. If you no longer want your database to be deployed
to this initial region, you must delete the database and recreate it in your other desired region(s). This
is a limitation of Astra currently, and the Terraform provider does not prevent you from trying to do this.
The provider allows adding and/or terminating multiple regions in a single Terraform apply action. However, the implementation is such that all regions to be added are handled before any regions to be terminated are handled. Additionally, all adds and terminates are done one at a time (current Astra restriction). Each of these actions can take some time, so it is not recommended to attempt to add and delete many regions at the same time.