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

[AwsVpcPeering] region validation #548

Open
vandjelk opened this issue Aug 29, 2024 · 2 comments
Open

[AwsVpcPeering] region validation #548

vandjelk opened this issue Aug 29, 2024 · 2 comments
Assignees

Comments

@vandjelk
Copy link
Contributor

Description

Currently if user apply invalid AwsVpcPeering.spec.remoteRegion following error will appear in status condition

operation error EC2: DescribeVpcs, get identity: get credentials: failed
to refresh cached credentials, operation error STS: AssumeRole, https
response error StatusCode: 0, RequestID: , request send failed, Post
"https://sts.fake-region.amazonaws.com/": dial tcp: lookup
sts.fake-region.amazonaws.com: no such host

If possible we should introduce some AWS region validation on SKR side, otherwise KCP validation is fine as well.

@vandjelk vandjelk self-assigned this Aug 29, 2024
@ngrkajac
Copy link
Collaborator

@vandjelk Could we have SKR validation without the Cloud Manager SKR active component?

@vandjelk
Copy link
Contributor Author

If we identify all regions, we can add XValidationRule on AwsVpcPeering API.

Something like this for example https://gist.github.com/rams3sh/4858d5150acba5383dd697fda54dda2c

Most of the regions occur in combination of 2 letter followed by "-" followed by a combination of direction based word , followed by a "-" and then a digit.
Ref : AWS' regions are listed here https://aws.amazon.com/about-aws/global-infrastructure/regions_az
General Regex - (af|ap|ca|eu|me|sa|us)-(central|north|(north(?:east|west))|south|south(?:east|west)|east|west)-\d+
Note: Availability Zone - Since AZ has a letter added to a region, it can be of following regex:-
(af|ap|ca|eu|me|sa|us)-(central|north|(north(?:east|west))|south|south(?:east|west)|east|west)-\d+[a-z]{1}

We should anyway validate the regex against the region list provided in Regions and Zones - Amazon Elastic Compute Cloud

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

No branches or pull requests

2 participants