Deploy an application created with Ruby on Rails Use Elastic Beanstalk (EB) to build an environment in the shortest possible time. It is divided into IAM authority change, environment construction, and EB deployment. We will focus on deploying quickly, so please be aware of this if you need strict control.
IAM authority change Environment construction EB Deployment
It is not good for security to execute with root authority, so let's create an appropriate user and assign the following authority. · AWSElasticBeanstalkFullAccess ・ AmazonRDSDataFullAccess ・ AWSCloudFormationFullAccess ・ AWSCloud9Administrator (for cloud9 users) EB includes access authority to EC2 and S3, but does not include authority to RDS, so additional authority is assigned. In addition, cloudformation may be used during management and operation after building the EB deployment environment (such as infrastructure ver management or viewing with a designer to see the overall configuration), so it may be good to allocate it in advance. If you are deploying using cloud9, let's also touch AWS Cloud9 Administrator
Also, later, we will install the AWS CLI (command line interface) and deploy it on the command, so let's also get the access key and secret access key at that time.
Click here for EB authority range
Follow the AWS Official Guide (https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/install-virtualenv.html). Just copy and paste the following in the terminal:
pip install --user virtualenv
virtualenv ~/cli-ve
source ~/cli-ve/bin/activate
pip install --upgrade awscli
aws --version
deactivate
brew install awsebcli
#Confirm that the eb command can be used
eb --version
$aws configure
AWS Access Key ID [****************225N]: #Copy the Access Key obtained from IAM
AWS Secret Access Key [****************ERNe]: #Copy the Secret Access Key obtained from IAM
Default region name [ap-northeast-1]: #OK with enter as it is
Default output format [json]: #OK with enter as it is
Now you are ready to deploy the EB. thank you for your hard work. Next time I will deploy EB.
Recommended Posts