-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add tags argument to resource/aws_aws_organizations_organizational_unit (#15476) #15615
Conversation
Reverting changes to data_source_aws_organizations_organizational_units*
Could you add the tags to the Create action? This would allow the use of |
Not sure I understand. The tags are part of the Create action under this PR... terraform-provider-aws/aws/resource_aws_organizations_organizational_unit.go Lines 112 to 116 in 6ef6001
Are you referring to something else? |
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.
Hi @ryno75 , thank you for this PR! changes overall look great just needs a rebase and my only note is that when setting tags
on create, we can directly set those in the CreateOrganizationalUnitInput
struct rather than call the UpdateTags
(as originally suggested by @dzoeteman i believe 😄 ), tho that certainly works as well. Additionally, could you please add a .changelog/15615.txt
file w/an entry similar to https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/pullrequest-submission-and-lifecycle.md#resource-and-provider-enhancements ?
} | ||
log.Printf("[DEBUG] Organizational Unit create response: %#v", resp) | ||
|
||
// Store the ID | ||
ouId := resp.OrganizationalUnit.Id | ||
d.SetId(*ouId) | ||
|
||
if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { |
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 should alternatively add tags w/in the CreateInput struct above e.g.
if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { | |
// Create the organizational unit | |
createOpts := &organizations.CreateOrganizationalUnitInput{ | |
Name: aws.String(d.Get("name").(string)), | |
ParentId: aws.String(d.Get("parent_id").(string)), | |
Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().OrganizationsTags(), | |
} |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Closes #15476
Release note for CHANGELOG:
Output from acceptance testing: