This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from trussworks/barry-012
0.12'ify module
- Loading branch information
Showing
17 changed files
with
469 additions
and
39 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 1 | ||
update_configs: | ||
# Keep go modules up to date, batching pull requests weekly | ||
- package_manager: "go:modules" | ||
directory: "/" | ||
update_schedule: "weekly" | ||
# Apply default reviewer @trussworks/waddlers group to PRs | ||
default_reviewers: | ||
- "trussworks/waddlers" | ||
# Apply dependencies label to PRs | ||
default_labels: | ||
- "dependencies" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DS_Store | ||
.terraform | ||
terraform.tfstate | ||
terraform.tfstate.backup | ||
terraform.tfstate.*.backup |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
linters: | ||
enable: | ||
- gosec | ||
- golint | ||
- gofmt | ||
- goimports |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.PHONY: ensure_pre_commit | ||
ensure_pre_commit: .git/hooks/pre-commit ## Ensure pre-commit is installed | ||
.git/hooks/pre-commit: /usr/local/bin/pre-commit | ||
pre-commit install | ||
pre-commit install-hooks | ||
|
||
.PHONY: pre_commit_tests | ||
pre_commit_tests: ensure_pre_commit ## Run pre-commit tests | ||
pre-commit run --all-files | ||
|
||
.PHONY: test | ||
test: pre_commit_tests | ||
go test -count 1 -v -timeout 90m ./test/... | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f .*.stamp |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
data "aws_ami" "ecs_ami" { | ||
most_recent = true | ||
owners = ["amazon"] | ||
|
||
filter { | ||
name = "name" | ||
values = ["amzn-ami-*-amazon-ecs-optimized"] | ||
} | ||
} | ||
|
||
module "app_ecs_cluster" { | ||
source = "../../" | ||
|
||
name = var.test_name | ||
environment = "test" | ||
|
||
image_id = "${data.aws_ami.ecs_ami.image_id}" | ||
instance_type = "t2.micro" | ||
|
||
vpc_id = module.vpc.vpc_id | ||
subnet_ids = module.vpc.private_subnets | ||
desired_capacity = 1 | ||
max_size = 1 | ||
min_size = 1 | ||
} | ||
|
||
module "vpc" { | ||
source = "terraform-aws-modules/vpc/aws" | ||
version = "~> 2" | ||
|
||
name = var.test_name | ||
cidr = "10.0.0.0/16" | ||
azs = var.vpc_azs | ||
private_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] | ||
public_subnets = ["10.0.104.0/24", "10.0.105.0/24", "10.0.106.0/24"] | ||
|
||
enable_nat_gateway = true | ||
single_nat_gateway = true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
output "ecs_instance_role" { | ||
description = "The ECS Instanc Role." | ||
value = module.app_ecs_cluster.ecs_instance_role | ||
} | ||
|
||
output "ecs_cluster_name" { | ||
description = "The ECS Cluster Name." | ||
value = module.app_ecs_cluster.ecs_cluster_name | ||
} | ||
|
||
output "ecs_cluster_arn" { | ||
description = "The ECS Cluster ARN." | ||
value = module.app_ecs_cluster.ecs_cluster_arn | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
variable "test_name" { | ||
type = string | ||
} | ||
|
||
variable "vpc_azs" { | ||
type = list(string) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module github.com/trussworks/terraform-aws-ecs-cluster | ||
|
||
go 1.13 | ||
|
||
require ( | ||
github.com/aws/aws-sdk-go v1.23.8 | ||
github.com/gruntwork-io/terratest v0.23.0 | ||
github.com/stretchr/testify v1.4.0 | ||
) |
Oops, something went wrong.