Skip to content

Commit

Permalink
Replace Terraform with Pulumi to stop eliding iam.PolicyAttachment do…
Browse files Browse the repository at this point in the history
…cs (#4882)

The `iam.PolicyAttachment` resource assumes exclusive management of IAM
policies. Across the entire AWS account, all of the users/roles/groups
to which a single policy is attached must be declared by a single
`iam.PolicyAttachment` resource. This means that even any
users/roles/groups that have the attached policy via any other mechanism
(including other Pulumi resources) will have that attached policy
revoked by this resource when it's deleted.

This is quite surprising to users, especially because there's no mention
of it in the [Pulumi
docs](https://www.pulumi.com/registry/packages/aws/api-docs/iam/policyattachment).

The [warnings from the upstream
provider](https://registry.terraform.io/providers/hashicorp/aws/5.78.0/docs/resources/iam_policy_attachment)
were not carried into Pulumi docs because they included `Terraform` and
were elided. This fixes it.

Fixes #4872
Relates to pulumi/pulumi-terraform-bridge#2251
  • Loading branch information
flostadler authored Dec 4, 2024
1 parent 3526e4b commit 1fde217
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-resource-aws/schema.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions provider/doc_edits.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func editRules(defaults []tfbridge.DocsEdit) []tfbridge.DocsEdit {
" `pulumi up --refresh`."+
" See [#4766](https://github.com/pulumi/pulumi-aws/issues/4766)"+
" for tracking making this work with regular `pulumi up`"),

targetedSimpleReplace("iam_policy_attachment.html.markdown", "Terraform", "Pulumi"),
)
}

Expand Down
10 changes: 10 additions & 0 deletions sdk/dotnet/Iam/PolicyAttachment.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sdk/go/aws/iam/policyAttachment.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sdk/java/src/main/java/com/pulumi/aws/iam/PolicyAttachment.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sdk/nodejs/iam/policyAttachment.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions sdk/python/pulumi_aws/iam/policy_attachment.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1fde217

Please sign in to comment.