skip to Main Content

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?

3

Answers


  1. Chosen as BEST ANSWER

    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


  2. To work with resources already existing use data-sources:
    https://www.terraform.io/language/data-sources

    Login or Signup to reply.
  3. If you just want to add a new policy to an existing IAM role and you know its ARN, you don’t have to import it. You can just use aws_iam_role_policy to define and add the policy that you want to pre-existing role.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search