Search code examples
amazon-web-servicesterraformamazon-iamterraform-provider-awsamazon-quicksight

How can update a resource made outside of terraform via terraform?


AWS Quicksight has a built in default role aws-quicksight-service-role-v0 which does not have any policy attached to it. Knowing its ARN, I want to attach policies to the role via terraform. How can I achieve this? In other words, how can I import a manually/automatically created resource outside terraform, into terraform?


Solution

  • In my particular case, the below reference helped to pick the role by name and attach needed policies to it. As explained it works per policy, meaning you need to pick one policy at a time and attach it to as many roles or users you want. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment