Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip region validation #814

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

carpenterm
Copy link
Contributor

@carpenterm carpenterm commented Aug 4, 2023

Description of your changes

This PR adds the skip_region_validation field to the AWS ProviderConfig as per https://registry.terraform.io/providers/hashicorp/aws/2.47.0/docs#skip_region_validation

Fixes #812: Support skipping region validation

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Built custom image using the following:

make submodules
export DOCKER_REGISTRY=myregistry/myrepo
export BUILD_REGISTRY=myregistry/myrepo
export XPKG_REG_ORGS=myregistry/myrepo
export REGISTRY_ORGS=myregistry/myrepo
make build.all publish BRANCH_NAME=main SUBPACKAGES="s3 config"

Created aws family Provider and s3 Provider using newly built test images:

NAME                  INSTALLED   HEALTHY   PACKAGE                                            AGE
provider-aws-family   True        True      myregistry/myrepo/provider-family-aws:v0.37.0      53m
provider-aws-s3       True        True      myregistry/myrepo/provider-aws-s3:v0.37.0-custom.4 53m

Deployed Minio object store with a custom region and configured ProviderConfig to point to it:

apiVersion: aws.upbound.io/v1beta1
kind: ProviderConfig
metadata:
  name: minio
spec:
  credentials:
    secretRef:
      key: config
      name: minio-credentials
      namespace: mynamespace
    source: Secret
  endpoint:
    hostnameImmutable: true
    services:
    - s3
    - sts
    signingRegion: my-region
    source: Custom
    url:
      static: http://minio.mynamespace.svc.cluster.local:9000
      type: Static
  s3_use_path_style: true
  skip_credentials_validation: true
  skip_metadata_api_check: true
  skip_requesting_account_id: true
  skip_region_validation: true

Created an S3 bucket passing the custom region:

apiVersion: s3.aws.upbound.io/v1beta1
kind: Bucket
metadata:
  name: my-bucket
spec:
  forProvider:
    region: my-region

Observe that bucket is created successfully and there is no Error: Invalid AWS Region error as was the case prior to this PR:

NAME                 READY   SYNCED   EXTERNAL-NAME        AGE
my-bucket            True    True     my-bucket            5m

@turkenf
Copy link
Collaborator

turkenf commented Sep 22, 2023

/test-examples="examples/s3/bucket.yaml"

@Syndlex
Copy link

Syndlex commented Sep 22, 2023

Any reason this is not merged? I kinda need this.

@jeanduplessis
Copy link
Collaborator

@Syndlex next release is coming out on Thursday next week.

Copy link
Collaborator

@sergenyalcin sergenyalcin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @carpenterm LGTM!

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @carpenterm, LGTM.

@turkenf turkenf merged commit a09cafe into crossplane-contrib:main Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support skipping region validation
5 participants