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

Grafana: migrate to AWS SDK v2 #37831

Merged
merged 205 commits into from
Jun 28, 2024
Merged

Grafana: migrate to AWS SDK v2 #37831

merged 205 commits into from
Jun 28, 2024

Conversation

aristosvo
Copy link
Contributor

@aristosvo aristosvo commented Jun 4, 2024

Description

Relations

Closes #36185
Required for #37808, #37645

References

#32976

Output from Acceptance Testing (last run before rebase from main + failing test after)

% make testacc TESTS=TestAccXXX PKG=grafana
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/grafana/... -v -count 1 -parallel 20   -timeout 360m
=== RUN   TestAccGrafana_serial
=== PAUSE TestAccGrafana_serial
=== RUN   TestEndpointConfiguration
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_alias_name_0_config
=== RUN   TestEndpointConfiguration/service_aws_envvar
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_aws_service_envvar
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_envvar
=== RUN   TestEndpointConfiguration/service_aws_envvar_overrides_base_envvar
=== RUN   TestEndpointConfiguration/base_endpoint_envvar
=== RUN   TestEndpointConfiguration/base_endpoint_envvar_overrides_base_config_file
=== RUN   TestEndpointConfiguration/service_config_file
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_base_envvar
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_alias_name_1_config
=== RUN   TestEndpointConfiguration/service_config_file_overrides_base_config_file
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_service_config_file
=== RUN   TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_base_config_file
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_aws_service_envvar
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_base_config_file
=== RUN   TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_base_envvar
=== RUN   TestEndpointConfiguration/base_endpoint_envvar_overrides_service_config_file
=== RUN   TestEndpointConfiguration/package_name_endpoint_config
=== RUN   TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_aws_service_envvar
=== RUN   TestEndpointConfiguration/base_endpoint_config_file
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_service_config_file
=== RUN   TestEndpointConfiguration/service_aws_envvar_overrides_service_config_file
=== RUN   TestEndpointConfiguration/alias_name_1_endpoint_config
=== RUN   TestEndpointConfiguration/service_aws_envvar_overrides_base_config_file
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_alias_name_1_config
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_config_file
=== RUN   TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_service_config_file
=== RUN   TestEndpointConfiguration/no_config
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config
--- PASS: TestEndpointConfiguration (0.97s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_alias_name_0_config (0.04s
)                                                                                                            --- PASS: TestEndpointConfiguration/service_aws_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_aws_service_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar (0.02s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_alias_name_1_config (0.04s
)                                                                                                            --- PASS: TestEndpointConfiguration/service_config_file_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_service_config_file (0.04s
)                                                                                                            --- PASS: TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_base_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_aws_service_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_base_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_aws_service_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/base_endpoint_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_service_config_file (0.04s
)                                                                                                            --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/alias_name_1_endpoint_config (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_alias_name_1_config (0.04s
)                                                                                                            --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_1_endpoint_config_overrides_service_config_file (0.04s
)                                                                                                            --- PASS: TestEndpointConfiguration/no_config (0.03s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config (0.04s)
=== CONT  TestAccGrafana_serial
=== RUN   TestAccGrafana_serial/Workspace
=== RUN   TestAccGrafana_serial/Workspace/configuration
=== RUN   TestAccGrafana_serial/Workspace/sso
=== RUN   TestAccGrafana_serial/Workspace/dataSources
=== RUN   TestAccGrafana_serial/Workspace/permissionType
=== RUN   TestAccGrafana_serial/Workspace/tags
=== RUN   TestAccGrafana_serial/Workspace/vpc
=== RUN   TestAccGrafana_serial/Workspace/version
=== RUN   TestAccGrafana_serial/Workspace/saml
=== RUN   TestAccGrafana_serial/Workspace/disappears
=== RUN   TestAccGrafana_serial/Workspace/organization
=== RUN   TestAccGrafana_serial/Workspace/notificationDestinations
=== RUN   TestAccGrafana_serial/Workspace/networkAccess
    workspace_test.go:461: Step 1/4 error: Error running apply: exit status 1
        
        Error: creating EC2 VPC Endpoint (com.amazonaws.us-east-1.grafana-workspace): operation error EC2
: CreateVpcEndpoint, https response error StatusCode: 400, RequestID: e23cf2c5-d9e3-49b6-b1e5-62aff8cc143b, api error InvalidParameter: Enabling private DNS requires both enableDnsSupport and enableDnsHostnames VPC attributes set to true for vpc-061609681f8fac065                                                            
          with aws_vpc_endpoint.test[0],
          on terraform_plugin_test.tf line 73, in resource "aws_vpc_endpoint" "test":
          73: resource "aws_vpc_endpoint" "test" {
        
=== RUN   TestAccGrafana_serial/ApiKey
=== RUN   TestAccGrafana_serial/ApiKey/basic
=== RUN   TestAccGrafana_serial/DataSource
=== RUN   TestAccGrafana_serial/DataSource/basic
=== RUN   TestAccGrafana_serial/RoleAssociation
=== RUN   TestAccGrafana_serial/RoleAssociation/usersAdmin
    role_association_test.go:28: Environment variable GRAFANA_SSO_USER_ID is not set
=== RUN   TestAccGrafana_serial/RoleAssociation/usersEditor
    role_association_test.go:66: Environment variable GRAFANA_SSO_USER_ID is not set
=== RUN   TestAccGrafana_serial/RoleAssociation/groupsAdmin
    role_association_test.go:104: Environment variable GRAFANA_SSO_GROUP_ID is not set
=== RUN   TestAccGrafana_serial/RoleAssociation/groupsEditor
    role_association_test.go:142: Environment variable GRAFANA_SSO_GROUP_ID is not set
=== RUN   TestAccGrafana_serial/RoleAssociation/usersAndGroupsAdmin
    role_association_test.go:180: Environment variable GRAFANA_SSO_USER_ID is not set
=== RUN   TestAccGrafana_serial/RoleAssociation/usersAndGroupsEditor
    role_association_test.go:225: Environment variable GRAFANA_SSO_USER_ID is not set
--- FAIL: TestAccGrafana_serial (7361.08s)
    --- FAIL: TestAccGrafana_serial/Workspace (6453.14s)
        --- PASS: TestAccGrafana_serial/Workspace/configuration (785.58s)
        --- PASS: TestAccGrafana_serial/Workspace/sso (475.97s)
        --- PASS: TestAccGrafana_serial/Workspace/dataSources (380.82s)
        --- PASS: TestAccGrafana_serial/Workspace/permissionType (452.99s)
        --- PASS: TestAccGrafana_serial/Workspace/tags (466.93s)
        --- PASS: TestAccGrafana_serial/Workspace/vpc (1311.04s)
        --- PASS: TestAccGrafana_serial/Workspace/version (721.47s)
        --- PASS: TestAccGrafana_serial/Workspace/saml (443.72s)
        --- PASS: TestAccGrafana_serial/Workspace/disappears (475.27s)
        --- PASS: TestAccGrafana_serial/Workspace/organization (483.71s)
        --- PASS: TestAccGrafana_serial/Workspace/notificationDestinations (436.63s)
        --- FAIL: TestAccGrafana_serial/Workspace/networkAccess (19.02s)
    --- PASS: TestAccGrafana_serial/ApiKey (464.45s)
        --- PASS: TestAccGrafana_serial/ApiKey/basic (464.45s)
    --- PASS: TestAccGrafana_serial/DataSource (443.47s)
        --- PASS: TestAccGrafana_serial/DataSource/basic (443.47s)
    --- PASS: TestAccGrafana_serial/RoleAssociation (0.02s)
        --- SKIP: TestAccGrafana_serial/RoleAssociation/usersAdmin (0.01s)
        --- SKIP: TestAccGrafana_serial/RoleAssociation/usersEditor (0.00s)
        --- SKIP: TestAccGrafana_serial/RoleAssociation/groupsAdmin (0.00s)
        --- SKIP: TestAccGrafana_serial/RoleAssociation/groupsEditor (0.00s)
        --- SKIP: TestAccGrafana_serial/RoleAssociation/usersAndGroupsAdmin (0.00s)
        --- SKIP: TestAccGrafana_serial/RoleAssociation/usersAndGroupsEditor (0.00s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/grafana        7365.834s
FAIL
make: *** [testacc] Error 1
...
# After rebase
% make testacc TESTS=TestAccWorkspace_networkAccess PKG=grafana
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/grafana/... -v -count 1 -parallel 20 -run='TestAccWorkspace_networkAccess'  -timeout 360m
=== RUN   TestAccWorkspace_networkAccess
--- PASS: TestAccWorkspace_networkAccess (749.95s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/grafana    753.875s

Copy link

github-actions bot commented Jun 4, 2024

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. service/grafana Issues and PRs that pertain to the grafana service. labels Jun 4, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 4, 2024
Copy link

github-actions bot commented Jun 4, 2024

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 go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

@aristosvo aristosvo force-pushed the sdkv2/grafana branch 5 times, most recently from 3c4132d to 0ad8c2b Compare June 6, 2024 05:19
@aristosvo aristosvo marked this pull request as ready for review June 6, 2024 05:42
@justinretzolk justinretzolk added aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 6, 2024
@ewbankkit ewbankkit merged commit cdb7f5d into hashicorp:main Jun 28, 2024
44 checks passed
@github-actions github-actions bot added this to the v5.57.0 milestone Jun 28, 2024
Copy link

github-actions bot commented Jul 5, 2024

This functionality has been released in v5.57.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!

Copy link

github-actions bot commented Aug 8, 2024

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. service/grafana Issues and PRs that pertain to the grafana service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AWS SDK for Go Migration] Managed Grafana Service
3 participants