diff --git a/env0/data_cloud_credentials.go b/env0/data_cloud_credentials.go index 27340ee8..cbe6ce9e 100644 --- a/env0/data_cloud_credentials.go +++ b/env0/data_cloud_credentials.go @@ -29,7 +29,7 @@ func dataCloudCredentials() *schema.Resource { Schema: map[string]*schema.Schema{ "names": { Type: schema.TypeList, - Description: "list of all cloud credentials (by name), optionaly filtered by credential_type", + Description: "list of all cloud credentials (by name), optionally filtered by credential_type", Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, diff --git a/tests/integration/024_cloud_credentials/main.tf b/tests/integration/024_cloud_credentials/main.tf index 231d2fb9..20521f6f 100644 --- a/tests/integration/024_cloud_credentials/main.tf +++ b/tests/integration/024_cloud_credentials/main.tf @@ -24,14 +24,19 @@ data "env0_cloud_credentials" "all_aws_credentials" { credential_type = "AWS_ASSUMED_ROLE_FOR_DEPLOYMENT" } -data "env0_aws_credentials" "aws_credentials1" { - name = data.env0_cloud_credentials.all_aws_credentials.names[index(data.env0_cloud_credentials.all_aws_credentials.names, env0_aws_credentials.aws_cred1.name)] -} - -data "env0_aws_credentials" "aws_credentials2" { - name = data.env0_cloud_credentials.all_aws_credentials.names[index(data.env0_cloud_credentials.all_aws_credentials.names, env0_aws_credentials.aws_cred2.name)] -} +//data "env0_aws_credentials" "aws_credentials1" { +// name = data.env0_cloud_credentials.all_aws_credentials.names[index(data.env0_cloud_credentials.all_aws_credentials.names, env0_aws_credentials.aws_cred1.name)] +//} +// +//data "env0_aws_credentials" "aws_credentials2" { +// name = data.env0_cloud_credentials.all_aws_credentials.names[index(data.env0_cloud_credentials.all_aws_credentials.names, env0_aws_credentials.aws_cred2.name)] +//} +// +//output "credentials_name" { +// value = var.second_run ? replace(data.env0_aws_credentials.aws_credentials1.name, random_string.random.result, "") : "" +//} -output "credentials_name" { - value = var.second_run ? replace(data.env0_aws_credentials.aws_credentials1.name, random_string.random.result, "") : "" +output "credentials_names" { + for_each = toset(data.env0_cloud_credentials.all_aws_credentials.names) + value = each.value }