diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml new file mode 100644 index 0000000..3646f9f --- /dev/null +++ b/.github/workflows/readme.yml @@ -0,0 +1,54 @@ +name: 'Create README.md file' +on: + push: + branches: + - master + +jobs: + readme-create: + name: 'readme-create' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@master + + - name: Set up Python 3.7. + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: 'create readme' + uses: 'clouddrove/github-actions@v4.0' + with: + actions_subcommand: 'readme' + github_token: '${{ secrets.GITHUB}}' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} + + + - name: pre-commit check errors + uses: pre-commit/action@v2.0.0 + continue-on-error: true + + - name: pre-commit fix erros + uses: pre-commit/action@v2.0.0 + continue-on-error: true + + - name: 'push readme' + uses: 'clouddrove/github-actions@v4.0' + continue-on-error: true + with: + actions_subcommand: 'push' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} + + - name: 'Slack Notification' + uses: clouddrove/action-slack@v2 + with: + status: ${{ job.status }} + fields: repo,author + author_name: 'CloudDrove' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required + if: always() \ No newline at end of file diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 1480640..86f5230 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -1,79 +1,90 @@ name: 'Terraform GitHub Actions' on: - - pull_request + pull_request: + branches: + - master jobs: terraform: name: 'Terraform' runs-on: ubuntu-latest steps: - - name: 'Checkout' uses: actions/checkout@master + - name: Configure AWS Credentials + uses: clouddrove/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }} + aws-region: us-east-2 + - name: 'Terraform Format' - uses: clouddrove/github-actions@v2.0 + uses: 'clouddrove/github-actions@v4.0' with: actions_subcommand: 'fmt' - - name: 'ALB Terraform Init' - uses: clouddrove/github-actions@v2.0 + - name: 'Terraform init for alb' + uses: 'clouddrove/github-actions@v4.0' with: actions_subcommand: 'init' tf_actions_working_dir: ./_example/alb - - name: Configure AWS Credentials - uses: clouddrove/configure-aws-credentials@v1 + - name: 'Terraform validate for alb' + uses: 'clouddrove/github-actions@v4.0' with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-2 + actions_subcommand: 'validate' + tf_actions_working_dir: ./_example/alb - - name: 'ALB Terraform Plan' - uses: clouddrove/github-actions@v2.0 + - name: 'Terraform plan for alb' + uses: 'clouddrove/github-actions@v4.0' with: actions_subcommand: 'plan' tf_actions_working_dir: ./_example/alb - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: 'ALB Terratest' - uses: clouddrove/github-actions@v2.0 + - name: 'Terraform init for clb' + uses: 'clouddrove/github-actions@v4.0' with: - actions_subcommand: 'terratest' - tf_actions_working_dir: ./_test/alb - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + actions_subcommand: 'init' + tf_actions_working_dir: ./_example/clb - - name: 'CLB Terraform Init' - uses: clouddrove/github-actions@v2.0 + - name: 'Terraform validate for clb' + uses: 'clouddrove/github-actions@v4.0' with: - actions_subcommand: 'init' + actions_subcommand: 'validate' tf_actions_working_dir: ./_example/clb - - name: 'CLB Terraform Plan' - uses: clouddrove/github-actions@v2.0 + - name: 'Terraform plan for clb' + uses: 'clouddrove/github-actions@v4.0' with: actions_subcommand: 'plan' tf_actions_working_dir: ./_example/clb - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: 'CLB Terratest' - uses: clouddrove/github-actions@v2.0 + - name: 'Terraform init for nlb' + uses: 'clouddrove/github-actions@v4.0' with: - actions_subcommand: 'terratest' - tf_actions_working_dir: ./_test/clb - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + actions_subcommand: 'init' + tf_actions_working_dir: ./_example/nlb + + - name: 'Terraform validate for nlb' + uses: 'clouddrove/github-actions@v4.0' + with: + actions_subcommand: 'validate' + tf_actions_working_dir: ./_example/nlb + + - name: 'Terraform plan for nlb' + uses: 'clouddrove/github-actions@v4.0' + with: + actions_subcommand: 'plan' + tf_actions_working_dir: ./_example/nlb - name: 'Slack Notification' uses: clouddrove/action-slack@v2 with: status: ${{ job.status }} fields: repo,author - author_name: 'Clouddrove' + author_name: 'CloudDrove' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required if: always() \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aa6e42c..9a789cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ repos: - repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.12.0 + rev: v1.43.0 hooks: - id: terraform_fmt - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.0.0 + rev: v3.2.0 hooks: - id: check-merge-conflict - - id: trailing-whitespace - id: check-yaml - id: check-added-large-files + - id: trailing-whitespace \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index a56f2c7..0000000 --- a/README.md +++ /dev/null @@ -1,319 +0,0 @@ - - -

