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

[datadog_integration_aws_event_bridge] Add support for AWS Event Bridge integration #2204

Merged
merged 24 commits into from
Jan 3, 2024

Conversation

skarimo
Copy link
Member

@skarimo skarimo commented Dec 8, 2023

What does this PR do?

Adds support for a datadog_integration_aws_event_bridge terraform resource that allows users to import, create, and delete AWS EventBridge event source resources in their Datadog integration config.

Who will it impact?

Orgs using the AWS EventBridge integration to manage event sources will be able to imprort, create, and delete those with Terraform.

Motivation

https://datadoghq.atlassian.net/browse/AWSMC-706

Testing

Tested manually in my sandbox org + sandbox AWS using this config

# terraform_examples/main.tf
terraform {
  required_providers {
    datadog = {
      source = "DataDog/datadog"
    }
  }
}

provider "datadog" {
  api_key = "***"
  app_key = "***"
}

# Create a new Datadog - Amazon Web Services integration
resource "datadog_integration_aws" "sandbox" {
  account_id  = "012345678901"
  role_name   = "datadog-aws-integration-role-katie"
  filter_tags = ["key:value"]
  host_tags   = ["key:value", "key2:value2"]
}

resource "datadog_integration_aws_event_bridge" "foo" {
  account_id           = "012345678901"
  create_event_bus = true
  event_generator_name = "test7009647276"
  region               = "us-east-1"
}

Passed acceptance tests, but create_event_bus = true is not working in tests, I believe because of a missing IAM permission but I'm not sure. Will ask tf team what they think or if this should even be covered in the test.

❯ TESTARGS="-run TestAccIntegrationAwsEventBridgeBasic" make testacc
gotestsum --version || go install gotest.tools/gotestsum@latest
gotestsum version dev
which goimports || go install golang.org/x/tools/cmd/goimports@latest
/Users/katie.mckew/go/bin/goimports
RECORD=false TF_ACC=1 gotestsum --format testname --debug --rerun-fails --packages ./... -- -v -run TestAccIntegrationAwsEventBridgeBasic -timeout 120m
exec: [go test -json -v -run TestAccIntegrationAwsEventBridgeBasic -timeout 120m ./...]
go test pid: 12180
EMPTY .
EMPTY datadog
EMPTY datadog/fwprovider
EMPTY datadog/internal/fwutils (cached)
EMPTY datadog/internal/planmodifiers
EMPTY datadog/internal/utils (cached)
EMPTY datadog/internal/validators (cached)
2023/12/21 17:28:15 DD_AGENT_HOST is not configured. Tests are executed without tracer and profiler.
PASS datadog/tests.TestAccIntegrationAwsEventBridgeBasic (1.50s)
EMPTY version
PASS datadog/tests (cached)

DONE 1 tests in 2.148s

@ktmq ktmq marked this pull request as ready for review December 22, 2023 19:06
@ktmq ktmq requested review from a team as code owners December 22, 2023 19:06
@skarimo skarimo force-pushed the sherz/generate-aws-eventsbridge branch from 2a313fe to c4d350a Compare December 22, 2023 19:41
buraizu
buraizu previously approved these changes Dec 22, 2023
Copy link
Contributor

@buraizu buraizu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting some minor doc edits, but overall LGTM and approving

docs/resources/integration_aws_event_bridge.md Outdated Show resolved Hide resolved
docs/resources/integration_aws_event_bridge.md Outdated Show resolved Hide resolved
nkzou
nkzou previously approved these changes Jan 2, 2024
dylanburati
dylanburati previously approved these changes Jan 2, 2024
@ktmq ktmq dismissed stale reviews from dylanburati and nkzou via 65107bd January 2, 2024 19:48
dylanburati
dylanburati previously approved these changes Jan 2, 2024
jvanbrie
jvanbrie previously approved these changes Jan 2, 2024
@ktmq ktmq dismissed stale reviews from jvanbrie and dylanburati via ce5c01f January 2, 2024 21:32
ktmq
ktmq previously approved these changes Jan 2, 2024
@nkzou nkzou merged commit fe67ee0 into master Jan 3, 2024
9 checks passed
@nkzou nkzou deleted the sherz/generate-aws-eventsbridge branch January 3, 2024 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants