Skip to content

Commit 8633c57

Browse files
feat(onboarding): Adding regulatory EB ARN to cloud ingestion datasource (#564)
Change summary: ---------------- 1. Reading and returning new field EB ARN Gov for regulatory workloads such as aws gov workloads. 2. Updated the acc test and docs.
1 parent 95cf692 commit 8633c57

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

sysdig/data_source_sysdig_secure_onboarding.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@ func dataSourceSysdigSecureCloudIngestionAssetsRead(ctx context.Context, d *sche
380380

381381
d.SetId("cloudIngestionAssets")
382382
err = d.Set("aws", map[string]interface{}{
383-
"eventBusARN": assetsAws["eventBusARN"],
383+
"eventBusARN": assetsAws["eventBusARN"],
384+
"eventBusARNGov": assetsAws["eventBusARNGov"],
384385
})
385386
if err != nil {
386387
return diag.FromErr(err)

sysdig/data_source_sysdig_secure_onboarding_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestAccTrustedCloudIdentityDataSource(t *testing.T) {
3636
resource.TestCheckResourceAttr("data.sysdig_secure_trusted_cloud_identity.trusted_identity", "cloud_provider", "aws"),
3737
resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_cloud_identity.trusted_identity", "aws_account_id"),
3838
resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_cloud_identity.trusted_identity", "aws_role_name"),
39-
// not asserting the gov exported fields because not every backend environment is gov supported and will have non-empty values returned
39+
// not asserting the gov exported fields because not every backend environment is gov supported and thus will have empty values
4040
),
4141
},
4242
{
@@ -178,9 +178,10 @@ func TestAccCloudIngestionAssetsDataSource(t *testing.T) {
178178
{
179179
Config: `data "sysdig_secure_cloud_ingestion_assets" "assets" {}`,
180180
Check: resource.ComposeTestCheckFunc(
181-
resource.TestCheckResourceAttr("data.sysdig_secure_cloud_ingestion_assets.assets", "aws.%", "1"),
182-
resource.TestCheckResourceAttrSet("data.sysdig_secure_cloud_ingestion_assets.assets", "gcp_routing_key"),
181+
resource.TestCheckResourceAttr("data.sysdig_secure_cloud_ingestion_assets.assets", "aws.%", "2"),
182+
// not asserting the gov exported fields because not every backend environment is gov supported and thus will have empty values
183183

184+
resource.TestCheckResourceAttrSet("data.sysdig_secure_cloud_ingestion_assets.assets", "gcp_routing_key"),
184185
// metadata fields are opaque to api backend; cloudingestion controls what fields are passed
185186
// asserts ingestionType and ingestionURL in metadata since it is required
186187
resource.TestCheckResourceAttr("data.sysdig_secure_cloud_ingestion_assets.assets", "gcp_metadata.ingestionType", "gcp"),

website/docs/d/secure_cloud_ingestion_assets.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ In addition to all arguments above, the following attributes are exported:
2626

2727
* `aws.eventBusARN` - AWS event bus from which Sysdig Cloud Ingestion operates
2828

29+
* `aws.eventBusARNGov` - AWS Gov event bus (if supported) from which Sysdig Cloud Ingestion operates
30+
2931
* `gcp_routing_key` - GCP ingestion routing key
3032

3133
* `gcp_metadata` - GCP ingestion metadata

0 commit comments

Comments
 (0)