Skip to content
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

fix: Add missing workspace_id from importing aws_grafana_license_association #35290

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/35290.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_grafana_license_association: Fix missing `workspace_id` attribute after import
```
12 changes: 12 additions & 0 deletions internal/service/grafana/grafana_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ package grafana_test
import (
"testing"

"github.com/aws/aws-sdk-go/service/managedgrafana"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
)

func init() {
acctest.RegisterServiceErrorCheckFunc(managedgrafana.EndpointsID, testAccErrorCheckSkip)
}

func testAccErrorCheckSkip(t *testing.T) resource.ErrorCheckFunc {
return acctest.ErrorCheckSkipMessagesContaining(t,
"Active marketplace agreement not found",
)
}

func TestAccGrafana_serial(t *testing.T) {
t.Parallel()

Expand Down
1 change: 1 addition & 0 deletions internal/service/grafana/license_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func resourceLicenseAssociationRead(ctx context.Context, d *schema.ResourceData,
d.Set("license_expiration", nil)
}
d.Set("license_type", workspace.LicenseType)
d.Set("workspace_id", d.Id())

return diags
}
Expand Down
5 changes: 5 additions & 0 deletions internal/service/grafana/license_association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func testAccLicenseAssociation_freeTrial(t *testing.T) {
resource.TestCheckResourceAttrPair(resourceName, "workspace_id", workspaceResourceName, "id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down
Loading