Skip to content

Commit

Permalink
fix: [CDS-79070]: Set cross_account_access (#687)
Browse files Browse the repository at this point in the history
* fix: [CDS-79070]: Set cross_account_access

* changlelog
  • Loading branch information
sarthakkasat committed Sep 13, 2023
1 parent 8026656 commit 73897aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/687.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
harness_platform_connector_aws - Set value for cross_account_access if not nil.
```
8 changes: 8 additions & 0 deletions internal/service/platform/connector/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,14 @@ func readConnectorAws(d *schema.ResourceData, connector *nextgen.ConnectorInfo)
default:
return fmt.Errorf("unsupported aws credential type: %s", connector.Aws.Credential.Type_)
}
if connector.Aws.Credential.CrossAccountAccess != nil {
d.Set("cross_account_access", []map[string]interface{}{
{
"role_arn": connector.Aws.Credential.CrossAccountAccess.CrossAccountRoleArn,
"external_id": connector.Aws.Credential.CrossAccountAccess.ExternalId,
},
})
}
if connector.Aws.AwsSdkClientBackOffStrategyOverride != nil {
switch connector.Aws.AwsSdkClientBackOffStrategyOverride.Type_ {
case nextgen.AwsSdkClientBackOffStrategyTypes.EqualJitterBackoffStrategy:
Expand Down
4 changes: 4 additions & 0 deletions internal/service/platform/connector/aws_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func TestAccDataSourceConnectorAwsFullJitterBackOff(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "full_jitter_backoff_strategy.0.retry_count", "3"),
resource.TestCheckResourceAttr(resourceName, "full_jitter_backoff_strategy.0.base_delay", "10"),
resource.TestCheckResourceAttr(resourceName, "full_jitter_backoff_strategy.0.max_backoff_time", "65"),
resource.TestCheckResourceAttr(resourceName, "cross_account_access.0.role_arn", "test"),
),
},
},
Expand Down Expand Up @@ -180,6 +181,9 @@ func testAccDataSourceConnectorAwsFullJitterBackOff(name string) string {
max_backoff_time = 65
retry_count = 3
}
cross_account_access {
role_arn = "test"
}
}
data "harness_platform_connector_aws" "test" {
Expand Down

0 comments on commit 73897aa

Please sign in to comment.