Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade TF version #6

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -75,7 +73,7 @@ jobs:

- run:
name: test-terraform-linting
command: make tflint-deep
command: make tflint

- slack/notify:
event: fail
Expand Down Expand Up @@ -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:
Expand All @@ -170,7 +168,7 @@ jobs:

- run:
name: Install awscli
command: sudo pip install awscli
command: sudo -H pip3 install awscli

- run:
name: Configure awscli
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:'
Expand All @@ -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
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,46 @@ was adapted to the needs of the project at hand.

| Name | Version |
|------|---------|
| terraform | >= 0.12.28 |
| aws | ~> 2.70 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.35 |

## Providers

| Name | Version |
|------|---------|
| aws | ~> 2.70 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.35 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_certbot_lambda_jenkins"></a> [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 |
| <a name="input_certificate_domains"></a> [certificate\_domains](#input\_certificate\_domains) | Domains that will be included in the certificate | `any` | n/a | yes |
| <a name="input_contact_email"></a> [contact\_email](#input\_contact\_email) | Contact email for LetsEncrypt notifications | `any` | n/a | yes |
| <a name="input_function_trigger_schedule_expression"></a> [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 |
| <a name="input_hosted_zone_id"></a> [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 |
| <a name="input_name"></a> [name](#input\_name) | A name for naming resources | `any` | n/a | yes |
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | A prefix used for naming resources | `string` | `"certbot-lambda"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Resource Tags | `map` | `{}` | no |

## Outputs

No output.

No outputs.
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Examples
Expand Down
8 changes: 5 additions & 3 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -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"
}
}
}