Automatic resource creation and ID checking.

0

Hey guys! Need a solution for a simple issue.

Is there an automatic process to create resources on AWS and check its IDs on whether it has particular numbers and letters? Like having a VPC, EC2, RDS, or S3, where the ID doesn’t have the letter S or have the number 8s in it.

Like having a preferred id of YcdrbA57Zfs6y5t28, and not, ZoqhRtgfDfg4089g45.

Maybe setting a stack or cloudformations, or with policies.

If not, then delete the resource and create a new one. Keep repeating it until it achieves the target IDs.

Thanks!

1回答
0
承認された回答

Background

When resources are created, we assign each resource a unique resource ID. A resource ID takes the form of a resource identifier (such as snap for a snapshot) followed by a hyphen and a unique combination of letters and numbers. Each resource identifier, such as an AMI ID, instance ID, EBS volume ID, or EBS snapshot ID, is tied to its Region and can be used only in the Region where you created the resource.

Prior to January 2016, the IDs assigned to newly created resources of certain resource types used 8 characters after the hyphen (for example, i-1a2b3c4d). From January 2016 to June 2018, we changed the IDs of these resource types to use 17 characters after the hyphen (for example, i-1234567890abcdef0). Depending on when your account was created, you might have some existing resources with short IDs, however, any new resources will receive the longer IDs.

Summary

There's no native solution provided by AWS to check the resource ID of a resource. The resource IDs are random and unique in nature. You may create a custom bash/python script to check the resource ID's. The use-case shared, i.e. delete the resource and keep creating a new one until it achieves the target ID's is not a palatable approach.

profile pictureAWS
サポートエンジニア
Varun
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