- - -

- Terraform AWS ALB -

- -

- This terraform module is used to create ALB on AWS. -

- -

- - - Terraform - - - Licence - - - -

-

- - - - - - - - - - - -

-
- - -We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy Bigger problems are always solved by breaking them into smaller manageable problems. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller connected yet manageable pieces within the infrastructure. - -This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself. - -We have [*fifty plus terraform modules*][terraform_modules]. A few of them are comepleted and are available for open source usage while a few others are in progress. - - - - -## Prerequisites - -This module has a few dependencies: - -- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html) -- [Go](https://golang.org/doc/install) -- [github.com/stretchr/testify/assert](https://github.com/stretchr/testify) -- [github.com/gruntwork-io/terratest/modules/terraform](https://github.com/gruntwork-io/terratest) - - - - - - - -## Examples - - -**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-aws-alb/releases). - - -Here are examples of how you can use this module in your inventory structure: -### ALB Example -```hcl - module "alb" { - source = "git::https://github.com/clouddrove/terraform-aws-alb.git?ref=tags/0.12.7" - name = "alb" - application = "clouddrove" - environment = "test" - label_order = ["environment", "application", "name"] - internal = false - load_balancer_type = "application" - instance_count = module.ec2.instance_count - security_groups = [module.ssh.security_group_ids, module.http-https.security_group_ids] - subnets = module.public_subnets.public_subnet_id - enable_deletion_protection = false - target_id = module.ec2.instance_id - vpc_id = module.vpc.vpc_id - https_enabled = true - http_enabled = true - https_port = 443 - listener_type = "forward" - listener_certificate_arn = "arn:aws:acm:eu-west-1:924144197303:certificate/0418d2ba-91f7-4196-991b-28b5c60cd4cf" - target_group_port = 80 - target_groups = [ - { - backend_protocol = "HTTP" - backend_port = 80 - target_type = "instance" - deregistration_delay = 300 - health_check = { - enabled = true - interval = 30 - path = "/" - port = "traffic-port" - healthy_threshold = 3 - unhealthy_threshold = 3 - timeout = 10 - protocol = "HTTP" - matcher = "200-399" - } - } - ] - } -``` - -### NLB Example -```hcl - module "alb" { - source = "git::https://github.com/clouddrove/terraform-aws-alb.git?ref=tags/0.12.7" - name = "nlb" - application = "clouddrove" - environment = "test" - label_order = ["environment", "application", "name"] - internal = false - load_balancer_type = "application" - instance_count = module.ec2.instance_count - subnets = module.public_subnets.public_subnet_id - enable_deletion_protection = false - target_id = module.ec2.instance_id - vpc_id = module.vpc.vpc_id - http_tcp_listeners = [ - { - port = 80 - protocol = "TCP" - target_group_index = 0 - }, - ] - - https_listeners = [ - { - port = 443 - protocol = "TLS" - certificate_arn = "arn:aws:acm:eu-west-1:924144197303:certificate/0418d2ba-91f7-4196-991b-28b5c60cd4cf" - target_group_index = 1 - }, - ] - - target_groups = [ - { - backend_protocol = "TCP" - backend_port = 80 - target_type = "instance" - }, - { - backend_protocol = "TLS" - backend_port = 443 - target_type = "instance" - }, - ] - } -``` - -### CLB Example -```hcl - module "clb" { - source = "git::https://github.com/clouddrove/terraform-aws-alb.git?ref=tags/0.12.7" - - name = "clb" - application = "clouddrove" - environment = "test" - label_order = ["environment", "application", "name"] - - load_balancer_type = "classic" - internal = false - target_id = module.ec2.instance_id - security_groups = [module.ssh.security_group_ids, module.http_https.security_group_ids] - subnets = module.public_subnets.public_subnet_id - - listeners = [ - { - lb_port = 22000 - lb_protocol = "TCP" - instance_port = 22000 - instance_protocol = "TCP" - ssl_certificate_id = null - }, - { - lb_port = 4444 - lb_protocol = "TCP" - instance_port = 4444 - instance_protocol = "TCP" - ssl_certificate_id = null - } - ] - - health_check_target = "TCP:4444" - health_check_timeout = 10 - health_check_interval = 30 - health_check_unhealthy_threshold = 5 - health_check_healthy_threshold = 5 -} -``` - - - - - - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|:----:|:-----:|:-----:| -| access\_logs | Access logs Enable or Disable. | bool | `"false"` | no | -| allocation\_id | The allocation ID of the Elastic IP address. | string | `""` | no | -| application | Application \(e.g. `cd` or `clouddrove`\). | string | `""` | no | -| attributes | Additional attributes \(e.g. `1`\). | list | `` | no | -| availability\_zones | The AZ's to serve traffic in. | list(map(string)) | `` | no | -| clb\_enable | If true, create clb. | bool | `"false"` | no | -| connection\_draining | TBoolean to enable connection draining. Default: false. | bool | `"false"` | no | -| connection\_draining\_timeout | The time after which connection draining is aborted in seconds. | number | `"300"` | no | -| delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | string | `"-"` | no | -| drop\_invalid\_header\_fields | Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer \(true\) or routed to targets \(false\). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type application. | bool | `"false"` | no | -| enable | If true, create alb. | bool | `"false"` | no | -| enable\_connection\_draining | Whether or not to enable connection draining \("true" or "false"\). | bool | `"false"` | no | -| enable\_cross\_zone\_load\_balancing | Indicates whether cross zone load balancing should be enabled in application load balancers. | bool | `"false"` | no | -| enable\_deletion\_protection | If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer. Defaults to false. | bool | `"false"` | no | -| enable\_http2 | Indicates whether HTTP/2 is enabled in application load balancers. | bool | `"true"` | no | -| environment | Environment \(e.g. `prod`, `dev`, `staging`\). | string | `""` | no | -| health\_check\_healthy\_threshold | The number of successful health checks before an instance is put into service. | number | `"10"` | no | -| health\_check\_interval | The time between health check attempts in seconds. | number | `"30"` | no | -| health\_check\_target | The target to use for health checks. | string | `"TCP:80"` | no | -| health\_check\_timeout | The time after which a health check is considered failed in seconds. | number | `"5"` | no | -| health\_check\_unhealthy\_threshold | The number of failed health checks before an instance is taken out of service. | number | `"2"` | no | -| http\_enabled | A boolean flag to enable/disable HTTP listener. | bool | `"true"` | no | -| http\_listener\_type | The type of routing action. Valid values are forward, redirect, fixed-response, authenticate-cognito and authenticate-oidc. | string | `"redirect"` | no | -| http\_port | The port on which the load balancer is listening. like 80 or 443. | number | `"80"` | no | -| http\_tcp\_listeners | A list of maps describing the HTTP listeners for this ALB. Required key/values: port, protocol. Optional key/values: target\_group\_index \(defaults to 0\) | list(map(string)) | `` | no | -| https\_enabled | A boolean flag to enable/disable HTTPS listener. | bool | `"true"` | no | -| https\_listeners | A list of maps describing the HTTPS listeners for this ALB. Required key/values: port, certificate\_arn. Optional key/values: ssl\_policy \(defaults to ELBSecurityPolicy-2016-08\), target\_group\_index \(defaults to 0\) | list(map(string)) | `` | no | -| https\_port | The port on which the load balancer is listening. like 80 or 443. | number | `"443"` | no | -| idle\_timeout | The time in seconds that the connection is allowed to be idle. | number | `"60"` | no | -| instance\_count | The count of instances. | number | `"0"` | no | -| internal | If true, the LB will be internal. | string | `""` | no | -| ip\_address\_type | The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack. | string | `"ipv4"` | no | -| label\_order | Label order, e.g. `name`,`application`. | list | `` | no | -| listener\_certificate\_arn | The ARN of the SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. | string | `""` | no | -| listener\_protocol | The protocol for connections from clients to the load balancer. Valid values are TCP, HTTP and HTTPS. Defaults to HTTP. | string | `"HTTPS"` | no | -| listener\_ssl\_policy | The security policy if using HTTPS externally on the load balancer. \[See\]\(https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-policy-table.html\). | string | `"ELBSecurityPolicy-2016-08"` | no | -| listener\_type | The type of routing action. Valid values are forward, redirect, fixed-response, authenticate-cognito and authenticate-oidc. | string | `"forward"` | no | -| listeners | A list of listener configurations for the ELB. | object | `` | no | -| load\_balancer\_create\_timeout | Timeout value when creating the ALB. | string | `"10m"` | no | -| load\_balancer\_delete\_timeout | Timeout value when deleting the ALB. | string | `"10m"` | no | -| load\_balancer\_type | The type of load balancer to create. Possible values are application or network. The default value is application. | string | `""` | no | -| load\_balancer\_update\_timeout | Timeout value when updating the ALB. | string | `"10m"` | no | -| log\_bucket\_name | S3 bucket \(externally created\) for storing load balancer access logs. Required if logging\_enabled is true. | string | `""` | no | -| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no | -| name | Name \(e.g. `app` or `cluster`\). | string | `""` | no | -| security\_groups | A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application. | list | `` | no | -| status\_code | The HTTP redirect code. The redirect is either permanent \(HTTP\_301\) or temporary \(HTTP\_302\). | string | `"HTTP_301"` | no | -| subnet\_id | The id of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone. | string | `""` | no | -| subnet\_mapping | A list of subnet mapping blocks describing subnets to attach to network load balancer | list(map(string)) | `` | no | -| subnets | A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type network. Changing this value will for load balancers of type network will force a recreation of the resource. | list | `` | no | -| tags | Additional tags \(e.g. map\(`BusinessUnit`,`XYZ`\). | map | `` | no | -| target\_group\_port | The port on which targets receive traffic, unless overridden when registering a specific target. | string | `"80"` | no | -| target\_groups | A list of maps containing key/value pairs that define the target groups to be created. Order of these maps is important and the index of these are to be referenced in listener definitions. Required key/values: name, backend\_protocol, backend\_port. Optional key/values are in the target\_groups\_defaults variable. | any | `` | no | -| target\_id | The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. | list | n/a | yes | -| target\_type | The type of target that you must specify when registering targets with this target group. | string | `""` | no | -| vpc\_id | The identifier of the VPC in which to create the target group. | string | `""` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| arn | The ARN of the ALB. | -| arn\_suffix | The ARN suffix of the ALB. | -| clb\_arn | The ARN of the CLB. | -| clb\_name | DNS name of CLB. | -| clb\_zone\_id | The ID of the zone which ALB is provisioned. | -| dns\_name | DNS name of ALB. | -| http\_listener\_arn | The ARN of the HTTP listener. | -| https\_listener\_arn | The ARN of the HTTPS listener. | -| listener\_arns | A list of all the listener ARNs. | -| main\_target\_group\_arn | The main target group ARN. | -| name | The ARN suffix of the ALB. | -| tags | A mapping of tags to assign to the resource. | -| zone\_id | The ID of the zone which ALB is provisioned. | - - - - -## Testing -In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system. - -You need to run the following command in the testing folder: -```hcl - go test -run Test -``` - - - -## Feedback -If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-alb/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com). - -If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-alb)! - -## About us - -At [CloudDrove][website], we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering. - -

