From 1b447411e0b4544911ab34c3e15dbbb09d0a90c1 Mon Sep 17 00:00:00 2001 From: reactiveinactive <48753642+reactiveinactive@users.noreply.github.com> Date: Tue, 24 Nov 2020 22:12:41 +0100 Subject: [PATCH] resource/aws_securityhub_member: Prevent invited attribute updates due 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 * Update aws/resource_aws_securityhub_member.go Co-authored-by: Brian Flad Co-authored-by: Kevin Poleunis Co-authored-by: Brian Flad --- aws/resource_aws_securityhub_member.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_securityhub_member.go b/aws/resource_aws_securityhub_member.go index 9c02b7bbe83..5af714e0109 100644 --- a/aws/resource_aws_securityhub_member.go +++ b/aws/resource_aws_securityhub_member.go @@ -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 { @@ -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