Skip to content

Commit

Permalink
Merge pull request #814 from carpenterm/add-skip-region
Browse files Browse the repository at this point in the history
Add option to skip region validation
  • Loading branch information
turkenf authored Sep 26, 2023
2 parents 9b1d58d + f663bd3 commit a09cafe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apis/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 2 additions & 0 deletions internal/clients/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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,
}
Expand Down
6 changes: 6 additions & 0 deletions package/crds/aws.upbound.io_providerconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a09cafe

Please sign in to comment.