AWS SAML Provider Tags

Hello, I’m trying to add aws_iam_saml_provider tags, but it shows me that the resource is not expecting this attribute, however in official docs it shows that it supports the tags.

Actual error:

Error: Unsupported argument

  on ../../Resources/Identity/main.tf line 46, in resource "aws_iam_saml_provider" "saml":
  46:    tags = merge(

An argument named "tags" is not expected here.

Document from official web page of Terraform:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_saml_provider#name

The following arguments are supported:

  • name - (Required) The name of the provider to create.
  • saml_metadata_document - (Required) An XML document generated by an identity provider that supports SAML 2.0.
  • tags - (Optional) Map of resource tags for the IAM SAML provider.

As well I would like to ask how to get its ARN via any data source in terraform, as I’m running this module in separate terraform plan

Hi @unity-unity!

According to the changelog, that tags argument was added in v3.34.0 of the AWS provider, and so you might need to upgrade your currently-selected AWS provider version in order to use it.

When viewing provider documentation you can change the latest string in the URL to be a particular version number in order to see what was documented for that version, in case you need to stay on an earlier version for some reason and so you want to view the docs for what’s available on that version. For example, the following URL shows the documentation for aws_iam_saml_provider in v3.33.0 where tags isn’t present yet:

https://registry.terraform.io/providers/hashicorp/aws/3.33.0/docs/resources/iam_saml_provider

1 Like

Hello, @apparentlymart! Thank you for your help, indeed I was using older version of provider, once I upgraded it, required tags was able to add. Again thank you very much