-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
New resource & data source: aws_grafana_workspace #22874
New resource & data source: aws_grafana_workspace #22874
Conversation
I need some help with my tests:
|
internal/service/grafana/find.go
Outdated
import ( | ||
"github.com/aws/aws-sdk-go/aws" | ||
"github.com/aws/aws-sdk-go/service/managedgrafana" | ||
"github.com/hashicorp/aws-sdk-go-base/tfawserr" |
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.
You will have to make changes to the import of tfawserr
as required by #22860.
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.
Made that change. I am still getting an error on my tests, I am not sure what is wrong:
=== RUN TestAccGrafanaWorkspace_basic
=== PAUSE TestAccGrafanaWorkspace_basic
=== CONT TestAccGrafanaWorkspace_basic
=== CONT TestAccGrafanaWorkspace_basic
workspace_test.go:20: Step 1/2 error: After applying this test step, the plan was not empty.
stdout:
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_grafana_workspace.test will be updated in-place
~ resource "aws_grafana_workspace" "test" {
id = "g-717dfc8e45"
name = "tf-acc-test-7310005638429688407"
- saml_configuration_status = "NOT_CONFIGURED" -> null
- status = "ACTIVE" -> null
# (4 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccGrafanaWorkspace_basic (165.66s)
Thank you for your contribution! 🚀 Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the Additional details:
|
Thank you for your contribution! 🚀 Please note that the Remove any changes to the |
…aws_grafana_workspace
Acceptance test output: % make testacc TESTS=TestAccGrafanaWorkspace_saml PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_saml' -timeout 180m === RUN TestAccGrafanaWorkspace_saml === PAUSE TestAccGrafanaWorkspace_saml === CONT TestAccGrafanaWorkspace_saml --- PASS: TestAccGrafanaWorkspace_saml (155.85s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 159.551s
Acceptance test output: % make testacc TESTS=TestAccGrafanaWorkspace_dataSources PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_dataSources' -timeout 180m === RUN TestAccGrafanaWorkspace_dataSources === PAUSE TestAccGrafanaWorkspace_dataSources === CONT TestAccGrafanaWorkspace_dataSources --- PASS: TestAccGrafanaWorkspace_dataSources (150.78s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 154.661s
Acceptance test output: % make testacc TESTS=TestAccGrafanaWorkspace_permissionType PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_permissionType' -timeout 180m === RUN TestAccGrafanaWorkspace_permissionType === PAUSE TestAccGrafanaWorkspace_permissionType === CONT TestAccGrafanaWorkspace_permissionType --- PASS: TestAccGrafanaWorkspace_permissionType (159.83s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 163.457s
Acceptance test output: % make testacc TESTS=TestAccGrafanaWorkspace_notificationDestinations PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_notificationDestinations' -timeout 180m === RUN TestAccGrafanaWorkspace_notificationDestinations === PAUSE TestAccGrafanaWorkspace_notificationDestinations === CONT TestAccGrafanaWorkspace_notificationDestinations --- PASS: TestAccGrafanaWorkspace_notificationDestinations (169.15s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 172.963s
Acceptance test output: % make testacc TESTS=TestAccGrafanaWorkspace_organization PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_organization' -timeout 180m === RUN TestAccGrafanaWorkspace_organization === PAUSE TestAccGrafanaWorkspace_organization === CONT TestAccGrafanaWorkspace_organization acctest.go:710: this AWS account must be the management account of an AWS Organization --- SKIP: TestAccGrafanaWorkspace_organization (1.37s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 5.602s % make testacc TESTS=TestAccGrafanaWorkspace_organization PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_organization' -timeout 180m === RUN TestAccGrafanaWorkspace_organization === PAUSE TestAccGrafanaWorkspace_organization === CONT TestAccGrafanaWorkspace_organization --- PASS: TestAccGrafanaWorkspace_organization (149.87s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 153.118s
Acceptance test output: % make testacc TESTS=TestAccGrafanaWorkspace_sso PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_sso' -timeout 180m === RUN TestAccGrafanaWorkspace_sso === PAUSE TestAccGrafanaWorkspace_sso === CONT TestAccGrafanaWorkspace_sso acctest.go:731: skipping tests: AccessDeniedException: User: arn:aws:sts::123456789012:assumed-role/xyz is not authorized to perform: sso:ListInstances --- SKIP: TestAccGrafanaWorkspace_sso (5.50s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 10.984s % make testacc TESTS=TestAccGrafanaWorkspace_sso PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_sso' -timeout 180m === RUN TestAccGrafanaWorkspace_sso === PAUSE TestAccGrafanaWorkspace_sso === CONT TestAccGrafanaWorkspace_sso --- PASS: TestAccGrafanaWorkspace_sso (151.30s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 156.984s
Acceptance test output: % make testacc TESTS=TestAccGrafanaWorkspace_disappears PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_disappears' -timeout 180m === RUN TestAccGrafanaWorkspace_disappears === PAUSE TestAccGrafanaWorkspace_disappears === CONT TestAccGrafanaWorkspace_disappears --- PASS: TestAccGrafanaWorkspace_disappears (149.16s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 154.768s
…w, otherwise: % make testacc TESTS=TestAccGrafanaWorkspace_updateAuthenticationProvider PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafanaWorkspace_updateAuthenticationProvider' -timeout 180m === RUN TestAccGrafanaWorkspace_updateAuthenticationProvider === PAUSE TestAccGrafanaWorkspace_updateAuthenticationProvider === CONT TestAccGrafanaWorkspace_updateAuthenticationProvider workspace_test.go:132: Step 3/3 error: Error running apply: exit status 1 Error: error updating Grafana Workspace (g-c1118c98ae) authentication providers: ValidationException: To enable SAML you must provide the SAML configuration struct. { RespMetadata: { StatusCode: 400, RequestID: "f65d4348-0f1d-4093-ac6a-ee61531eeea2" }, Message_: "To enable SAML you must provide the SAML configuration struct." } with aws_grafana_workspace.test, on terraform_plugin_test.tf line 20, in resource "aws_grafana_workspace" "test": 20: resource "aws_grafana_workspace" "test" { --- FAIL: TestAccGrafanaWorkspace_updateAuthenticationProvider (158.85s) FAIL FAIL github.com/hashicorp/terraform-provider-aws/internal/service/grafana 164.194s FAIL make: *** [testacc] Error 1 Serialize acceptance tests. Acceptance test output: % make testacc TESTS=TestAccGrafana_serial PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafana_serial' -timeout 180m === RUN TestAccGrafana_serial === RUN TestAccGrafana_serial/Workspace === RUN TestAccGrafana_serial/Workspace/saml === RUN TestAccGrafana_serial/Workspace/sso acctest.go:731: skipping tests: AccessDeniedException: User: arn:aws:sts::187416307283:assumed-role/terraform_team1_dev-developer/[email protected] is not authorized to perform: sso:ListInstances === RUN TestAccGrafana_serial/Workspace/disappears === RUN TestAccGrafana_serial/Workspace/organization acctest.go:711: this AWS account must be the management account of an AWS Organization === RUN TestAccGrafana_serial/Workspace/dataSources === RUN TestAccGrafana_serial/Workspace/permissionType === RUN TestAccGrafana_serial/Workspace/notificationDestinations --- PASS: TestAccGrafana_serial (993.54s) --- PASS: TestAccGrafana_serial/Workspace (993.54s) --- PASS: TestAccGrafana_serial/Workspace/saml (316.99s) --- SKIP: TestAccGrafana_serial/Workspace/sso (0.42s) --- PASS: TestAccGrafana_serial/Workspace/disappears (147.69s) --- SKIP: TestAccGrafana_serial/Workspace/organization (0.32s) --- PASS: TestAccGrafana_serial/Workspace/dataSources (160.39s) --- PASS: TestAccGrafana_serial/Workspace/permissionType (185.30s) --- PASS: TestAccGrafana_serial/Workspace/notificationDestinations (182.43s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 999.459s
Acceptance test output: % make testacc TESTS=TestAccGrafana_serial/DataSource PKG=grafana ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafana_serial/DataSource' -timeout 180m === RUN TestAccGrafana_serial === RUN TestAccGrafana_serial/DataSource === RUN TestAccGrafana_serial/DataSource/basic --- PASS: TestAccGrafana_serial (183.03s) --- PASS: TestAccGrafana_serial/DataSource (183.03s) --- PASS: TestAccGrafana_serial/DataSource/basic (183.03s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 188.846s
…urrounded by blank lines'.
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.
LGTM 🚀.
Commercial
% make testacc TESTS=TestAccGrafana_serial PKG=grafana
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafana_serial' -timeout 180m
=== RUN TestAccGrafana_serial
=== RUN TestAccGrafana_serial/Workspace
=== RUN TestAccGrafana_serial/Workspace/dataSources
=== RUN TestAccGrafana_serial/Workspace/permissionType
=== RUN TestAccGrafana_serial/Workspace/notificationDestinations
=== RUN TestAccGrafana_serial/Workspace/saml
=== RUN TestAccGrafana_serial/Workspace/sso
=== RUN TestAccGrafana_serial/Workspace/disappears
=== RUN TestAccGrafana_serial/Workspace/organization
=== RUN TestAccGrafana_serial/DataSource
=== RUN TestAccGrafana_serial/DataSource/basic
--- PASS: TestAccGrafana_serial (1328.09s)
--- PASS: TestAccGrafana_serial/Workspace (1182.73s)
--- PASS: TestAccGrafana_serial/Workspace/dataSources (155.28s)
--- PASS: TestAccGrafana_serial/Workspace/permissionType (225.56s)
--- PASS: TestAccGrafana_serial/Workspace/notificationDestinations (169.48s)
--- PASS: TestAccGrafana_serial/Workspace/saml (180.94s)
--- PASS: TestAccGrafana_serial/Workspace/sso (154.15s)
--- PASS: TestAccGrafana_serial/Workspace/disappears (145.36s)
--- PASS: TestAccGrafana_serial/Workspace/organization (151.96s)
--- PASS: TestAccGrafana_serial/DataSource (145.36s)
--- PASS: TestAccGrafana_serial/DataSource/basic (145.36s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 1331.810s
GovCloud
% make testacc TESTS=TestAccGrafana_serial PKG=grafana
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccGrafana_serial' -timeout 180m
=== RUN TestAccGrafana_serial
=== RUN TestAccGrafana_serial/DataSource
=== RUN TestAccGrafana_serial/DataSource/basic
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
=== RUN TestAccGrafana_serial/Workspace
=== RUN TestAccGrafana_serial/Workspace/disappears
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
=== RUN TestAccGrafana_serial/Workspace/organization
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
=== RUN TestAccGrafana_serial/Workspace/dataSources
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
=== RUN TestAccGrafana_serial/Workspace/permissionType
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
=== RUN TestAccGrafana_serial/Workspace/notificationDestinations
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
=== RUN TestAccGrafana_serial/Workspace/saml
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
=== RUN TestAccGrafana_serial/Workspace/sso
acctest.go:610: skipping tests; partition aws-us-gov does not support grafana service
--- PASS: TestAccGrafana_serial (1.03s)
--- PASS: TestAccGrafana_serial/DataSource (1.03s)
--- SKIP: TestAccGrafana_serial/DataSource/basic (1.03s)
--- PASS: TestAccGrafana_serial/Workspace (0.00s)
--- SKIP: TestAccGrafana_serial/Workspace/disappears (0.00s)
--- SKIP: TestAccGrafana_serial/Workspace/organization (0.00s)
--- SKIP: TestAccGrafana_serial/Workspace/dataSources (0.00s)
--- SKIP: TestAccGrafana_serial/Workspace/permissionType (0.00s)
--- SKIP: TestAccGrafana_serial/Workspace/notificationDestinations (0.00s)
--- SKIP: TestAccGrafana_serial/Workspace/saml (0.00s)
--- SKIP: TestAccGrafana_serial/Workspace/sso (0.00s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/grafana 4.776s
@AlexanderSchiff Thanks for the contribution 🎉 👏.
|
This functionality has been released in v4.2.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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 #16789
Output from acceptance testing: