Closed muhammadasgharaliqureshi closed 1 year ago
+1
+1
+1
This is because AWS has released provider version 5.x and it has some breaking changes (major change)
To resolve it, change your AWS provider (probably in providers.tf
)
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.67.0"
}
}
}
provider "aws" {
# Configuration options
}
and then run terraform init -upgrade
and it should be fine
Upgrading the provider won't help I am still getting
╷
│ Error: Unsupported argument
│
│ on .terraform/modules/elasticache_redis.elasticache-redis/main.tf line 125, in resource "aws_elasticache_replication_group" "default":
│ 125: availability_zones = length(var.availability_zones) == 0 ? null : [for n in range(0, var.cluster_size) : element(var.availability_zones, n)]
│
│ An argument named "availability_zones" is not expected here.
╵
I have tried to replace availability_zones
with preferred_cache_cluster_azs
as mentioned in the issue-197 but then getting
╷
│ Error: Unsupported argument
│
│ on ../../modules/elastic-cache/main.tf line 22, in module "elasticache-redis":
│ 22: preferred_cache_cluster_azs = var.availability_zones
│
│ An argument named "preferred_cache_cluster_azs" is not expected here.
╵
If you happen to use Terragrunt, you can overwrite this module's version-contraint, so the aws
module stays below 5.x
(as per the comment above):
terraform {
source = "git::https://github.com/cloudposse/terraform-aws-elasticache-redis//.?ref=0.51.0"
}
generate "versions" {
path = "versions.tf"
if_exists = "overwrite"
contents = <<-EOF
terraform {
required_version = ">= 0.14.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.18"
}
}
}
EOF
}
locals {...}
inputs = {...}
Thanks @milldr yes looks good now, closing this issue now.
Describe the Bug
In module code at line 25 we have
for terraform resource
aws_elasticache_replication_group
but this argument is no more available for terraform resource aws_elasticcache_replication_group hereExpected Behavior
Terraform validate and terraform apply should work on module example
Steps to Reproduce
Just try running following module example https://github.com/cloudposse/terraform-aws-elasticache-redis/tree/main/examples/complete
Screenshots
Environment
Additional Context
No response