Commit 7dd9a655 authored by Bryant Biggs's avatar Bryant Biggs Committed by GitHub

fix: Pin version to v3 due to number of breaking changes in v4 (#136)

Co-authored-by: default avatarAnton Babenko <anton@antonbabenko.com>
parent 3ca2f30d
......@@ -27,3 +27,5 @@ override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc
*.zip
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.3
rev: v1.64.0
hooks:
- id: terraform_fmt
- id: terraform_validate
......
......@@ -108,13 +108,13 @@ inputs = {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.69 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.69 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.69 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.69 |
## Modules
......
......@@ -30,14 +30,14 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.60 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.69 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.60 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.69 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules
......
provider "aws" {
region = local.region
# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}
locals {
bucket_name = "s3-bucket-${random_pet.this.id}"
region = "eu-west-1"
}
data "aws_canonical_user_id" "current" {}
......
......@@ -2,7 +2,13 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.60"
random = ">= 2.0"
aws = {
source = "hashicorp/aws"
version = "~> 3.69"
}
random = {
source = "hashicorp/random"
version = ">= 2.0"
}
}
}
......@@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.50 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.69 |
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 2.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
......@@ -28,7 +28,7 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.69 |
| <a name="provider_null"></a> [null](#provider\_null) | >= 2.0 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
......
provider "aws" {
region = local.region
# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}
locals {
bucket_name = "s3-bucket-${random_pet.this.id}"
region = "eu-west-1"
}
resource "random_pet" "this" {
......
......@@ -2,8 +2,17 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.50"
random = ">= 2.0"
null = ">= 2.0"
aws = {
source = "hashicorp/aws"
version = "~> 3.69"
}
random = {
source = "hashicorp/random"
version = ">= 2.0"
}
null = {
source = "hashicorp/null"
version = ">= 2.0"
}
}
}
......@@ -20,14 +20,14 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.50 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.69 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.50 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.69 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules
......
provider "aws" {
region = "eu-west-1"
region = local.region
# Make it faster by skipping something
skip_get_ec2_platforms = true
......@@ -9,6 +9,10 @@ provider "aws" {
skip_requesting_account_id = true
}
locals {
region = "eu-west-1"
}
module "object" {
source = "../../modules/object"
......
......@@ -2,7 +2,13 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.50"
random = ">= 2.0"
aws = {
source = "hashicorp/aws"
version = "~> 3.69"
}
random = {
source = "hashicorp/random"
version = ">= 2.0"
}
}
}
......@@ -22,15 +22,15 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.69 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.69 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.69 |
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | >= 3.69 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.69 |
| <a name="provider_aws.replica"></a> [aws.replica](#provider\_aws.replica) | ~> 3.69 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules
......
locals {
bucket_name = "origin-s3-bucket-${random_pet.this.id}"
destination_bucket_name = "replica-s3-bucket-${random_pet.this.id}"
origin_region = "eu-west-1"
replica_region = "eu-central-1"
}
provider "aws" {
region = local.origin_region
# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}
provider "aws" {
region = local.replica_region
alias = "replica"
# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
skip_requesting_account_id = true
}
locals {
bucket_name = "origin-s3-bucket-${random_pet.this.id}"
destination_bucket_name = "replica-s3-bucket-${random_pet.this.id}"
origin_region = "eu-west-1"
replica_region = "eu-central-1"
}
data "aws_caller_identity" "current" {}
......
......@@ -2,7 +2,13 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.69"
random = ">= 2.0"
aws = {
source = "hashicorp/aws"
version = "~> 3.69"
}
random = {
source = "hashicorp/random"
version = ">= 2.0"
}
}
}
......@@ -8,13 +8,13 @@ Creates S3 bucket notification resource with all supported types of deliveries:
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.28 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.28 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.28 |
## Modules
......
......@@ -75,7 +75,7 @@ data "aws_arn" "queue" {
}
data "aws_iam_policy_document" "sqs" {
for_each = var.create_sqs_policy ? var.sqs_notifications : tomap({})
for_each = { for k, v in var.sqs_notifications : k => v if var.create_sqs_policy }
statement {
sid = "AllowSQSS3BucketNotification"
......@@ -102,7 +102,7 @@ data "aws_iam_policy_document" "sqs" {
}
resource "aws_sqs_queue_policy" "allow" {
for_each = var.create_sqs_policy ? var.sqs_notifications : tomap({})
for_each = { for k, v in var.sqs_notifications : k => v if var.create_sqs_policy }
queue_url = lookup(each.value, "queue_id", lookup(local.queue_ids, each.key, null))
policy = data.aws_iam_policy_document.sqs[each.key].json
......@@ -110,7 +110,7 @@ resource "aws_sqs_queue_policy" "allow" {
# SNS Topic
data "aws_iam_policy_document" "sns" {
for_each = var.create_sns_policy ? var.sns_notifications : tomap({})
for_each = { for k, v in var.sns_notifications : k => v if var.create_sns_policy }
statement {
sid = "AllowSNSS3BucketNotification"
......@@ -137,7 +137,7 @@ data "aws_iam_policy_document" "sns" {
}
resource "aws_sns_topic_policy" "allow" {
for_each = var.create_sns_policy ? var.sns_notifications : tomap({})
for_each = { for k, v in var.sns_notifications : k => v if var.create_sns_policy }
arn = each.value.topic_arn
policy = data.aws_iam_policy_document.sns[each.key].json
......
......@@ -2,6 +2,9 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.28"
aws = {
source = "hashicorp/aws"
version = "~> 3.28"
}
}
}
......@@ -8,13 +8,13 @@ Creates S3 bucket objects with different configurations.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.36 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.36 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.36 |
## Modules
......
......@@ -2,6 +2,9 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.36"
aws = {
source = "hashicorp/aws"
version = "~> 3.36"
}
}
}
......@@ -2,6 +2,9 @@ terraform {
required_version = ">= 0.13.1"
required_providers {
aws = ">= 3.69"
aws = {
source = "hashicorp/aws"
version = "~> 3.69"
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment