Attach an existing policy to an existing role in CloudFormation

0

How can a CloudFormation template attach an existing Policy to an existing Role?

From what I see we can:

...but seems like maybe you'd need to resort to a custom resource for the case where both already exist?

For my use case, a solution with either Inline or Managed policies would be fine.

1 Risposta
0
Risposta accettata

This is not possible in CloudFormation today as there is no such resource. Also, if we consider CloudFormation had a resource to do this, it would just be a logical resource that attaches a policy to a role, just like how we have route to route table attachment. So your options are

  1. Use custom resource or
  2. Create a new role and attach an existing policy to it or
  3. Create a new policy and attach it to an existing role or
  4. Create both in CloudFormation
AWS
con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande