Skip to content

Commit 52a5838

Browse files
committed
Removing provider block
1 parent 923354c commit 52a5838

File tree

6 files changed

+62
-30
lines changed

6 files changed

+62
-30
lines changed

.circleci/config.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ jobs:
55
- image: hashicorp/terraform
66
steps:
77
- checkout
8-
- run: terraform init
9-
- run: terraform validate
8+
- run:
9+
working_directory: examples/test
10+
command: terraform init
11+
- run:
12+
working_directory: examples/test
13+
command: terraform validate

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Check valid versions on:
1717

1818
## Other modules that you may need to use this module
1919

20-
The networking module:
20+
The Networking module:
2121
* Github Releases: <https://github.com/cn-terraform/terraform-aws-networking/releases>
2222
* Terraform Module Registry: <https://registry.terraform.io/modules/cn-terraform/networking/aws>
2323

2424
The ECS cluster module:
2525
* Github Releases: <https://github.com/cn-terraform/terraform-aws-ecs-cluster/releases>
2626
* Terraform Module Registry: <https://registry.terraform.io/modules/cn-terraform/ecs-cluster/aws>
2727

28-
The task definition:
28+
The ECS Task Definition:
2929
* Github Releases: <https://github.com/cn-terraform/terraform-aws-ecs-fargate-task-definition/releases>
3030
* Terraform Module Registry: <https://registry.terraform.io/modules/cn-terraform/ecs-fargate-task-definition/aws>
3131

examples/test/main.tf

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
provider "aws" {
2+
region = "us-east-1"
3+
}
4+
5+
module "cluster" {
6+
source = "cn-terraform/ecs-cluster/aws"
7+
version = "1.0.5"
8+
name = "test-cluster"
9+
}
10+
11+
module "base-network" {
12+
source = "cn-terraform/networking/aws"
13+
version = "2.0.7"
14+
name_preffix = "test-networking"
15+
vpc_cidr_block = "192.168.0.0/16"
16+
availability_zones = [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d" ]
17+
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" ]
18+
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" ]
19+
}
20+
21+
module "load_balancer" {
22+
source = "cn-terraform/ecs-alb/aws"
23+
version = "1.0.0"
24+
name_preffix = "test-alb"
25+
vpc_id = module.base-network.vpc_id
26+
private_subnets = module.base-network.private_subnets_ids
27+
public_subnets = module.base-network.public_subnets_ids
28+
}
29+
30+
module "td" {
31+
source = "cn-terraform/ecs-fargate-task-definition/aws"
32+
version = "1.0.11"
33+
name_preffix = "test-td"
34+
container_image = "ubuntu"
35+
container_name = "test"
36+
}
37+
38+
module "service" {
39+
source = "../../"
40+
name_preffix = "test-service"
41+
vpc_id = module.base-network.vpc_id
42+
ecs_cluster_arn = module.cluster.aws_ecs_cluster_cluster_arn
43+
task_definition_arn = module.td.aws_ecs_task_definition_td_arn
44+
public_subnets = module.base-network.public_subnets_ids
45+
private_subnets = module.base-network.private_subnets_ids
46+
container_name = "test"
47+
ecs_cluster_name = module.cluster.aws_ecs_cluster_cluster_name
48+
lb_arn = module.load_balancer.aws_lb_lb_arn
49+
lb_http_tgs_arns = module.load_balancer.lb_http_tgs_arns
50+
lb_https_tgs_arns = module.load_balancer.lb_https_tgs_arns
51+
lb_http_listeners_arns = module.load_balancer.lb_http_listeners_arns
52+
lb_https_listeners_arns = module.load_balancer.lb_https_listeners_arns
53+
load_balancer_sg_id = module.load_balancer.aws_security_group_lb_access_sg_id
54+
}

main.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# ---------------------------------------------------------------------------------------------------------------------
2-
# PROVIDER
3-
# ---------------------------------------------------------------------------------------------------------------------
4-
provider "aws" {
5-
profile = var.profile
6-
region = var.region
7-
}
8-
91
# ---------------------------------------------------------------------------------------------------------------------
102
# AWS LOAD BALANCER
113
# ---------------------------------------------------------------------------------------------------------------------

terraform.tfvars

Lines changed: 0 additions & 7 deletions
This file was deleted.

variables.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@ variable "name_preffix" {
55
description = "Name preffix for resources on AWS"
66
}
77

8-
# ---------------------------------------------------------------------------------------------------------------------
9-
# AWS CREDENTIALS AND REGION
10-
# ---------------------------------------------------------------------------------------------------------------------
11-
variable "profile" {
12-
description = "AWS API key credentials to use"
13-
}
14-
15-
variable "region" {
16-
description = "AWS Region the infrastructure is hosted in"
17-
}
18-
198
# ---------------------------------------------------------------------------------------------------------------------
209
# AWS Networking
2110
# ---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)