NEW: setup remote state and lock
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
resource "random_integer" "suffix" {
|
||||
min = 1000
|
||||
max = 9999
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket" "state" {
|
||||
bucket = "tfstate-sandbox-hkex-${random_integer.suffix.result}"
|
||||
force_destroy = true
|
||||
|
||||
tags = var.default-tags
|
||||
|
||||
versioning {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
server_side_encryption_configuration {
|
||||
rule {
|
||||
apply_server_side_encryption_by_default {
|
||||
sse_algorithm = "AES256"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_dynamodb_table" "statelock-sandbox-HKEX" {
|
||||
name = "statelock-sandbox-HKEX-${random_integer.suffix.result}"
|
||||
read_capacity = 20
|
||||
write_capacity = 20
|
||||
hash_key = "LockId"
|
||||
|
||||
attribute {
|
||||
name = "LockId"
|
||||
type = "S"
|
||||
}
|
||||
|
||||
tags = var.default-tags
|
||||
}
|
||||
|
||||
output "state_bucket" {
|
||||
value = aws_s3_bucket.state.bucket
|
||||
}
|
||||
|
||||
output "lock_db" {
|
||||
value = aws_dynamodb_table.statelock-sandbox-HKEX.name
|
||||
}
|
||||
Reference in New Issue
Block a user