Fixes S3 Deployment
This commit is contained in:
27
terraform.tf
27
terraform.tf
@@ -53,8 +53,8 @@ variable "ssh_public_key_ci_cd" {
|
|||||||
terraform {
|
terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
godaddy = {
|
godaddy = {
|
||||||
source = "n3integration/godaddy"
|
source = "zaneatwork/godaddy"
|
||||||
version = "1.9.1"
|
version = "1.9.10"
|
||||||
}
|
}
|
||||||
aws = {
|
aws = {
|
||||||
source = "hashicorp/aws"
|
source = "hashicorp/aws"
|
||||||
@@ -92,15 +92,32 @@ resource "aws_s3_bucket_public_access_block" "bucket_public_disabled" {
|
|||||||
restrict_public_buckets = true
|
restrict_public_buckets = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_s3_bucket_ownership_controls" "s3_bucket_acl_ownership" {
|
||||||
|
bucket = aws_s3_bucket.default.id
|
||||||
|
rule {
|
||||||
|
object_ownership = "BucketOwnerPreferred"
|
||||||
|
}
|
||||||
|
depends_on = [aws_s3_bucket_public_access_block.bucket_public_disabled]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_s3_bucket_acl" "default" {
|
||||||
|
bucket = aws_s3_bucket.default.id
|
||||||
|
acl = "private"
|
||||||
|
depends_on = [aws_s3_bucket_ownership_controls.s3_bucket_acl_ownership]
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_s3_bucket_policy" "default" {
|
resource "aws_s3_bucket_policy" "default" {
|
||||||
bucket = aws_s3_bucket.default.id
|
bucket = aws_s3_bucket.default.id
|
||||||
|
depends_on = [aws_s3_bucket_public_access_block.bucket_public_disabled]
|
||||||
policy = <<POLICY
|
policy = <<POLICY
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [
|
"Statement": [
|
||||||
{
|
{
|
||||||
"Effect": "Allow",
|
"Effect": "Allow",
|
||||||
"Principal": "*",
|
"Principal": {
|
||||||
|
"AWS": "*"
|
||||||
|
},
|
||||||
"Action": [
|
"Action": [
|
||||||
"s3:PutObject",
|
"s3:PutObject",
|
||||||
"s3:GetObject",
|
"s3:GetObject",
|
||||||
@@ -221,9 +238,11 @@ resource "aws_instance" "worker" {
|
|||||||
|
|
||||||
# DNS
|
# DNS
|
||||||
|
|
||||||
resource "godaddy_domain_record" "gd-runningit" {
|
resource "godaddy_domain_record" "default" {
|
||||||
domain = "hideyoshi.com.br"
|
domain = "hideyoshi.com.br"
|
||||||
|
|
||||||
|
overwrite = false
|
||||||
|
|
||||||
record {
|
record {
|
||||||
name = "staging "
|
name = "staging "
|
||||||
type = "A"
|
type = "A"
|
||||||
|
|||||||
Reference in New Issue
Block a user