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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