-
Notifications
You must be signed in to change notification settings - Fork 9.8k
new resource aws_iam_outbound_web_identity_federation
#45217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
new resource aws_iam_outbound_web_identity_federation
#45217
Conversation
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
872ebfb to
fe8012e
Compare
| @@ -0,0 +1,3 @@ | |||
| ```release-note:new-resource | |||
| aws_iam_outbound_web_identity_federation | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to call this aws_iam_outbound_web_identity_federation_status to make it clear that this resource is only about turning it off/on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually follow the API Action to name resources.
|
|
||
| You cannot import this resource. | ||
|
|
||
| ~> **NOTE:** This resource will adopt the IAM Outbound Web Identity Federation setting in the account if this setting is already enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way to store in the state the previous state of this setting?
My worry would be a situation where:
- t=0: outbound federation is enabled.
- t=1: the resource aws_iam_outbound_web_identity_federation is created to enable the setting
- t=2: the resource is destroyed
current behavior: outbound federation is disabled
my (expected) behavior: outbound federation is preserved to its pre-existing state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@christophetd once you import a resource (or adopt in this case) to Terraform, from that point, it will be managed by Terraform.
My implementation, without the enabled argument, was to avoid the need to import the resource for practitioners that already enabled this setting.
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| resource "aws_iam_outbound_web_identity_federation" "example" {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this needs a boolean to state whether the intent is to enable or disable it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to change the implementation and add the enabled argument . However, this will require also adding import.
In this case this setting was enabled outside terraform, then you would need to import its setting to terraform state otherwise you will get an error when terraform try to enable it again.
christophetd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As someone interested by this feature (and by no means a Terraform core contributor), I left a few comments. I also think we need a data source to retrieve the issuer_identifier of a specific account ID, and possible retrieve the status of iam outbound federation in the account
|
@ewbankkit @justinretzolk can you please let me know if I should change this implementation with |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
Introduce a new Terraform resource to manage the IAM “Outbound Web Identity Federation” account setting.
aws_iam_outbound_web_identity_federationissuer_identifierandjwt_vending_enabledas per APIUsage
Notes
This resource is intentionally stateful for a binary account-level toggle. It follows the provider pattern for similar account settings where the presence of the resource enforces “enabled,” and its absence enforces “disabled.”
Relations
Closes #45146
References
Output from Acceptance Testing