Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #116 from crossplane-contrib/backport-115-to-relea…
Browse files Browse the repository at this point in the history
…se-0.2

[Backport release-0.2] Skip terraform region validation for resources without region
  • Loading branch information
turkenh authored Oct 17, 2021
2 parents f04290b + 39d30c0 commit af8978f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/clients/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string) terr
// e.g. what about setting an assume_role section: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#argument-reference
tfCfg := map[string]interface{}{}
tfCfg["region"] = awsConf.Region
if awsConf.Region == "" {
// Some resources, like iam group, do not have a notion of region
// hence we have no region in their schema. However, terraform still
// attempts validating region in provider config and does not like
// both empty string or not setting it at all. We need to skip
// region validation in this case.
tfCfg["skip_region_validation"] = true
}

ps.Configuration = tfCfg
// set credentials environment
Expand Down

0 comments on commit af8978f

Please sign in to comment.