The setenv command is for changing environment variables. Therefore, the command you tried matches the bash equivalent:
export InstanceType=t2.medium
And does nothing for your beanstalk environment.
You can create an environment using the -i option during creation
eb create -i t2.micro
Or you can use eb config to edit the current environment. This will open a text editor. Find the section that looks like this:
aws:autoscaling:launchconfiguration: IamInstanceProfile: aws-elasticbeanstalk-ec2-role EC2KeyName: aws InstanceType: t1.micro
And edit t1.micro to t2.micro. (save and exit)
But to make your life easier, you can save below .elasticbeanstalk/saved_configs/default.cfg.yml , and the CLI will use all of these settings for all future creations.
AWSConfigurationTemplateVersion: 1.1.0.0 OptionSettings: aws:elb:loadbalancer: CrossZone: true aws:elasticbeanstalk:command: BatchSize: '30' BatchSizeType: Percentage aws:autoscaling:launchconfiguration: IamInstanceProfile: aws-elasticbeanstalk-ec2-role EC2KeyName: aws InstanceType: t2.micro aws:elb:policies: ConnectionDrainingEnabled: true aws:autoscaling:updatepolicy:rollingupdate: RollingUpdateType: Health RollingUpdateEnabled: true aws:elb:healthcheck: Interval: '30'
Nick humrich
source share