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

r/aws_cloudwatch_event_connection: Add connectivity_parameters argument #41561

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomkalesse
Copy link
Contributor

Description

Adding connectivity_parameters to aws_cloudwatch_event_connection for supporting OAuth on private APIs.

Note: The creation of a connection with OAuth on a private API takes a little longer. I tested with different configurations, and got the following results. Creating a connection with OAuth on a private API might take up to 20 minutes before accessing a target state of AUTHORIZED, DEAUTHORIZED or ACTIVE. By accepting AUTHORIZING as a target state for a valid creation I could lower the timeout to 10 min (see Output from Acceptance Testing). I would go with this setup, otherwise we have to stay with a timeout of 20 min as it seems (see Output from Acceptance Testing - Option 2 below).
More Information on connection states here https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-target-connection-states.html. As far as I understand this documentation AUTHORIZING is only used for private API OAuth, so there shouldnt be any conflicts.
Comment if you wish for the second implementation, then I will update this branch.

Relations

Closes #41220

References

Output from Acceptance Testing - current implementation (10 min timeout & target states: AUTHORIZED, DEAUTHORIZED, ACTIVE, AUTHORIZING)

% make testacc PKG=events TESTS=TestAccEventsConnection_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/events/... -v -count 1 -parallel 20 -run='TestAccEventsConnection_'  -timeout 360m -vet=off
2025/02/25 21:05:14 Initializing Terraform AWS Provider...
=== RUN   TestAccEventsConnection_apiKey
=== PAUSE TestAccEventsConnection_apiKey
=== RUN   TestAccEventsConnection_basic
=== PAUSE TestAccEventsConnection_basic
=== RUN   TestAccEventsConnection_oAuth
=== PAUSE TestAccEventsConnection_oAuth
=== RUN   TestAccEventsConnection_connectivityParamters
=== PAUSE TestAccEventsConnection_connectivityParamters
=== RUN   TestAccEventsConnection_invocationHTTPParameters
=== PAUSE TestAccEventsConnection_invocationHTTPParameters
=== RUN   TestAccEventsConnection_disappears
=== PAUSE TestAccEventsConnection_disappears
=== RUN   TestAccEventsConnection_invocationConnectivityParameters
=== PAUSE TestAccEventsConnection_invocationConnectivityParameters
=== CONT  TestAccEventsConnection_apiKey
=== CONT  TestAccEventsConnection_invocationHTTPParameters
=== CONT  TestAccEventsConnection_invocationConnectivityParameters
=== CONT  TestAccEventsConnection_oAuth
=== CONT  TestAccEventsConnection_connectivityParamters
=== CONT  TestAccEventsConnection_basic
=== CONT  TestAccEventsConnection_disappears
--- PASS: TestAccEventsConnection_disappears (67.76s)
--- PASS: TestAccEventsConnection_basic (92.80s)
--- PASS: TestAccEventsConnection_invocationHTTPParameters (102.69s)
--- PASS: TestAccEventsConnection_apiKey (106.04s)
--- PASS: TestAccEventsConnection_oAuth (106.04s)
--- PASS: TestAccEventsConnection_invocationConnectivityParameters (151.34s)
--- PASS: TestAccEventsConnection_connectivityParamters (452.02s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/events     458.176s

Output from Acceptance Testing - Option 2 (20 min timeout & target states: AUTHORIZED, DEAUTHORIZED, ACTIVE)

% make testacc PKG=events TESTS=TestAccEventsConnection_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/events/... -v -count 1 -parallel 20 -run='TestAccEventsConnection_'  -timeout 360m -vet=off
2025/02/25 20:45:48 Initializing Terraform AWS Provider...
=== RUN   TestAccEventsConnection_apiKey
=== PAUSE TestAccEventsConnection_apiKey
=== RUN   TestAccEventsConnection_basic
=== PAUSE TestAccEventsConnection_basic
=== RUN   TestAccEventsConnection_oAuth
=== PAUSE TestAccEventsConnection_oAuth
=== RUN   TestAccEventsConnection_connectivityParamters
=== PAUSE TestAccEventsConnection_connectivityParamters
=== RUN   TestAccEventsConnection_invocationHTTPParameters
=== PAUSE TestAccEventsConnection_invocationHTTPParameters
=== RUN   TestAccEventsConnection_disappears
=== PAUSE TestAccEventsConnection_disappears
=== RUN   TestAccEventsConnection_invocationConnectivityParameters
=== PAUSE TestAccEventsConnection_invocationConnectivityParameters
=== CONT  TestAccEventsConnection_apiKey
=== CONT  TestAccEventsConnection_invocationHTTPParameters
=== CONT  TestAccEventsConnection_invocationConnectivityParameters
=== CONT  TestAccEventsConnection_oAuth
=== CONT  TestAccEventsConnection_basic
=== CONT  TestAccEventsConnection_connectivityParamters
=== CONT  TestAccEventsConnection_disappears
--- PASS: TestAccEventsConnection_disappears (29.23s)
--- PASS: TestAccEventsConnection_basic (49.23s)
--- PASS: TestAccEventsConnection_invocationHTTPParameters (62.01s)
--- PASS: TestAccEventsConnection_apiKey (63.33s)
--- PASS: TestAccEventsConnection_oAuth (67.23s)
--- PASS: TestAccEventsConnection_invocationConnectivityParameters (112.36s)
--- PASS: TestAccEventsConnection_connectivityParamters (1031.00s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/events     1039.225s

@tomkalesse tomkalesse requested a review from a team as a code owner February 25, 2025 20:52
Copy link

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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/events Issues and PRs that pertain to the events service. needs-triage Waiting for first response or review from a maintainer. labels Feb 25, 2025
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/events Issues and PRs that pertain to the events service. 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.

[Enhancement]: aws_cloudwatch_event_connection: add auth_parameters.connectivity_parameters argument
2 participants