infrastructure/terraform/rclone.tf
Jake Howard 06b9197c5b
All checks were successful
/ terraform (push) Successful in 31s
/ ansible (push) Successful in 1m47s
Sync terraform state to restic
This allows it to be backed up easily
2024-01-09 19:56:06 +00:00

28 lines
592 B
HCL

resource "aws_iam_user" "rclone" {
name = "rclone"
}
resource "aws_iam_user_policy" "read-terraform-state" {
name = "read-terraform-state"
user = aws_iam_user.rclone.name
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadTerraformState",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"${aws_s3_bucket.tfstate.arn}/*",
"${aws_s3_bucket.tfstate.arn}"
]
}
]
}
EOF
}