Skip to content

Commit

Permalink
Updating to Terraform 0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
jnonino committed Sep 4, 2020
1 parent 74a9579 commit cafc524
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: 2
jobs:
check-format:
docker:
- image: hashicorp/terraform:0.12.29
- image: hashicorp/terraform
steps:
- checkout
- run:
command: terraform fmt -check -recursive -diff
validate:
docker:
- image: hashicorp/terraform:0.12.29
- image: hashicorp/terraform
steps:
- checkout
- run:
Expand Down
6 changes: 3 additions & 3 deletions examples/test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ provider "aws" {

module "base-network" {
source = "cn-terraform/networking/aws"
version = "2.0.7"
name_preffix = "test-networking"
version = "2.0.10"
name_prefix = "test-networking"
vpc_cidr_block = "192.168.0.0/16"
availability_zones = ["us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d"]
public_subnets_cidrs_per_availability_zone = ["192.168.0.0/19", "192.168.32.0/19", "192.168.64.0/19", "192.168.96.0/19"]
Expand All @@ -14,7 +14,7 @@ module "base-network" {

module "jenkins" {
source = "../../"
name_preffix = "jenkins"
name_prefix = "jenkins"
region = "us-east-1"
vpc_id = module.base-network.vpc_id
public_subnets_ids = module.base-network.public_subnets_ids
Expand Down
30 changes: 15 additions & 15 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
#------------------------------------------------------------------------------
module aws_cw_logs {
source = "cn-terraform/cloudwatch-logs/aws"
version = "1.0.6"
version = "1.0.7"
# source = "../terraform-aws-cloudwatch-logs"

logs_path = "/ecs/service/${var.name_preffix}-jenkins-master"
logs_path = "/ecs/service/${var.name_prefix}-jenkins-master"
}

#------------------------------------------------------------------------------
# Locals
#------------------------------------------------------------------------------
locals {
container_name = "${var.name_preffix}-jenkins"
container_name = "${var.name_prefix}-jenkins"
healthcheck = {
command = ["CMD-SHELL", "curl -f http://localhost:8080 || exit 1"]
retries = 3
Expand Down Expand Up @@ -42,23 +42,23 @@ locals {
#------------------------------------------------------------------------------
module ecs-cluster {
source = "cn-terraform/ecs-cluster/aws"
version = "1.0.5"
version = "1.0.6"
# source = "../terraform-aws-ecs-cluster"

name = "${var.name_preffix}-jenkins"
name = "${var.name_prefix}-jenkins"
}

#------------------------------------------------------------------------------
# EFS
#------------------------------------------------------------------------------
resource "aws_efs_file_system" "jenkins_data" {
creation_token = "${var.name_preffix}-jenkins-efs"
creation_token = "${var.name_prefix}-jenkins-efs"
tags = {
Name = "${var.name_preffix}-jenkins-efs"
Name = "${var.name_prefix}-jenkins-efs"
}
}
resource "aws_security_group" "jenkins_data_allow_nfs_access" {
name = "${var.name_preffix}-jenkins-efs-allow-nfs"
name = "${var.name_prefix}-jenkins-efs-allow-nfs"
description = "Allow NFS inbound traffic to EFS"
vpc_id = var.vpc_id
egress {
Expand All @@ -68,7 +68,7 @@ resource "aws_security_group" "jenkins_data_allow_nfs_access" {
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "${var.name_preffix}-jenkins-efs-allow-nfs"
Name = "${var.name_prefix}-jenkins-efs-allow-nfs"
}
}

Expand Down Expand Up @@ -98,10 +98,10 @@ resource "aws_efs_mount_target" "jenkins_data_mount_targets" {
#------------------------------------------------------------------------------
module "td" {
source = "cn-terraform/ecs-fargate-task-definition/aws"
version = "1.0.11"
version = "1.0.15"
# source = "../terraform-aws-ecs-fargate-task-definition"

name_preffix = "${var.name_preffix}-jenkins"
name_prefix = "${var.name_prefix}-jenkins"
container_name = local.container_name
container_image = "cnservices/jenkins-master"
container_cpu = 2048 # 2 vCPU - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-task-defs
Expand Down Expand Up @@ -139,10 +139,10 @@ module "td" {
#------------------------------------------------------------------------------
module "ecs-alb" {
source = "cn-terraform/ecs-alb/aws"
version = "1.0.2"
version = "1.0.5"
# source = "../terraform-aws-ecs-alb"

name_preffix = "${var.name_preffix}-jenkins"
name_prefix = "${var.name_prefix}-jenkins"
vpc_id = var.vpc_id
private_subnets = var.private_subnets_ids
public_subnets = var.public_subnets_ids
Expand All @@ -155,10 +155,10 @@ module "ecs-alb" {
#------------------------------------------------------------------------------
module ecs-fargate-service {
source = "cn-terraform/ecs-fargate-service/aws"
version = "2.0.4"
version = "2.0.7"
# source = "../terraform-aws-ecs-fargate-service"

name_preffix = "${var.name_preffix}-jenkins"
name_prefix = "${var.name_prefix}-jenkins"
vpc_id = var.vpc_id
ecs_cluster_arn = module.ecs-cluster.aws_ecs_cluster_cluster_arn
health_check_grace_period_seconds = 120
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#------------------------------------------------------------------------------
# Misc
#------------------------------------------------------------------------------
variable "name_preffix" {
description = "Name preffix for resources on AWS"
variable "name_prefix" {
description = "Name prefix for resources on AWS"
}

#------------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

terraform {
required_version = ">= 0.12"
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}

0 comments on commit cafc524

Please sign in to comment.