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 ...@@ -27,3 +27,5 @@ override.tf.json
# Ignore CLI configuration files # Ignore CLI configuration files
.terraformrc .terraformrc
terraform.rc terraform.rc
*.zip
repos: repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform - repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.3 rev: v1.64.0
hooks: hooks:
- id: terraform_fmt - id: terraform_fmt
- id: terraform_validate - id: terraform_validate
......
...@@ -108,13 +108,13 @@ inputs = { ...@@ -108,13 +108,13 @@ inputs = {
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 ## Providers
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.69 | | <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.69 |
## Modules ## Modules
......
...@@ -30,14 +30,14 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -30,14 +30,14 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 | | <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers ## Providers
| Name | Version | | 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 | | <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules ## 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 { locals {
bucket_name = "s3-bucket-${random_pet.this.id}" bucket_name = "s3-bucket-${random_pet.this.id}"
region = "eu-west-1"
} }
data "aws_canonical_user_id" "current" {} data "aws_canonical_user_id" "current" {}
......
...@@ -2,7 +2,13 @@ terraform { ...@@ -2,7 +2,13 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.60" aws = {
random = ">= 2.0" 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 ...@@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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_null"></a> [null](#requirement\_null) | >= 2.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 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 ...@@ -28,7 +28,7 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | 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_null"></a> [null](#provider\_null) | >= 2.0 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 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 { locals {
bucket_name = "s3-bucket-${random_pet.this.id}" bucket_name = "s3-bucket-${random_pet.this.id}"
region = "eu-west-1"
} }
resource "random_pet" "this" { resource "random_pet" "this" {
......
...@@ -2,8 +2,17 @@ terraform { ...@@ -2,8 +2,17 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.50" aws = {
random = ">= 2.0" source = "hashicorp/aws"
null = ">= 2.0" 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 ...@@ -20,14 +20,14 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 | | <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers ## Providers
| Name | Version | | 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 | | <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules ## Modules
......
provider "aws" { provider "aws" {
region = "eu-west-1" region = local.region
# Make it faster by skipping something # Make it faster by skipping something
skip_get_ec2_platforms = true skip_get_ec2_platforms = true
...@@ -9,6 +9,10 @@ provider "aws" { ...@@ -9,6 +9,10 @@ provider "aws" {
skip_requesting_account_id = true skip_requesting_account_id = true
} }
locals {
region = "eu-west-1"
}
module "object" { module "object" {
source = "../../modules/object" source = "../../modules/object"
......
...@@ -2,7 +2,13 @@ terraform { ...@@ -2,7 +2,13 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.50" aws = {
random = ">= 2.0" 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 ...@@ -22,15 +22,15 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 | | <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
## Providers ## Providers
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 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_aws.replica"></a> [aws.replica](#provider\_aws.replica) | ~> 3.69 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 | | <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
## Modules ## 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" { provider "aws" {
region = local.origin_region 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" { provider "aws" {
region = local.replica_region region = local.replica_region
alias = "replica" 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" {} data "aws_caller_identity" "current" {}
......
...@@ -2,7 +2,13 @@ terraform { ...@@ -2,7 +2,13 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.69" aws = {
random = ">= 2.0" 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: ...@@ -8,13 +8,13 @@ Creates S3 bucket notification resource with all supported types of deliveries:
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 ## Providers
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.28 | | <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.28 |
## Modules ## Modules
......
...@@ -75,7 +75,7 @@ data "aws_arn" "queue" { ...@@ -75,7 +75,7 @@ data "aws_arn" "queue" {
} }
data "aws_iam_policy_document" "sqs" { 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 { statement {
sid = "AllowSQSS3BucketNotification" sid = "AllowSQSS3BucketNotification"
...@@ -102,7 +102,7 @@ data "aws_iam_policy_document" "sqs" { ...@@ -102,7 +102,7 @@ data "aws_iam_policy_document" "sqs" {
} }
resource "aws_sqs_queue_policy" "allow" { 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)) queue_url = lookup(each.value, "queue_id", lookup(local.queue_ids, each.key, null))
policy = data.aws_iam_policy_document.sqs[each.key].json policy = data.aws_iam_policy_document.sqs[each.key].json
...@@ -110,7 +110,7 @@ resource "aws_sqs_queue_policy" "allow" { ...@@ -110,7 +110,7 @@ resource "aws_sqs_queue_policy" "allow" {
# SNS Topic # SNS Topic
data "aws_iam_policy_document" "sns" { 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 { statement {
sid = "AllowSNSS3BucketNotification" sid = "AllowSNSS3BucketNotification"
...@@ -137,7 +137,7 @@ data "aws_iam_policy_document" "sns" { ...@@ -137,7 +137,7 @@ data "aws_iam_policy_document" "sns" {
} }
resource "aws_sns_topic_policy" "allow" { 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 arn = each.value.topic_arn
policy = data.aws_iam_policy_document.sns[each.key].json policy = data.aws_iam_policy_document.sns[each.key].json
......
...@@ -2,6 +2,9 @@ terraform { ...@@ -2,6 +2,9 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.28" aws = {
source = "hashicorp/aws"
version = "~> 3.28"
}
} }
} }
...@@ -8,13 +8,13 @@ Creates S3 bucket objects with different configurations. ...@@ -8,13 +8,13 @@ Creates S3 bucket objects with different configurations.
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | <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 ## Providers
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.36 | | <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.36 |
## Modules ## Modules
......
...@@ -2,6 +2,9 @@ terraform { ...@@ -2,6 +2,9 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { required_providers {
aws = ">= 3.36" aws = {
source = "hashicorp/aws"
version = "~> 3.36"
}
} }
} }
...@@ -2,6 +2,9 @@ terraform { ...@@ -2,6 +2,9 @@ terraform {
required_version = ">= 0.13.1" required_version = ">= 0.13.1"
required_providers { 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