Skip to content

Commit

Permalink
[mq] working branch - merge a629d87 on top of master at 83b31f6
Browse files Browse the repository at this point in the history
{"baseBranch":"master","baseCommit":"83b31f604eafd07b76fd507961c3aa96a276b967","createdAt":"2025-01-03T17:40:48.141265Z","headSha":"a629d871685b43e6e04f81fc310ccd24373933c0","id":"e673a818-5c75-44ea-9b8f-71208adc8c67","priority":"200","pullRequestNumber":"2749","queuedAt":"2025-01-03T17:40:48.140542Z","status":"STATUS_QUEUED"}
  • Loading branch information
dd-mergequeue[bot] authored Jan 3, 2025
2 parents 146ae11 + a629d87 commit e7c3681
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions datadog/fwprovider/resource_datadog_integration_aws_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var (
authConfigRolePath = authConfigPath.AtName("aws_auth_config_role")
xrayServicesConfigPath = path.MatchRoot("traces_config").AtName("xray_services")
lambdaForwarderPath = path.MatchRoot("logs_config").AtName("lambda_forwarder")
resourcesConfigPath = path.MatchRoot("resources_config")
)

type integrationAwsAccountResource struct {
Expand Down Expand Up @@ -176,6 +177,9 @@ func (r *integrationAwsAccountResource) ConfigValidators(ctx context.Context) []
xrayServicesConfigPath.AtName("include_all"),
xrayServicesConfigPath.AtName("include_only"),
),
resourcevalidator.ExactlyOneOf(
resourcesConfigPath,
),
}
}

Expand Down Expand Up @@ -859,11 +863,13 @@ func buildRequestMetricsConfig(ctx context.Context, state *integrationAwsAccount
func buildRequestResourcesConfig(state *integrationAwsAccountModel) datadogV2.AWSResourcesConfig {
var resourcesConfig datadogV2.AWSResourcesConfig

if !state.ResourcesConfig.CloudSecurityPostureManagementCollection.IsNull() {
resourcesConfig.SetCloudSecurityPostureManagementCollection(state.ResourcesConfig.CloudSecurityPostureManagementCollection.ValueBool())
}
if !state.ResourcesConfig.ExtendedCollection.IsNull() {
resourcesConfig.SetExtendedCollection(state.ResourcesConfig.ExtendedCollection.ValueBool())
if state.ResourcesConfig != nil {
if !state.ResourcesConfig.CloudSecurityPostureManagementCollection.IsNull() {
resourcesConfig.SetCloudSecurityPostureManagementCollection(state.ResourcesConfig.CloudSecurityPostureManagementCollection.ValueBool())
}
if !state.ResourcesConfig.ExtendedCollection.IsNull() {
resourcesConfig.SetExtendedCollection(state.ResourcesConfig.ExtendedCollection.ValueBool())
}
}

return resourcesConfig
Expand Down

0 comments on commit e7c3681

Please sign in to comment.