1. Create An AWS Account
2. Add user
3. CodeStar with Django Aws
- Pick a region (Ireland and Stockholm the cheapest)
- Go to https://eu-west-1.console.aws.amazon.com/codesuite/codestar/home?region=eu-west-1#
- Start Project
- Choose Python (Django) with AWS Elastic Beanstalk
- Project repository CodeCommit
- Add key pair (no key see this https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#having-ec2-create-your-key-pair )
- Start project
- Wait till project is ready
4. Access the project
- You can see it the Beanstalk
- You can get the url from the Beanstalk project
- You can see the pipeline and all developers tools in CodeStart
- You can access ec2 instance also
5. Access and update the code
In codeStart you can access
1. Cloud9 to edit online, create an environment
2. Code commit or github to work on local device
6. Update code CI/CD
1. Make change to the code in cloud9 for testing
2. Save the changed files
3. Commit them
4. Run git push (You can see the last code commit on Repository tab)
5. Pipeline will be triggered
6. If the the test fails in the build the code will not be deployed
7. Get credentials to connect locally
1. Install Git on your local computer.
2. Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/. Sign in as the IAM user who will use Git credentials for connections to your AWS CodeStar project repository in CodeCommit.
3. In the IAM console, in the navigation pane, choose Users, and from the list of users, choose your IAM user.
4. On the user details page, choose the Security Credentials tab, and in HTTPS Git credentials for CodeCommit, choose Generate.
8. Clone project locally
1. AWS CodeStar console → open project → Repository → get the Clone URL
2. On your local computer, open a terminal or command line window and change directories to a temporary directory. Run the git clone
git clone https://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-first-projec
3. The first time you connect, you are prompted for the user name and password for the repository. For CodeCommit, enter the Git credentials user name and password you downloaded in the previous procedure.
4. Make any changes
5. Commit and push
6. On the Repository page, view the changes in progress. You should see that the commit history for the repository is updated with your commit
9. Changing the main app name
The default deployed project by codestar comes with the main app name ebdjango, if you changed that you need to change it in the configuration of the elastic beanstalk.
1. Open the Elastic Beanstalk console, and in the Regions list, select your AWS Region.
2. In the navigation pane, choose Environments, and then choose the name of your environment from the list.
3. In the navigation pane, choose Configuration.
4. In the Software configuration category, choose Edit.
5. Change WSGIPath
6. Under Environment properties change DJANGO_SETTINGS_MODULE
Change the main app name in .ebextentions/django.config file
Beanstalk Incorrect application version found
Default max deployment time -Command timeout- is 600 (10 minutes)
Your Environment → Configuration → Deployment preferences → Command timeout
Increase it Deployment preferences for example 1800
or upgrade the instance type to work faster
An option might help you to check
configure your environment to ignore health checks during deployment and redeploy the new version to force the deployment to complete.
Deployment policies and settings – AWS Elastic Beanstalk
Things you might need:
upgrade SQLite wget https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-devel-3.8.11-1.fc21.x86_64.rpm wget https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-3.8.11-1.fc21.x86_64.rpm sudo yum install sqlite-3.8.11-1.fc21.x86_64.rpm sqlite-devel-3.8.11-1.fc21.x86_64.rpm
Then I checked SQLite version:
Update Python tutorial for AWS Cloud9
For Ubuntu Server:
sudo apt update
1. Install Python by running the install command.
For Amazon Linux:
sudo yum -y install python3
For Ubuntu Server:
sudo apt-get install python3
Launching and connecting to an external Amazon RDS instance in a default VPC – AWS Elastic Beanstalk