Skip to content

Commit 753804b

Browse files
authored
allow to force destroy s3 bucket (#14)
1 parent a63df8c commit 753804b

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

modules/datastore/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ To read more, see [the Metaflow docs](https://docs.metaflow.org/metaflow-on-aws/
2222
| <a name="input_db_instance_type"></a> [db\_instance\_type](#input\_db\_instance\_type) | RDS instance type to launch for PostgresQL database. | `string` | `"db.t2.small"` | no |
2323
| <a name="input_db_name"></a> [db\_name](#input\_db\_name) | Name of PostgresQL database for Metaflow service. | `string` | `"metaflow"` | no |
2424
| <a name="input_db_username"></a> [db\_username](#input\_db\_username) | PostgresQL username; defaults to 'metaflow' | `string` | `"metaflow"` | no |
25+
| <a name="input_force_destroy_s3_bucket"></a> [force\_destroy\_s3\_bucket](#input\_force\_destroy\_s3\_bucket) | Empty S3 bucket before destroying via terraform destroy | `bool` | `false` | no |
2526
| <a name="input_metadata_service_security_group_id"></a> [metadata\_service\_security\_group\_id](#input\_metadata\_service\_security\_group\_id) | The security group ID used by the MetaData service. We'll grant this access to our DB. | `string` | n/a | yes |
2627
| <a name="input_metaflow_vpc_id"></a> [metaflow\_vpc\_id](#input\_metaflow\_vpc\_id) | ID of the Metaflow VPC this SageMaker notebook instance is to be deployed in | `string` | n/a | yes |
2728
| <a name="input_resource_prefix"></a> [resource\_prefix](#input\_resource\_prefix) | Prefix given to all AWS resources to differentiate between applications | `string` | n/a | yes |

modules/datastore/s3.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
resource "aws_s3_bucket" "this" {
22
bucket = local.s3_bucket_name
33
acl = "private"
4+
force_destroy = var.force_destroy_s3_bucket
45
server_side_encryption_configuration {
56
rule {
67
apply_server_side_encryption_by_default {

modules/datastore/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ variable "db_name" {
1010
default = "metaflow"
1111
}
1212

13+
variable "force_destroy_s3_bucket" {
14+
type = bool
15+
description = "Empty S3 bucket before destroying via terraform destroy"
16+
default = false
17+
}
1318
variable "db_username" {
1419
type = string
1520
description = "PostgresQL username; defaults to 'metaflow'"

0 commit comments

Comments
 (0)