add initial main file for creating s3 bucket
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
7cc340133f
commit
f923028eb9
|
@ -0,0 +1,46 @@
|
|||
/* DERIVED --------------------------------------*/
|
||||
|
||||
provider "aws" {
|
||||
region = "us-east-1"
|
||||
access_key = "${var.aws_access_key}"
|
||||
secret_key = "${var.aws_secret_key}"
|
||||
}
|
||||
|
||||
//provider "gandi" {
|
||||
// key = "<the API key>"
|
||||
// sharing_id = "<the sharing_id>"
|
||||
//}
|
||||
|
||||
/* DATA -----------------------------------------*/
|
||||
|
||||
//terraform {
|
||||
// backend "s3" {
|
||||
// bucket = "dapps-terraform-state"
|
||||
// key = "infra-dapps"
|
||||
// region = "us-east-2"
|
||||
// encrypt = true
|
||||
// }
|
||||
//}
|
||||
|
||||
/* INVENTORY ------------------------------------*/
|
||||
|
||||
resource "aws_s3_bucket" "tf-state" {
|
||||
bucket = "dapps-terraform-state"
|
||||
acl = "private"
|
||||
|
||||
tags = {
|
||||
Name = "Terraform State Store"
|
||||
}
|
||||
|
||||
policy = "${file("s3policy.json")}"
|
||||
|
||||
versioning {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
lifecycle {
|
||||
prevent_destroy = true
|
||||
}
|
||||
}
|
||||
|
||||
/* RESOURCES ------------------------------------*/
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"AWS": "arn:aws:iam::760668534108:user/terraform-user"
|
||||
},
|
||||
"Action": "s3:*",
|
||||
"Resource": "arn:aws:s3:::dapps-infra-tf-state"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/* REQUIRED -------------------------------------*/
|
||||
|
||||
variable aws_access_key {
|
||||
description = "Access key for the AWS API."
|
||||
}
|
||||
|
||||
variable aws_secret_key {
|
||||
description = "Secret key for the AWS API."
|
||||
}
|
||||
|
||||
/* GENERAL --------------------------------------*/
|
||||
|
||||
variable hosts_domain {
|
||||
description = "Domain for hosts entries."
|
||||
default = "hosts.dap.ps"
|
||||
}
|
||||
|
||||
variable public_domain {
|
||||
description = "Public DNS Domain address"
|
||||
default = "dap.ps"
|
||||
}
|
Loading…
Reference in New Issue