crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
142 stars 121 forks source link

Validate Regions #459

Closed plumbis closed 2 days ago

plumbis commented 1 year ago

What problem are you facing?

If a resource specifies the wrong region it looks like a DNS issue with the pod.

For example, creating this ec2 instance:

apiVersion: ec2.aws.upbound.io/v1beta1
kind: Instance
metadata:
  name: upbound-docs-quickstart
spec:
  forProvider:
    # Canonical, Ubuntu, 22.04 LTS, amd64 jammy image build on 2023-01-15
    ami: ami-0ab0629dba5ae551d 
    instanceType: t2.micro
    region: us-east2

Will produce this error

 Warning  CannotObserveExternalResource  76s (x8 over 12m)  managed/ec2.aws.upbound.io/v1beta1, kind=instance  cannot run refresh: refresh failed: error configuring Terraform AWS Provider: error validating provider credentials: error calling sts:GetCallerIdentity: operation error STS: GetCallerIdentity, exceeded maximum number of attempts, 9, https response error StatusCode: 0, RequestID: , request send failed, Post "https://sts.us-east2.amazonaws.com/": dial tcp: lookup sts.us-east2.amazonaws.com on 10.96.0.10:53: no such host:

The error is correct, the host doesn't exist, but it's an issue with the spec.forProvider.region.

How could Official AWS Provider help solve your problem?

The provider should validate the provided region and log a warning that the region is unknown (bonus points for the log saying Did you mean...)

svscheg commented 1 year ago

Reproduced error:

Used manifest for the creating ec2 instance:

apiVersion: ec2.aws.upbound.io/v1beta1
kind: Instance
metadata:
  name: upbound-docs-quickstart
spec:
  forProvider:
    ami: ami-05502a22127df2492
    instanceType: t2.micro
    region: us-east2
github-actions[bot] commented 2 weeks ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 2 days ago

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!