Skip to content

Commit

Permalink
Removing provider block
Browse files Browse the repository at this point in the history
  • Loading branch information
jnonino committed May 5, 2020
1 parent a7cf8c2 commit 4d6eb61
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 40 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ jobs:
- image: hashicorp/terraform
steps:
- checkout
- run: terraform init
- run: terraform validate
- run:
working_directory: examples/test
command: terraform init
- run:
working_directory: examples/test
command: terraform validate
23 changes: 23 additions & 0 deletions examples/test/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
provider "aws" {
region = "us-east-1"
}

module "base-network" {
source = "cn-terraform/networking/aws"
version = "2.0.7"
name_preffix = "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" ]
private_subnets_cidrs_per_availability_zone = [ "192.168.128.0/19", "192.168.160.0/19", "192.168.192.0/19", "192.168.224.0/19" ]
}

module "test" {
source = "../../"
name_preffix = "test"
vpc_id = module.base-network.vpc_id
container_image = "ubuntu"
container_name = "test"
public_subnets_ids = module.base-network.public_subnets_ids
private_subnets_ids = module.base-network.private_subnets_ids
}
24 changes: 4 additions & 20 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
# ---------------------------------------------------------------------------------------------------------------------
# PROVIDER
# ---------------------------------------------------------------------------------------------------------------------
provider "aws" {
profile = var.profile
region = var.region
}

# ---------------------------------------------------------------------------------------------------------------------
# ECS Cluster
# ---------------------------------------------------------------------------------------------------------------------
module ecs-cluster {
source = "cn-terraform/ecs-cluster/aws"
version = "1.0.3"
version = "1.0.5"
# source = "../terraform-aws-ecs-cluster"

name = "${var.name_preffix}"
profile = var.profile
region = var.region
}

# ---------------------------------------------------------------------------------------------------------------------
# ECS Task Definition
# ---------------------------------------------------------------------------------------------------------------------
module "td" {
source = "cn-terraform/ecs-fargate-task-definition/aws"
version = "1.0.10"
version = "1.0.11"
# source = "../terraform-aws-ecs-fargate-task-definition"

name_preffix = var.name_preffix
profile = var.profile
region = var.region
container_image = var.container_image
container_name = var.container_name
command = var.command
Expand Down Expand Up @@ -69,12 +57,10 @@ module "td" {
# ---------------------------------------------------------------------------------------------------------------------
module "ecs-alb" {
source = "cn-terraform/ecs-alb/aws"
version = "0.0.8"
version = "1.0.0"
# source = "../terraform-aws-ecs-alb"

name_preffix = "${var.name_preffix}"
profile = var.profile
region = var.region
vpc_id = var.vpc_id

# Application Load Balancer
Expand Down Expand Up @@ -118,12 +104,10 @@ module "ecs-alb" {
# ---------------------------------------------------------------------------------------------------------------------
module "ecs-fargate-service" {
source = "cn-terraform/ecs-fargate-service/aws"
version = "2.0.1"
version = "2.0.2"
# source = "../terraform-aws-ecs-fargate-service"

name_preffix = var.name_preffix
profile = var.profile
region = var.region
vpc_id = var.vpc_id

ecs_cluster_arn = module.ecs-cluster.aws_ecs_cluster_cluster_arn
Expand Down
7 changes: 0 additions & 7 deletions terraform.tfvars

This file was deleted.

11 changes: 0 additions & 11 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ variable "name_preffix" {
description = "Name preffix for resources on AWS"
}

# ---------------------------------------------------------------------------------------------------------------------
# AWS CREDENTIALS AND REGION
# ---------------------------------------------------------------------------------------------------------------------
variable "profile" {
description = "AWS API key credentials to use"
}

variable "region" {
description = "AWS Region the infrastructure is hosted in"
}

# ---------------------------------------------------------------------------------------------------------------------
# AWS Networking
# ---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 4d6eb61

Please sign in to comment.