Commit 624cbcc1 authored by Anton Babenko's avatar Anton Babenko Committed by GitHub

fix: Update syntax for Terraform 0.15 (#71)

parent 8085fb17
...@@ -3,6 +3,7 @@ repos: ...@@ -3,6 +3,7 @@ repos:
rev: v1.46.0 rev: v1.46.0
hooks: hooks:
- id: terraform_fmt - id: terraform_fmt
- id: terraform_validate
- id: terraform_docs - id: terraform_docs
- id: terraform_tflint - id: terraform_tflint
args: args:
......
...@@ -84,7 +84,7 @@ module "s3_bucket" { ...@@ -84,7 +84,7 @@ module "s3_bucket" {
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| terraform | >= 0.12.6 | | terraform | >= 0.12.26 |
| aws | >= 3.0 | | aws | >= 3.0 |
## Providers ## Providers
...@@ -101,11 +101,11 @@ No Modules. ...@@ -101,11 +101,11 @@ No Modules.
| Name | | Name |
|------| |------|
| [aws_elb_service_account](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/data-sources/elb_service_account) | | [aws_elb_service_account](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/elb_service_account) |
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/data-sources/iam_policy_document) | | [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) |
| [aws_s3_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/s3_bucket_policy) | | [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) |
| [aws_s3_bucket_public_access_block](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/s3_bucket_public_access_block) | | [aws_s3_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) |
| [aws_s3_bucket](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/s3_bucket) | | [aws_s3_bucket_public_access_block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) |
## Inputs ## Inputs
......
...@@ -29,15 +29,15 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -29,15 +29,15 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| terraform | >= 0.12.6, < 0.14 | | terraform | >= 0.12.26 |
| aws | >= 3.0, < 4.0 | | aws | >= 3.0 |
| random | ~> 2 | | random | ~> 2 |
## Providers ## Providers
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| aws | >= 3.0, < 4.0 | | aws | >= 3.0 |
| random | ~> 2 | | random | ~> 2 |
## Modules ## Modules
...@@ -52,11 +52,11 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -52,11 +52,11 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | | Name |
|------| |------|
| [aws_canonical_user_id](https://registry.terraform.io/providers/hashicorp/aws/4.0/docs/data-sources/canonical_user_id) | | [aws_canonical_user_id](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/canonical_user_id) |
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/4.0/docs/data-sources/iam_policy_document) | | [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) |
| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/4.0/docs/resources/iam_role) | | [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) |
| [aws_kms_key](https://registry.terraform.io/providers/hashicorp/aws/4.0/docs/resources/kms_key) | | [aws_kms_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) |
| [random_pet](https://registry.terraform.io/providers/hashicorp/random/2/docs/resources/pet) | | [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) |
## Inputs ## Inputs
......
terraform { terraform {
required_version = ">= 0.12.6, < 0.14" required_version = ">= 0.12.26"
required_providers { required_providers {
aws = ">= 3.0, < 4.0" aws = ">= 3.0"
random = "~> 2" random = "~> 2"
} }
} }
...@@ -19,7 +19,7 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -19,7 +19,7 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| terraform | >= 0.12.6 | | terraform | >= 0.12.26 |
| aws | >= 3.0 | | aws | >= 3.0 |
| null | >= 2 | | null | >= 2 |
| random | >= 2 | | random | >= 2 |
...@@ -47,12 +47,12 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -47,12 +47,12 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | | Name |
|------| |------|
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/data-sources/iam_policy_document) | | [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) |
| [aws_sqs_queue_policy](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/sqs_queue_policy) | | [aws_sqs_queue](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue) |
| [aws_sqs_queue](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/sqs_queue) | | [aws_sqs_queue_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue_policy) |
| [null_data_source](https://registry.terraform.io/providers/hashicorp/null/2/docs/data-sources/data_source) | | [null_data_source](https://registry.terraform.io/providers/hashicorp/null/latest/docs/data-sources/data_source) |
| [null_resource](https://registry.terraform.io/providers/hashicorp/null/2/docs/resources/resource) | | [null_resource](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) |
| [random_pet](https://registry.terraform.io/providers/hashicorp/random/2/docs/resources/pet) | | [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) |
## Inputs ## Inputs
......
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 0.12.26"
required_providers { required_providers {
aws = ">= 3.0" aws = ">= 3.0"
......
...@@ -21,7 +21,7 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -21,7 +21,7 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| terraform | >= 0.12.6 | | terraform | >= 0.12.26 |
| aws | >= 3.0 | | aws | >= 3.0 |
| random | >= 2.0 | | random | >= 2.0 |
...@@ -44,12 +44,12 @@ Note that this example may create resources which cost money. Run `terraform des ...@@ -44,12 +44,12 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | | Name |
|------| |------|
| [aws_caller_identity](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/data-sources/caller_identity) | | [aws_caller_identity](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |
| [aws_iam_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/iam_policy_attachment) | | [aws_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) |
| [aws_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/iam_policy) | | [aws_iam_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy_attachment) |
| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/iam_role) | | [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) |
| [aws_kms_key](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/kms_key) | | [aws_kms_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) |
| [random_pet](https://registry.terraform.io/providers/hashicorp/random/2.0/docs/resources/pet) | | [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) |
## Inputs ## Inputs
......
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 0.12.26"
required_providers { required_providers {
aws = ">= 3.0" aws = ">= 3.0"
......
...@@ -25,12 +25,12 @@ No Modules. ...@@ -25,12 +25,12 @@ No Modules.
| Name | | Name |
|------| |------|
| [aws_arn](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/data-sources/arn) | | [aws_arn](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) |
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/data-sources/iam_policy_document) | | [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) |
| [aws_lambda_permission](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/lambda_permission) | | [aws_lambda_permission](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) |
| [aws_s3_bucket_notification](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/s3_bucket_notification) | | [aws_s3_bucket_notification](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_notification) |
| [aws_sns_topic_policy](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/sns_topic_policy) | | [aws_sns_topic_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_policy) |
| [aws_sqs_queue_policy](https://registry.terraform.io/providers/hashicorp/aws/3.0/docs/resources/sqs_queue_policy) | | [aws_sqs_queue_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue_policy) |
## Inputs ## Inputs
......
output "this_s3_bucket_id" { output "this_s3_bucket_id" {
description = "The name of the bucket." description = "The name of the bucket."
value = element(concat(aws_s3_bucket_policy.this.*.id, aws_s3_bucket.this.*.id, list("")), 0) value = element(concat(aws_s3_bucket_policy.this.*.id, aws_s3_bucket.this.*.id, [""]), 0)
} }
output "this_s3_bucket_arn" { output "this_s3_bucket_arn" {
description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname."
value = element(concat(aws_s3_bucket.this.*.arn, list("")), 0) value = element(concat(aws_s3_bucket.this.*.arn, [""]), 0)
} }
output "this_s3_bucket_bucket_domain_name" { output "this_s3_bucket_bucket_domain_name" {
description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com." description = "The bucket domain name. Will be of format bucketname.s3.amazonaws.com."
value = element(concat(aws_s3_bucket.this.*.bucket_domain_name, list("")), 0) value = element(concat(aws_s3_bucket.this.*.bucket_domain_name, [""]), 0)
} }
output "this_s3_bucket_bucket_regional_domain_name" { output "this_s3_bucket_bucket_regional_domain_name" {
description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL." description = "The bucket region-specific domain name. The bucket domain name including the region name, please refer here for format. Note: The AWS CloudFront allows specifying S3 region-specific endpoint when creating S3 origin, it will prevent redirect issues from CloudFront to S3 Origin URL."
value = element(concat(aws_s3_bucket.this.*.bucket_regional_domain_name, list("")), 0) value = element(concat(aws_s3_bucket.this.*.bucket_regional_domain_name, [""]), 0)
} }
output "this_s3_bucket_hosted_zone_id" { output "this_s3_bucket_hosted_zone_id" {
description = "The Route 53 Hosted Zone ID for this bucket's region." description = "The Route 53 Hosted Zone ID for this bucket's region."
value = element(concat(aws_s3_bucket.this.*.hosted_zone_id, list("")), 0) value = element(concat(aws_s3_bucket.this.*.hosted_zone_id, [""]), 0)
} }
output "this_s3_bucket_region" { output "this_s3_bucket_region" {
description = "The AWS region this bucket resides in." description = "The AWS region this bucket resides in."
value = element(concat(aws_s3_bucket.this.*.region, list("")), 0) value = element(concat(aws_s3_bucket.this.*.region, [""]), 0)
} }
output "this_s3_bucket_website_endpoint" { output "this_s3_bucket_website_endpoint" {
description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string." description = "The website endpoint, if the bucket is configured with a website. If not, this will be an empty string."
value = element(concat(aws_s3_bucket.this.*.website_endpoint, list("")), 0) value = element(concat(aws_s3_bucket.this.*.website_endpoint, [""]), 0)
} }
output "this_s3_bucket_website_domain" { output "this_s3_bucket_website_domain" {
description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. " description = "The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records. "
value = element(concat(aws_s3_bucket.this.*.website_domain, list("")), 0) value = element(concat(aws_s3_bucket.this.*.website_domain, [""]), 0)
} }
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 0.12.26"
required_providers { required_providers {
aws = ">= 3.0" aws = ">= 3.0"
......
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