Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

365
Views
Is it possible to use T2 Unlimited instances in Elastic Beanstalk?

I am trying to use T2 Unlimited instances with Elastic Beanstalk. I don't want to configure this after the instances have launched, so I am wondering if anyone knows if it's at all possible with EB configuration?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I found a solution. Posting it here in case others run into the same issue:

  1. Create an IAM policy that allows the ec2 instances in your elastic beanstalk environment to modify instance credit specification and attach it to your elastic beanstalk ec2 role.
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "InstanceCreditPolicy",
            "Effect": "Allow",
            "Action": [
                "ec2:ModifyInstanceCreditSpecification",
                "ec2:DescribeInstanceCreditSpecifications"
            ],
            "Resource": "*"
        }
    ]
}
  1. Create an eb extension (.ebextensions/01-set-instance-credit-unlimited.config)
commands:
  set-instance-credit-unlimited:
    command: |
      aws ec2 modify-instance-credit-specification --region <your_region> --instance-credit-specification '[{"InstanceId": "'"$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)"'","CpuCredits": "unlimited"}]'
over 4 years ago · Santiago Trujillo Report

0

In case you're using solution stack- "64bit Amazon Linux 2017.03 v4.1.1 running Node.js", in addition to creating the policy described by user steinim, you need to use these two config files instead:

1) upgrade-awscli.config

commands: 
  modify-instance-credit-specification:
    command: "sudo pip install --upgrade awscli"

2) t2-unlimited-test.config

commands: 
  modify-instance-credit-specification:
    command: "aws ec2 modify-instance-credit-specification --region us-west-2 --instance-credit-specification '[{\"InstanceId\": \"'\"$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)\"'\",\"CpuCredits\": \"unlimited\"}]'"
over 4 years ago · Santiago Trujillo Report

0

I was looking for an answer to this myself, but have noticed that t3 EC2 instances have unlimited mode enabled by default [1][2], as well as being cheaper than t2 instances. Therefore, if you use a t3 instance type in your EB env, you're good to go, with no additional EB env configuration required.

[1] https://aws.amazon.com/blogs/aws/new-t3-instances-burstable-cost-effective-performance/

[2] https://aws.amazon.com/ec2/instance-types/t3/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!