EC2 instance did not stabilize

0

Hello everyone, while trying to launch the ec2 instance with cloudformation template I got following error.

Resource handler returned message: "Resource of type 'AWS::EC2::Instance' with identifier 'i-06ceba37cb1b9avbe' did not stabilize." (RequestToken: fb7c8818-0ba3-f030-535e-dc7d53dcd224, HandlerErrorCode: NotStabilized)

I used the following template.

AWSTemplateFormatVersion: '2010-09-09' Description: To Create EC2 Instance Using CloudFormation Parameters: TKDSubnetID: Type: AWS::EC2::Subnet::Id Description: Subnet of EC2 Instance Default: subnet-0621xxxxxx

TKDSGID: Type: ListAWS::EC2::SecurityGroup::Id Description: Security Group to which EC2 Instance belongs Default: sg-0771d8sxxxxxxx

TKDKeyName: Type: AWS::EC2::KeyPair::KeyName Description: My Keypair Default: surya-ec2-keypair

TKDInstanceType: Type: String Default: t2.micro AllowedValues: - t2.micro - t2.large - t2.nano Description: My Instance type

TKDImageID: Type: AWS::EC2::Image::Id Description: alinux2 Default: ami-0r51231xxxxxxxx

Resources: EC2Instance: Type: AWS::EC2::Instance Properties: SubnetId: !Ref TKDSubnetID BlockDeviceMappings: - DeviceName: /dev/xvda Ebs: VolumeSize: 50 Encrypted: true ImageId: !Ref TKDImageID InstanceType: !Ref TKDInstanceType KeyName: !Ref TKDKeyName SecurityGroupIds: !Ref TKDSGID Tags: - Key: Createdby Value: suryanarayana.seera@gmail.com - Key: Purpose Value: To create EC2 instance for pcluster ami

Outputs: MyEC2InstanceID: Value: !Ref EC2Instance Description: My Instance ID

asked 8 months ago1.4K views
1 Answer
0

Hi Surya,

It seems the issue might be related to several key factors in your CloudFormation template. Please ensure that the following resources are correctly configured and exist:

**Security Group ID (SGID): ** Ensure the specified Security Group ID exists and is correctly configured.

Subnet ID: Verify that the provided Subnet ID is valid and available in the desired availability zone.

Key Pair: Double-check that the key pair exists in the region you're deploying to.

AMI ID: The AMI ID should be validated, as some instance types or regions may not support the specified AMI.

Additionally, I would recommend considering the following updates for better performance and compatibility:

Instead of using the T2 instance types, which are an older generation, I suggest opting for T3 or T3a instances if you are using x86-based AMIs. For ARM-based AMIs, you can use T4g instances, which provide better performance and cost efficiency with Graviton processors. Double-check that your chosen AMI is compatible with the instance type, as some of the latest AMIs and OS versions may not fully support the older T2 instances.

Also, as a best practice for privacy and security, avoid posting actual resource IDs such as Subnet IDs, Security Group IDs, and Key Pairs publicly. Please redact or scrub them when sharing your templates.

profile picture
answered 8 months ago
profile picture
EXPERT
reviewed 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions

Relevant content