Commit 03ce8807 authored by Malf's avatar Malf
Browse files

Merge branch 'add-s3-remote-state' into 'master'

Add S3 bucket for terraform remote state

See merge request !3
parents 5b938ee4 59527e77
.terraform*
terraform.tfstate
terraform.tfstate*
terraform {
backend "s3" {
bucket = "tf-remote-state20220115042958249700000002"
key = "bootstrap"
region = "eu-west-1"
}
required_providers {
aws = {
source = "hashicorp/aws"
......@@ -11,3 +16,8 @@ terraform {
provider "aws" {
region = "eu-west-1"
}
provider "aws" {
region = "eu-central-1"
alias = "replica"
}
module "remote_state" {
source = "nozaq/remote-state-s3-backend/aws"
providers = {
aws = aws
aws.replica = aws.replica
}
}
resource "aws_iam_user_policy_attachment" "remote_state_access_n3ph" {
user = module.iam_user_n3ph.iam_user_name
policy_arn = module.remote_state.terraform_iam_policy.arn
}
data "aws_iam_user" "terraform" {
user_name = "terraform-malfn3ph"
}
resource "aws_iam_user_policy_attachment" "remote_state_access_terraform" {
user = data.aws_iam_user.terraform.user_name
policy_arn = module.remote_state.terraform_iam_policy.arn
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment