Cloud & DevOps Validators

Cloud infrastructure validators for AWS, Docker, Kubernetes, and CI/CD pipeline configurations.

10 code snippets available

AWS ARN

cloud

Amazon Resource Name format.

#aws
ts
const isValid = (s: string): boolean => /^arn:(aws|aws-cn|aws-us-gov):[a-z0-9-]+:[a-z0-9-]*:[0-9]{12}:.+$/.test(s);

Docker Image

cloud

Valid image:tag.

#container
ts
const isValid = (s: string): boolean => /^([a-z0-9]+(?:[._-][a-z0-9]+)*/)?([a-z0-9]+(?:[._-][a-z0-9]+)*)(?::([a-z0-9.-]+))?$/.test(s);

Cron Expression

cloud

5 field cron format.

#schedule
ts
const isValid = (s: string): boolean => /^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$/.test(s);

K8s Namespace

cloud

Kubernetes namespace name.

#kubernetes#k8s
ts
const isValid = (s: string): boolean => /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/.test(s);

K8s Label

cloud

Kubernetes label format.

#kubernetes#k8s
ts
const isValid = (s: string): boolean => /^([a-z0-9A-Z][-a-z0-9A-Z_.]*)?[a-z0-9A-Z]$/.test(s);

Docker Tag

cloud

Docker image tag.

#docker#container
ts
const isValid = (s: string): boolean => /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/.test(s);

Container ID

cloud

Docker container ID.

#docker#container
ts
const isValid = (s: string): boolean => /^[a-f0-9]{12,64}$/.test(s);

S3 URI

cloud

Amazon S3 URI.

#aws#s3
ts
const isValid = (s: string): boolean => /^s3:\/\/[a-z0-9.-]+\/.+$/.test(s);

GCS URI

cloud

Google Cloud Storage URI.

#gcp#storage
ts
const isValid = (s: string): boolean => /^gs:\/\/[a-z0-9.-]+\/.+$/.test(s);

Azure Blob URL

cloud

Azure storage URL.

#azure#storage
ts
const isValid = (s: string): boolean => /^https:\/\/[a-z0-9]+\.blob\.core\.windows\.net\/.+$/.test(s);

About Cloud & DevOps Validators

Our cloud & devops validation snippets are designed to handle the most common validation scenarios you'll encounter in modern software development. Each snippet is thoroughly tested, optimized for performance, and follows industry best practices.

All validators are available in multiple programming languages including JavaScript, TypeScript, Python, Go, PHP, C#, and Rust. Simply copy the code snippet, adapt it to your specific needs, and integrate it into your project. Every snippet is MIT licensed—free for personal and commercial use.

Browse Other Categories