We are The Cloud Experts!

-
-

We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.

- - [website]: https://clouddrove.com - [github]: https://github.com/clouddrove - [linkedin]: https://cpco.io/linkedin - [twitter]: https://twitter.com/clouddrove/ - [email]: https://clouddrove.com/contact-us.html - [terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language= diff --git a/README.yaml b/README.yaml index ad8899f..f1a222d 100644 --- a/README.yaml +++ b/README.yaml @@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-alb # Badges to display badges: - name: "Terraform" - image: "https://img.shields.io/badge/Terraform-v0.12-green" + image: "https://img.shields.io/badge/Terraform-v0.13-green" url: "https://www.terraform.io" - name: "Licence" image: "https://img.shields.io/badge/License-MIT-blue.svg" @@ -36,7 +36,8 @@ usage : |- ### ALB Example ```hcl module "alb" { - source = "git::https://github.com/clouddrove/terraform-aws-alb.git?ref=tags/0.12.7" + source = "clouddrove/alb/aws" + version = "0.13.0" name = "alb" application = "clouddrove" environment = "test" @@ -80,7 +81,8 @@ usage : |- ### NLB Example ```hcl module "alb" { - source = "git::https://github.com/clouddrove/terraform-aws-alb.git?ref=tags/0.12.7" + source = "clouddrove/alb/aws" + version = "0.13.0" name = "nlb" application = "clouddrove" environment = "test" @@ -127,8 +129,8 @@ usage : |- ### CLB Example ```hcl module "clb" { - source = "git::https://github.com/clouddrove/terraform-aws-alb.git?ref=tags/0.12.7" - + source = "clouddrove/alb/aws" + version = "0.13.0" name = "clb" application = "clouddrove" environment = "test" diff --git a/_example/alb/example.tf b/_example/alb/example.tf index 8c8976b..d3c3580 100644 --- a/_example/alb/example.tf +++ b/_example/alb/example.tf @@ -3,8 +3,8 @@ provider "aws" { } module "vpc" { - source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.12.5" - + source = "clouddrove/vpc/aws" + version = "0.13.0" name = "vpc" application = "clouddrove" environment = "test" @@ -14,8 +14,8 @@ module "vpc" { } module "public_subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.6" - + source = "clouddrove/subnet/aws" + version = "0.13.0" name = "public-subnet" application = "clouddrove" environment = "test" @@ -26,11 +26,12 @@ module "public_subnets" { cidr_block = module.vpc.vpc_cidr_block type = "public" igw_id = module.vpc.igw_id + ipv6_cidr_block = module.vpc.ipv6_cidr_block } module "http_https" { - source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.4" - + source = "clouddrove/security-group/aws" + version = "0.13.0" name = "http-https" application = "clouddrove" environment = "test" @@ -42,8 +43,8 @@ module "http_https" { } module "ssh" { - source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.4" - + source = "clouddrove/security-group/aws" + version = "0.13.0" name = "ssh" application = "clouddrove" environment = "test" @@ -55,8 +56,8 @@ module "ssh" { } module "iam-role" { - source = "git::https://github.com/clouddrove/terraform-aws-iam-role.git?ref=tags/0.12.3" - + source = "clouddrove/iam-role/aws" + version = "0.13.0" name = "iam-role" application = "clouddrove" environment = "test" @@ -92,8 +93,8 @@ data "aws_iam_policy_document" "iam-policy" { } module "ec2" { - source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.12.4" - + source = "clouddrove/ec2/aws" + version = "0.13.0" name = "ec2-instance" application = "clouddrove" environment = "test" diff --git a/_example/clb/example.tf b/_example/clb/example.tf index 68c95ff..7640147 100644 --- a/_example/clb/example.tf +++ b/_example/clb/example.tf @@ -3,8 +3,8 @@ provider "aws" { } module "vpc" { - source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.12.5" - + source = "clouddrove/vpc/aws" + version = "0.13.0" name = "vpc" application = "clouddrove" environment = "test" @@ -14,8 +14,8 @@ module "vpc" { } module "public_subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.6" - + source = "clouddrove/subnet/aws" + version = "0.13.0" name = "public-subnet" application = "clouddrove" environment = "test" @@ -26,11 +26,12 @@ module "public_subnets" { cidr_block = module.vpc.vpc_cidr_block type = "public" igw_id = module.vpc.igw_id + ipv6_cidr_block = module.vpc.ipv6_cidr_block } module "http_https" { - source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.4" - + source = "clouddrove/security-group/aws" + version = "0.13.0" name = "http-https" application = "clouddrove" environment = "test" @@ -42,8 +43,8 @@ module "http_https" { } module "ssh" { - source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.4" - + source = "clouddrove/security-group/aws" + version = "0.13.0" name = "ssh" application = "clouddrove" environment = "test" @@ -55,8 +56,8 @@ module "ssh" { } module "iam-role" { - source = "git::https://github.com/clouddrove/terraform-aws-iam-role.git?ref=tags/0.12.3" - + source = "clouddrove/iam-role/aws" + version = "0.13.0" name = "iam-role" application = "clouddrove" environment = "test" @@ -92,8 +93,8 @@ data "aws_iam_policy_document" "iam-policy" { } module "ec2" { - source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.12.4" - + source = "clouddrove/ec2/aws" + version = "0.13.0" name = "ec2-instance" application = "clouddrove" environment = "test" diff --git a/_example/nlb/example.tf b/_example/nlb/example.tf index 51c13a5..75725ca 100644 --- a/_example/nlb/example.tf +++ b/_example/nlb/example.tf @@ -3,8 +3,8 @@ provider "aws" { } module "vpc" { - source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.12.4" - + source = "clouddrove/vpc/aws" + version = "0.13.0" name = "vpc" application = "clouddrove" environment = "test" @@ -14,8 +14,8 @@ module "vpc" { } module "public_subnets" { - source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.4" - + source = "clouddrove/subnet/aws" + version = "0.13.0" name = "public-subnet" application = "clouddrove" environment = "test" @@ -26,11 +26,12 @@ module "public_subnets" { cidr_block = module.vpc.vpc_cidr_block type = "public" igw_id = module.vpc.igw_id + ipv6_cidr_block = module.vpc.ipv6_cidr_block } module "http-https" { - source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.3" - + source = "clouddrove/security-group/aws" + version = "0.13.0" name = "http-https" application = "clouddrove" environment = "test" @@ -42,8 +43,8 @@ module "http-https" { } module "ssh" { - source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.3" - + source = "clouddrove/security-group/aws" + version = "0.13.0" name = "ssh" application = "clouddrove" environment = "test" @@ -55,8 +56,8 @@ module "ssh" { } module "iam-role" { - source = "git::https://github.com/clouddrove/terraform-aws-iam-role.git?ref=tags/0.12.1" - + source = "clouddrove/iam-role/aws" + version = "0.13.0" name = "iam-role" application = "clouddrove" environment = "test" @@ -92,8 +93,8 @@ data "aws_iam_policy_document" "iam-policy" { } module "ec2" { - source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.12.4" - + source = "clouddrove/ec2/aws" + version = "0.13.0" name = "ec2-instance" application = "clouddrove" environment = "test" diff --git a/main.tf b/main.tf index 60fa0b8..26f7a33 100644 --- a/main.tf +++ b/main.tf @@ -7,7 +7,7 @@ # tags for resources. You can use terraform-labels to implement a strict # naming convention. module "labels" { - source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.12.0" + source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.13.0" name = var.name application = var.application diff --git a/versions.tf b/versions.tf index 5e90985..a8a23bd 100644 --- a/versions.tf +++ b/versions.tf @@ -1,4 +1,10 @@ # Terraform version terraform { - required_version = ">= 0.12" + required_version = ">= 0.13" + required_providers { + aws = { + source = "hashicorp/aws" + version = "3.10.0" + } + } }