Skip to content

aws api adding extended and deprecating old resource collection field #71

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

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-10 17:49:39.704122",
"spec_repo_commit": "bb0f8c92"
"regenerated": "2024-04-10 19:44:58.186735",
"spec_repo_commit": "3fb610b5"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-10 17:49:39.721568",
"spec_repo_commit": "bb0f8c92"
"regenerated": "2024-04-10 19:44:58.204246",
"spec_repo_commit": "3fb610b5"
}
}
}
11 changes: 9 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
@@ -90,6 +90,12 @@ components:
description: Regions to exclude.
type: string
type: array
extended_resource_collection_enabled:
default: false
description: Whether Datadog collects additional attributes and configuration
information about the resources in your AWS account. Required for `cspm_resource_collection`.
example: true
type: boolean
filter_tags:
description: 'The array of EC2 tags (in the form `key:value`) defines a
filter that Datadog uses when collecting metrics from EC2.
@@ -128,8 +134,9 @@ components:
type: boolean
resource_collection_enabled:
default: false
description: Whether Datadog collects a standard set of resources from your
AWS account.
deprecated: true
description: Deprecated in favor of 'extended_resource_collection_enabled'.
Whether Datadog collects a standard set of resources from your AWS account.
example: true
type: boolean
role_name:
2 changes: 1 addition & 1 deletion examples/v1_aws-integration_create_aws_account.rs
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@ async fn main() {
.account_specific_namespace_rules(BTreeMap::from([("auto_scaling".to_string(), false)]))
.cspm_resource_collection_enabled(true)
.excluded_regions(vec!["us-east-1".to_string(), "us-west-2".to_string()])
.extended_resource_collection_enabled(true)
.filter_tags(vec!["$KEY:$VALUE".to_string()])
.host_tags(vec!["$KEY:$VALUE".to_string()])
.metrics_collection_enabled(false)
.resource_collection_enabled(true)
.role_name("DatadogAWSIntegrationRole".to_string());
let configuration = datadog::Configuration::new();
let api = AWSIntegrationAPI::with_config(configuration);
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ async fn main() {
]))
.cspm_resource_collection_enabled(true)
.excluded_regions(vec!["us-east-1".to_string(), "us-west-2".to_string()])
.extended_resource_collection_enabled(true)
.filter_tags(vec!["$KEY:$VALUE".to_string()])
.host_tags(vec!["$KEY:$VALUE".to_string()])
.metrics_collection_enabled(false)
2 changes: 1 addition & 1 deletion examples/v1_aws-integration_update_aws_account.rs
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@ async fn main() {
.account_specific_namespace_rules(BTreeMap::from([("auto_scaling".to_string(), false)]))
.cspm_resource_collection_enabled(false)
.excluded_regions(vec!["us-east-1".to_string(), "us-west-2".to_string()])
.extended_resource_collection_enabled(true)
.filter_tags(vec!["$KEY:$VALUE".to_string()])
.host_tags(vec!["$KEY:$VALUE".to_string()])
.metrics_collection_enabled(true)
.resource_collection_enabled(true)
.role_name("DatadogAWSIntegrationRole".to_string());
let configuration = datadog::Configuration::new();
let api = AWSIntegrationAPI::with_config(configuration);
35 changes: 34 additions & 1 deletion src/datadogV1/model/model_aws_account.rs
Original file line number Diff line number Diff line change
@@ -29,6 +29,9 @@ pub struct AWSAccount {
/// to exclude from metrics collection.
#[serde(rename = "excluded_regions")]
pub excluded_regions: Option<Vec<String>>,
/// Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Required for `cspm_resource_collection`.
#[serde(rename = "extended_resource_collection_enabled")]
pub extended_resource_collection_enabled: Option<bool>,
/// The array of EC2 tags (in the form `key:value`) defines a filter that Datadog uses when collecting metrics from EC2.
/// Wildcards, such as `?` (for single characters) and `*` (for multiple characters) can also be used.
/// Only hosts that match one of the defined tags
@@ -44,7 +47,8 @@ pub struct AWSAccount {
/// Whether Datadog collects metrics for this AWS account.
#[serde(rename = "metrics_collection_enabled")]
pub metrics_collection_enabled: Option<bool>,
/// Whether Datadog collects a standard set of resources from your AWS account.
/// Deprecated in favor of 'extended_resource_collection_enabled'. Whether Datadog collects a standard set of resources from your AWS account.
#[deprecated]
#[serde(rename = "resource_collection_enabled")]
pub resource_collection_enabled: Option<bool>,
/// Your Datadog role delegation name.
@@ -60,12 +64,14 @@ pub struct AWSAccount {

impl AWSAccount {
pub fn new() -> AWSAccount {
#[allow(deprecated)]
AWSAccount {
access_key_id: None,
account_id: None,
account_specific_namespace_rules: None,
cspm_resource_collection_enabled: None,
excluded_regions: None,
extended_resource_collection_enabled: None,
filter_tags: None,
host_tags: None,
metrics_collection_enabled: None,
@@ -76,16 +82,19 @@ impl AWSAccount {
}
}

#[allow(deprecated)]
pub fn access_key_id(mut self, value: String) -> Self {
self.access_key_id = Some(value);
self
}

#[allow(deprecated)]
pub fn account_id(mut self, value: String) -> Self {
self.account_id = Some(value);
self
}

#[allow(deprecated)]
pub fn account_specific_namespace_rules(
mut self,
value: std::collections::BTreeMap<String, bool>,
@@ -94,41 +103,55 @@ impl AWSAccount {
self
}

#[allow(deprecated)]
pub fn cspm_resource_collection_enabled(mut self, value: bool) -> Self {
self.cspm_resource_collection_enabled = Some(value);
self
}

#[allow(deprecated)]
pub fn excluded_regions(mut self, value: Vec<String>) -> Self {
self.excluded_regions = Some(value);
self
}

#[allow(deprecated)]
pub fn extended_resource_collection_enabled(mut self, value: bool) -> Self {
self.extended_resource_collection_enabled = Some(value);
self
}

#[allow(deprecated)]
pub fn filter_tags(mut self, value: Vec<String>) -> Self {
self.filter_tags = Some(value);
self
}

#[allow(deprecated)]
pub fn host_tags(mut self, value: Vec<String>) -> Self {
self.host_tags = Some(value);
self
}

#[allow(deprecated)]
pub fn metrics_collection_enabled(mut self, value: bool) -> Self {
self.metrics_collection_enabled = Some(value);
self
}

#[allow(deprecated)]
pub fn resource_collection_enabled(mut self, value: bool) -> Self {
self.resource_collection_enabled = Some(value);
self
}

#[allow(deprecated)]
pub fn role_name(mut self, value: String) -> Self {
self.role_name = Some(value);
self
}

#[allow(deprecated)]
pub fn secret_access_key(mut self, value: String) -> Self {
self.secret_access_key = Some(value);
self
@@ -165,6 +188,7 @@ impl<'de> Deserialize<'de> for AWSAccount {
> = None;
let mut cspm_resource_collection_enabled: Option<bool> = None;
let mut excluded_regions: Option<Vec<String>> = None;
let mut extended_resource_collection_enabled: Option<bool> = None;
let mut filter_tags: Option<Vec<String>> = None;
let mut host_tags: Option<Vec<String>> = None;
let mut metrics_collection_enabled: Option<bool> = None;
@@ -209,6 +233,13 @@ impl<'de> Deserialize<'de> for AWSAccount {
excluded_regions =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"extended_resource_collection_enabled" => {
if v.is_null() {
continue;
}
extended_resource_collection_enabled =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"filter_tags" => {
if v.is_null() {
continue;
@@ -253,12 +284,14 @@ impl<'de> Deserialize<'de> for AWSAccount {
}
}

#[allow(deprecated)]
let content = AWSAccount {
access_key_id,
account_id,
account_specific_namespace_rules,
cspm_resource_collection_enabled,
excluded_regions,
extended_resource_collection_enabled,
filter_tags,
host_tags,
metrics_collection_enabled,
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-11-13T14:17:01.291Z
2024-04-05T18:30:30.891Z
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"account_id\":\"169988502100\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"resource_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183000\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"extended_resource_collection_enabled\":true,\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -19,7 +19,7 @@
},
"response": {
"body": {
"string": "{\"external_id\":\"9668e281c0ef4cc8be01710ef7a0ae4c\"}\n",
"string": "{\"external_id\":\"acb8f6b8a844443dbb726d07dcb1a870\"}\n",
"encoding": null
},
"headers": {
@@ -32,12 +32,12 @@
"message": "OK"
}
},
"recorded_at": "Mon, 13 Nov 2023 14:17:01 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:30 GMT"
},
{
"request": {
"body": {
"string": "{\"account_id\":\"169988502100\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183000\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -66,7 +66,7 @@
"message": "OK"
}
},
"recorded_at": "Mon, 13 Nov 2023 14:17:01 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:30 GMT"
}
],
"recorded_with": "VCR 6.0.0"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-11-21T19:25:15.118Z
2024-04-05T18:30:32.594Z
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"account_id\":\"170059471500\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"resource_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183200\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"extended_resource_collection_enabled\":true,\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -19,7 +19,7 @@
},
"response": {
"body": {
"string": "{\"external_id\":\"77c77ead62584b0fa1bb6a9fe7d2fa28\"}\n",
"string": "{\"external_id\":\"6aa1bf95e5dc4c9985593e94169bd2f6\"}\n",
"encoding": null
},
"headers": {
@@ -32,12 +32,12 @@
"message": "OK"
}
},
"recorded_at": "Tue, 21 Nov 2023 19:25:15 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:32 GMT"
},
{
"request": {
"body": {
"string": "{\"account_id\":\"170059471500\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183200\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -66,12 +66,12 @@
"message": "OK"
}
},
"recorded_at": "Tue, 21 Nov 2023 19:25:15 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:32 GMT"
},
{
"request": {
"body": {
"string": "{\"account_id\":\"170059471500\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183200\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -87,7 +87,7 @@
},
"response": {
"body": {
"string": "{\"errors\":[\"AWS account 170059471500 does not exist in integration\"]}",
"string": "{\"errors\":[\"AWS account 171234183200 does not exist in integration\"]}",
"encoding": null
},
"headers": {
@@ -100,7 +100,7 @@
"message": "Bad Request"
}
},
"recorded_at": "Tue, 21 Nov 2023 19:25:15 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:32 GMT"
}
],
"recorded_with": "VCR 6.0.0"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-11-23T18:16:16.323Z
2024-04-05T18:30:34.377Z
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"account_id\":\"170076337600\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"resource_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183400\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":true,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"extended_resource_collection_enabled\":true,\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":false,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -19,7 +19,7 @@
},
"response": {
"body": {
"string": "{\"external_id\":\"c7298c166e774bf1bd1bc0419e68f1a0\"}\n",
"string": "{\"external_id\":\"c8ceedec95fc472fb6156f3104d425c9\"}\n",
"encoding": null
},
"headers": {
@@ -32,12 +32,12 @@
"message": "OK"
}
},
"recorded_at": "Thu, 23 Nov 2023 18:16:16 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:34 GMT"
},
{
"request": {
"body": {
"string": "{\"account_id\":\"170076337600\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":false,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":true,\"resource_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183400\",\"account_specific_namespace_rules\":{\"auto_scaling\":false},\"cspm_resource_collection_enabled\":false,\"excluded_regions\":[\"us-east-1\",\"us-west-2\"],\"extended_resource_collection_enabled\":true,\"filter_tags\":[\"$KEY:$VALUE\"],\"host_tags\":[\"$KEY:$VALUE\"],\"metrics_collection_enabled\":true,\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -49,7 +49,7 @@
]
},
"method": "put",
"uri": "https://api.datadoghq.com/api/v1/integration/aws?account_id=170076337600&role_name=DatadogAWSIntegrationRole"
"uri": "https://api.datadoghq.com/api/v1/integration/aws?account_id=171234183400&role_name=DatadogAWSIntegrationRole"
},
"response": {
"body": {
@@ -66,12 +66,12 @@
"message": "OK"
}
},
"recorded_at": "Thu, 23 Nov 2023 18:16:16 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:34 GMT"
},
{
"request": {
"body": {
"string": "{\"account_id\":\"170076337600\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"string": "{\"account_id\":\"171234183400\",\"role_name\":\"DatadogAWSIntegrationRole\"}",
"encoding": null
},
"headers": {
@@ -100,7 +100,7 @@
"message": "OK"
}
},
"recorded_at": "Thu, 23 Nov 2023 18:16:16 GMT"
"recorded_at": "Fri, 05 Apr 2024 18:30:34 GMT"
}
],
"recorded_with": "VCR 6.0.0"
16 changes: 8 additions & 8 deletions tests/scenarios/features/v1/aws_integration.feature
Original file line number Diff line number Diff line change
@@ -12,21 +12,21 @@ Feature: AWS Integration
@generated @skip @team:DataDog/cloud-integrations
Scenario: Create an AWS integration returns "Bad Request" response
Given new "CreateAWSAccount" request
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
Scenario: Create an AWS integration returns "Conflict Error" response
Given new "CreateAWSAccount" request
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
When the request is sent
Then the response status is 409 Conflict Error

@team:DataDog/cloud-integrations
Scenario: Create an AWS integration returns "OK" response
Given new "CreateAWSAccount" request
And body with value {"account_id": "{{ timestamp("now") }}00", "account_specific_namespace_rules": {"auto_scaling": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "{{ timestamp("now") }}00", "account_specific_namespace_rules": {"auto_scaling": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "role_name": "DatadogAWSIntegrationRole"}
When the request is sent
Then the response status is 200 OK

@@ -97,14 +97,14 @@ Feature: AWS Integration
@generated @skip @team:DataDog/cloud-integrations
Scenario: Generate a new external ID returns "Bad Request" response
Given new "CreateNewAWSExternalID" request
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
Scenario: Generate a new external ID returns "OK" response
Given new "CreateNewAWSExternalID" request
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
When the request is sent
Then the response status is 200 OK

@@ -169,22 +169,22 @@ Feature: AWS Integration
@generated @skip @team:DataDog/cloud-integrations
Scenario: Update an AWS integration returns "Bad Request" response
Given new "UpdateAWSAccount" request
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
Scenario: Update an AWS integration returns "Conflict Error" response
Given new "UpdateAWSAccount" request
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
When the request is sent
Then the response status is 409 Conflict Error

@team:DataDog/cloud-integrations
Scenario: Update an AWS integration returns "OK" response
Given there is a valid "aws_account" in the system
And new "UpdateAWSAccount" request
And body with value {"account_id": "{{ timestamp("now") }}00", "account_specific_namespace_rules": {"auto_scaling": false}, "cspm_resource_collection_enabled": false, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": true, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And body with value {"account_id": "{{ timestamp("now") }}00", "account_specific_namespace_rules": {"auto_scaling": false}, "cspm_resource_collection_enabled": false, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"}
And request contains "account_id" parameter with value "{{ timestamp("now") }}00"
And request contains "role_name" parameter with value "DatadogAWSIntegrationRole"
When the request is sent
2 changes: 1 addition & 1 deletion tests/scenarios/features/v1/given.json
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@
{
"name": "body",
"origin": "request",
"value": "{\n \"account_id\": \"{{ timestamp(\"now\") }}00\",\n \"account_specific_namespace_rules\": {\n \"auto_scaling\": false\n },\n \"cspm_resource_collection_enabled\": true,\n \"excluded_regions\": [\n \"us-east-1\",\n \"us-west-2\"\n ],\n \"filter_tags\": [\n \"$KEY:$VALUE\"\n ],\n \"host_tags\": [\n \"$KEY:$VALUE\"\n ],\n \"metrics_collection_enabled\": false,\n \"resource_collection_enabled\": true,\n \"role_name\": \"DatadogAWSIntegrationRole\"\n}"
"value": "{\n \"account_id\": \"{{ timestamp(\"now\") }}00\",\n \"account_specific_namespace_rules\": {\n \"auto_scaling\": false\n },\n \"cspm_resource_collection_enabled\": true,\n \"excluded_regions\": [\n \"us-east-1\",\n \"us-west-2\"\n ],\n \"extended_resource_collection_enabled\": true,\n \"filter_tags\": [\n \"$KEY:$VALUE\"\n ],\n \"host_tags\": [\n \"$KEY:$VALUE\"\n ],\n \"metrics_collection_enabled\": false,\n \"role_name\": \"DatadogAWSIntegrationRole\"\n}"
}
],
"step": "there is a valid \"aws_account\" in the system",