cloudposse / terraform-aws-iam-policy

Create an IAM policy from Terraform input
https://cloudposse.com/accelerate
Apache License 2.0
19 stars 15 forks source link

`source_json` is deprecated. Use the attribute "source_policy_documents" instead. #12

Closed johncblandii closed 2 years ago

johncblandii commented 2 years ago

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Looks like the module is using a deprecated property. I've seen this a few times now through different modules that use it.

│ Warning: Argument is deprecated
│ 
│   with module.aws_node_termination_handler.module.eks_iam_policy.data.aws_iam_policy_document.this,
│   on .terraform-trmd/modules/aws_node_termination_handler.eks_iam_policy/main.tf line 17, in data "aws_iam_policy_document" "this":
│   17:   source_json = var.iam_source_json_url != null ? data.http.iam_source_json_url[0].body : var.iam_source_json
│ 
│ Use the attribute "source_policy_documents" instead.

Expected Behavior

It still works. This is just a deprecation message.

Steps to Reproduce

I see this mostly through cloudposse/helm-release.

module "aws_node_termination_handler" {
  source  = "cloudposse/helm-release/aws"
  version = "0.4.3"

  name                 = "" # avoids hitting length restrictions on IAM Role names
  chart                = var.chart
  repository           = var.chart_repository
  description          = var.chart_description
  chart_version        = var.chart_version
  kubernetes_namespace = var.kubernetes_namespace
  create_namespace     = var.create_namespace
  wait                 = var.wait
  atomic               = var.atomic
  cleanup_on_fail      = var.cleanup_on_fail
  timeout              = var.timeout

  ...
}

Screenshots

N/A

Environment (please complete the following information):

Any

Additional Context

N/A

nitrocode commented 2 years ago

This deprecation comes from using the 4.x aws provider. To avoid this issue, you can pin the aws version to 3.x for now until we are ready to bump this repo to enforce the 4.x or greater aws provider