diff --git a/apis/v1beta1/types.go b/apis/v1beta1/types.go index 9830c3f73b..0d8883ae55 100644 --- a/apis/v1beta1/types.go +++ b/apis/v1beta1/types.go @@ -25,6 +25,11 @@ type ProviderConfigSpec struct { // This can be useful for testing and for AWS API implementations that do not have STS available. // +optional SkipCredsValidation bool `json:"skip_credentials_validation,omitempty"` + // Whether to skip validation of provided region name. + // Useful for AWS-like implementations that use their own region names or to bypass the validation for + // regions that aren't publicly available yet. + // +optional + SkipRegionValidation bool `json:"skip_region_validation,omitempty"` // Whether to enable the request to use path-style addressing, i.e., https://s3.amazonaws.com/BUCKET/KEY. // +optional S3UsePathStyle bool `json:"s3_use_path_style,omitempty"` diff --git a/internal/clients/aws.go b/internal/clients/aws.go index 3eda3044f8..16a18080c2 100644 --- a/internal/clients/aws.go +++ b/internal/clients/aws.go @@ -38,6 +38,7 @@ const ( keySkipCredsValidation = "skip_credentials_validation" keyS3UsePathStyle = "s3_use_path_style" keySkipMetadataApiCheck = "skip_metadata_api_check" + keySkipRegionValidation = "skip_region_validation" keySkipReqAccountId = "skip_requesting_account_id" keyEndpoints = "endpoints" ) @@ -182,6 +183,7 @@ func DefaultTerraformSetupBuilder(ctx context.Context, c client.Client, mg resou keySessionToken: creds.SessionToken, keySkipCredsValidation: pc.Spec.SkipCredsValidation, keyS3UsePathStyle: pc.Spec.S3UsePathStyle, + keySkipRegionValidation: pc.Spec.SkipRegionValidation, keySkipMetadataApiCheck: pc.Spec.SkipMetadataApiCheck, keySkipReqAccountId: pc.Spec.SkipReqAccountId, } diff --git a/package/crds/aws.upbound.io_providerconfigs.yaml b/package/crds/aws.upbound.io_providerconfigs.yaml index fea717be63..bc04d0e8ce 100644 --- a/package/crds/aws.upbound.io_providerconfigs.yaml +++ b/package/crds/aws.upbound.io_providerconfigs.yaml @@ -297,6 +297,12 @@ spec: description: Whether to skip the AWS Metadata API check Useful for AWS API implementations that do not have a metadata API endpoint. type: boolean + skip_region_validation: + description: Whether to skip validation of provided region name. Useful + for AWS-like implementations that use their own region names or + to bypass the validation for regions that aren't publicly available + yet. + type: boolean skip_requesting_account_id: description: Whether to skip requesting the account ID. Useful for AWS API implementations that do not have the IAM, STS API, or metadata