This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
# Automatically load account-level variables | |
account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl")) | |
aws_profile = local.account_vars.locals.aws_profile_name | |
} | |
terraform { | |
extra_arguments "aws_profile" { | |
commands = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: eksctl.io/v1alpha5 | |
kind: ClusterConfig | |
metadata: | |
name: dev | |
region: us-west-1 | |
version: "1.23" | |
#availabilityZones: ["us-west-1a", "us-west-1b"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output "s3_id" { | |
value = aws_s3_bucket.s3-bucket.id | |
description = "The id of S3" | |
} | |
output "s3_arn" { | |
value = aws_s3_bucket.s3-bucket.arn | |
description = "The id of S3" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "name" { | |
type = string | |
description = "name of s3 bucket" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_s3_bucket" "s3-bucket" { | |
bucket = "${var.name}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "example-prod-backend-service" { | |
source = "../../multiport-ecs" | |
environment = "example-prod" | |
accountid = "222222222222" | |
region = "us-east-1" | |
name = "backend" | |
role = "arn:aws:iam::222222222222:role/ecsTaskExecutionRole" | |
target_group_name1 = "backend" | |
target_group_protocol1 = "HTTP" | |
target_group_name2 = "socket" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ecr, task def, and services | |
resource "aws_ecr_repository" "ecr" { | |
name = "${var.environment}-${var.name}" | |
} | |
resource "aws_ecr_lifecycle_policy" "ecr_policy" { | |
repository = aws_ecr_repository.ecr.name | |
policy = <<EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws"{ | |
profile = "profilename" | |
region = "us-east-1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "prod"{ | |
source = "./env/prod" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##S3-Cloudfront | |
module "sampleapp-prod-frontend-s3cloud" { | |
source = "../../s3-cloudfront" | |
environment = "sampleweb-prod" | |
name = "frontend" | |
root_object = "index.html" | |
acm = "arn:aws:acm:us-east-1:123456789101:certificate/4cb08723-6052-4853-8d1f-5674ac80d092" | |
domain = "app.example.com" | |
} |
NewerOlder