diff --git a/README.md b/README.md index 102370f..5a3cdb0 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ Check the [Product Documentation](https://campus.barracuda.com/product/cloudgena ## Misc - This repository has [pre-commit](https://github.com/antonbabenko/pre-commit-terraform) configured - - Test all the pre-commit hooks with `pre-commit run -a` + - Test all the pre-commit hooks with: + - `docker run -v $(pwd):/lint -w /lint ghcr.io/antonbabenko/pre-commit-terraform:latest run -a` + - Cleanup, in case of plugin issues: `find . -name ".terraform*" -print0 | xargs -0 rm -r` - Test github actions with [nektos/act](https://github.com/nektos/act) ## Links diff --git a/modules/aws-asg/README.md b/modules/aws-asg/README.md index ae9437c..1ac865e 100644 --- a/modules/aws-asg/README.md +++ b/modules/aws-asg/README.md @@ -79,3 +79,4 @@ No modules. | Name | Description | |------|-------------| | [Network\_Load\_Balancer\_DNS\_Name](#output\_Network\_Load\_Balancer\_DNS\_Name) | Update the CloudGen Access Proxy in the Console with this DNS name | +| [Security\_Group\_for\_Resources](#output\_Security\_Group\_for\_Resources) | Use this group to allow CloudGen Access Proxy access to internal resources | diff --git a/modules/aws-asg/examples/README.md b/modules/aws-asg/examples/cga-with-vpc/README.md similarity index 83% rename from modules/aws-asg/examples/README.md rename to modules/aws-asg/examples/cga-with-vpc/README.md index 8682c38..2eb5047 100644 --- a/modules/aws-asg/examples/README.md +++ b/modules/aws-asg/examples/cga-with-vpc/README.md @@ -6,8 +6,8 @@ No requirements. | Name | Version | |------|---------| -| [aws](#provider\_aws) | n/a | -| [tls](#provider\_tls) | n/a | +| [aws](#provider\_aws) | 3.74.1 | +| [tls](#provider\_tls) | 3.1.0 | ## Modules @@ -35,3 +35,4 @@ No requirements. | Name | Description | |------|-------------| | [Network\_Load\_Balancer\_DNS\_Name](#output\_Network\_Load\_Balancer\_DNS\_Name) | n/a | +| [Security\_Group\_for\_Resources](#output\_Security\_Group\_for\_Resources) | n/a | diff --git a/modules/aws-asg/examples/cga_with_vpc.tf b/modules/aws-asg/examples/cga-with-vpc/main.tf similarity index 86% rename from modules/aws-asg/examples/cga_with_vpc.tf rename to modules/aws-asg/examples/cga-with-vpc/main.tf index e28847c..4abe96f 100644 --- a/modules/aws-asg/examples/cga_with_vpc.tf +++ b/modules/aws-asg/examples/cga-with-vpc/main.tf @@ -16,6 +16,12 @@ locals { provider "aws" { region = local.aws_region + default_tags { + tags = { + Owner = "team" + Environment = "test" + } + } } # @@ -23,10 +29,11 @@ provider "aws" { # module "cloudgen-access-proxy" { - source = "git::git@github.com:barracuda-cloudgen-access/terraform-modules.git//modules/aws-asg?ref=v1.2.2" + source = "../../" # More examples # run 'rm -rf .terraform/' after changing source + # source = "git::git@github.com:barracuda-cloudgen-access/terraform-modules.git//modules/aws-asg?ref=vx.x.x" # source = "git::git@github.com:barracuda-cloudgen-access/terraform-modules.git//modules/aws-asg?ref=" # source = "../" @@ -51,8 +58,7 @@ module "cloudgen-access-proxy" { launch_cfg_key_pair_name = module.key_pair.key_pair_key_name tags = { - Environment = "test" - Team = "awesome" + extra_tag = "extra-value" } } @@ -68,7 +74,7 @@ output "Security_Group_for_Resources" { # SSH key for instances # -# (!) The private key will be saves in the terraform state file +# (!) The private key will be saved in the terraform state file resource "tls_private_key" "private_key" { algorithm = "RSA" } @@ -127,7 +133,7 @@ module "vpc" { manage_default_security_group = true tags = { - environment = local.application + extra_tag = "extra-value" } vpc_tags = { @@ -139,8 +145,7 @@ resource "aws_default_route_table" "default" { default_route_table_id = module.vpc.default_route_table_id tags = { - Name = "${local.application}-default" - environment = local.application - warning = "This is created by AWS for the VPC and cannot be removed" + Name = "${local.application}-default" + warning = "This is created by AWS for the VPC and cannot be removed" } } diff --git a/modules/aws-asg/provider.tf b/modules/aws-asg/provider.tf deleted file mode 100644 index 73541ff..0000000 --- a/modules/aws-asg/provider.tf +++ /dev/null @@ -1,7 +0,0 @@ -provider "aws" { - region = var.aws_region - - default_tags { - tags = local.common_tags_map - } -}