diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d766c96..4eab2c12 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: # test-static-code-and-linting: machine: - image: ubuntu-1604:202007-01 # Ubuntu 16.04, Docker v19.03.12, Docker Compose v1.26.1 + image: ubuntu-2004:202107-02 # Ubuntu 20.04, Docker v20.10.7, Docker Compose v1.29.2 # This job has been blocked because Docker Layer Caching is not available on your plan. # Should upgrade if necessary. @@ -26,31 +26,29 @@ jobs: git update-index --assume-unchanged "Makefile" - run: - name: test-terraform-format-and-docs + name: test-dependencies command: | # # Install pre-commit - pip install pre-commit + sudo -H pip3 install pre-commit # # Install terraform - sudo apt-get install unzip + sudo apt-get install unzip curl + curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - wget https://releases.hashicorp.com/terraform/${TERRAFORM_VER}/terraform_${TERRAFORM_VER}_linux_amd64.zip unzip terraform_${TERRAFORM_VER}_linux_amd64.zip sudo mv terraform /usr/local/bin/ terraform --version # # Install terraform-docs - sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" - curl -Lo ./terraform-docs https://github.com/terraform-docs/terraform-docs/releases/download/v0.10.1/terraform-docs-v0.10.1-$(uname | tr '[:upper:]' '[:lower:]')-amd64 - chmod +x ./terraform-docs - sudo mv ./terraform-docs /usr/local/bin/terraform-docs - # - # Run tests - make pre-commit + curl -Lo terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.16.0/terraform-docs-v0.16.0-linux-amd64.tar.gz + tar xfz terraform-docs.tar.gz + chmod +x terraform-docs + sudo mv terraform-docs /usr/local/bin/ - run: name: Install awscli - command: sudo -H pip install awscli + command: sudo -H pip3 install awscli - run: name: Configure awscli @@ -75,7 +73,7 @@ jobs: - run: name: test-terraform-linting - command: make tflint-deep + command: make tflint - slack/notify: event: fail @@ -152,7 +150,7 @@ jobs: # test-e2e-terratests: machine: - image: ubuntu-1604:202007-01 + image: ubuntu-2004:202107-02 # Ubuntu 20.04, Docker v20.10.7, Docker Compose v1.29.2 docker_layer_caching: false steps: @@ -170,7 +168,7 @@ jobs: - run: name: Install awscli - command: sudo pip install awscli + command: sudo -H pip3 install awscli - run: name: Configure awscli @@ -206,7 +204,7 @@ jobs: # release-version-with-changelog: machine: - image: ubuntu-1604:202007-01 + image: ubuntu-2004:202107-02 # Ubuntu 20.04, Docker v20.10.7, Docker Compose v1.29.2 docker_layer_caching: false environment: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1415c34e..331efb43 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,8 +3,8 @@ default_language_version: python: python3 repos: - - repo: git://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 hooks: - id: check-json - id: check-merge-conflict @@ -17,8 +17,8 @@ repos: args: - --markdown-linebreak-ext=md - - repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.43.0 + - repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.77.0 hooks: - id: terraform_fmt - id: terraform_docs diff --git a/Makefile b/Makefile index 761f3bcf..e0e5ac49 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ SHELL := /bin/bash MAKEFILE_PATH := ./Makefile MAKEFILES_DIR := ./@bin/makefiles -MAKEFILES_VER := v0.1.5 +MAKEFILES_VER := v0.2.17 +PROJECT_SHORT := bb help: @echo 'Available Commands:' @@ -19,5 +20,6 @@ init-makefiles: ## initialize makefiles -include ${MAKEFILES_DIR}/circleci/circleci.mk -include ${MAKEFILES_DIR}/release-mgmt/release.mk --include ${MAKEFILES_DIR}/terraform13/terraform13.mk --include ${MAKEFILES_DIR}/terratest13/terratest13.mk +-include ${MAKEFILES_DIR}/terraform1/terraform1-root-context.mk +-include ${MAKEFILES_DIR}/terraform1/terraform1.mk +-include ${MAKEFILES_DIR}/terratest1/terratest1.mk diff --git a/README.md b/README.md index 8608935e..663a415f 100644 --- a/README.md +++ b/README.md @@ -17,31 +17,46 @@ was adapted to the needs of the project at hand. | Name | Version | |------|---------| -| terraform | >= 0.12.28 | -| aws | ~> 2.70 | +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 5.35 | ## Providers | Name | Version | |------|---------| -| aws | ~> 2.70 | +| [aws](#provider\_aws) | >= 5.35 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [certbot\_lambda\_jenkins](#module\_certbot\_lambda\_jenkins) | github.com/binbashar/terraform-aws-lambda | v1.2.0 | + +## Resources + +| Name | Type | +|------|------| +| [aws_cloudwatch_event_rule.certbot_lambda_timer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource | +| [aws_cloudwatch_event_target.lets_encrypt_timer_target](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource | +| [aws_lambda_permission.permission](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource | +| [aws_s3_bucket.certificates_store](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | +| [aws_iam_policy_document.bucket_permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| certificate\_domains | Domains that will be included in the certificate | `any` | n/a | yes | -| contact\_email | Contact email for LetsEncrypt notifications | `any` | n/a | yes | -| function\_trigger\_schedule\_expression | A cron-like expression that determines when the function is triggered | `string` | `"cron(0 */12 * * ? *)"` | no | -| hosted\_zone\_id | The id of the hosted zone that will be modified to prove ownership of the domain | `any` | n/a | yes | -| name | A name for naming resources | `any` | n/a | yes | -| name\_prefix | A prefix used for naming resources | `string` | `"certbot-lambda"` | no | -| tags | Resource Tags | `map` | `{}` | no | +| [certificate\_domains](#input\_certificate\_domains) | Domains that will be included in the certificate | `any` | n/a | yes | +| [contact\_email](#input\_contact\_email) | Contact email for LetsEncrypt notifications | `any` | n/a | yes | +| [function\_trigger\_schedule\_expression](#input\_function\_trigger\_schedule\_expression) | A cron-like expression that determines when the function is triggered | `string` | `"cron(0 */12 * * ? *)"` | no | +| [hosted\_zone\_id](#input\_hosted\_zone\_id) | The id of the hosted zone that will be modified to prove ownership of the domain | `any` | n/a | yes | +| [name](#input\_name) | A name for naming resources | `any` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | A prefix used for naming resources | `string` | `"certbot-lambda"` | no | +| [tags](#input\_tags) | Resource Tags | `map` | `{}` | no | ## Outputs -No output. - +No outputs. ## Examples diff --git a/versions.tf b/versions.tf index aa1d4adc..e571e8ff 100644 --- a/versions.tf +++ b/versions.tf @@ -1,8 +1,10 @@ - terraform { - required_version = ">= 0.12.28" + required_version = ">= 1.0" required_providers { - aws = "~> 2.70" + aws = { + source = "hashicorp/aws" + version = ">= 5.35" + } } }