Skip to content

Commit

Permalink
resource/aws_securityhub_member: Prevent invited attribute updates du…
Browse files Browse the repository at this point in the history
…e to recent API changes (#16404)

* Update MemberStatus values to the currently available through the AWS API

* Update aws/resource_aws_securityhub_member.go

Co-authored-by: Brian Flad <bflad417@gmail.com>

* Update aws/resource_aws_securityhub_member.go

Co-authored-by: Brian Flad <bflad417@gmail.com>

Co-authored-by: Kevin Poleunis <kevin.poleunis@kbc.be>
Co-authored-by: Brian Flad <bflad417@gmail.com>
  • Loading branch information
3 people authored Nov 24, 2020
1 parent 1482cc1 commit 1b44741
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aws/resource_aws_securityhub_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ import (
)

const (
// Associated is the member status naming for regions that do not support Organizations
SecurityHubMemberStatusAssociated = "Associated"
SecurityHubMemberStatusCreated = "Created"
SecurityHubMemberStatusInvited = "Invited"
SecurityHubMemberStatusAssociated = "Associated"
SecurityHubMemberStatusResigned = "Resigned"
SecurityHubMemberStatusEnabled = "Enabled"
SecurityHubMemberStatusRemoved = "Removed"
SecurityHubMemberStatusResigned = "Resigned"
SecurityHubMemberStatusDeleted = "Deleted"
)

func resourceAwsSecurityHubMember() *schema.Resource {
Expand Down Expand Up @@ -128,7 +131,7 @@ func resourceAwsSecurityHubMemberRead(d *schema.ResourceData, meta interface{})
status := aws.StringValue(member.MemberStatus)
d.Set("member_status", status)

invited := status == SecurityHubMemberStatusInvited || status == SecurityHubMemberStatusAssociated || status == SecurityHubMemberStatusResigned
invited := status == SecurityHubMemberStatusInvited || status == SecurityHubMemberStatusEnabled || status == SecurityHubMemberStatusAssociated || status == SecurityHubMemberStatusResigned
d.Set("invite", invited)

return nil
Expand Down

0 comments on commit 1b44741

Please sign in to comment.