I have created IAM policies using terraform and i want to use them later by cherry picking them and attaching them to IAM roles later.The problem am facing is how to get the ARN dynamically by using the data source and passing the policy name.As per the documentation the datasource supports only policy arn as input.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/1a7952f4-67bf-43e2-bb43-263aba7757bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
So what you could do is, use a data aws_caller_identity in order to dynamically generate the arn. It doesn’t need any args and you can use its outputs of account ID, region, etc. to interpolate them into a string (your arm). Which would then just require you to know the policy name.
On Sun, Apr 28, 2019 at 3:24 AM <varad...@gmail.com> wrote:
I have created IAM policies using terraform and i want to use them later by cherry picking them and attaching them to IAM roles later.The problem am facing is how to get the ARN dynamically by using the data source and passing the policy name.--As per the documentation the datasource supports only policy arn as input.
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terrafo...@googlegroups.com.