The Python program ought to:
- Allow the user to input how many EC2 instances they want names for and output the same amount of unique names.
- Allow the user to input the name of their department that is used in the unique name.
- Generate random characters and numbers that will be included in the unique name.
- Push your code to GitHub.
Requirements:
- AWS
- GitHub
- Python
Initially, sign into your AWS Console.
Type “Cloud9” into the search box. Build the environment.
Click Open after it has been finished.
After arriving at your Cloud9 page, to construct your branch, click on main on the bottom right-hand side.
Once made, it will be as follows:
Go to your GitHub account.
The branches you have generated on Cloud9 will show up on GitHub under the “your branches” section.
After seeing it on GitHub. Resuming our Cloud9 environment, let’s build the Python file. Positioned to the left, click the file drop-down menu and select new from template to select a Python file. Then select file and save as; a window similar to the one below will display. After entering the file name, click save.
The file will show up on the left-hand side of your screen.
Let’s kickstart the party by scripting it!
Import Random should be entered on the first line. Images should appear after that.
Run it after you’ve finished. The resulting image should appear like this.
It does indeed function!
Return to source control by selecting it from the left side.
Put your cursor over the name and click the PLUS symbol to stage it. After that, enter your message into the box. Save your message once you’re finished. Ctrl + Enter if you’re using a Windows machine. The keystroke is command + S on a Mac.
Pushing it to GitHub is necessary after committing it. You may see the 1 arrow at the bottom of the screen if you look down. To move it, simply click on it.
Let’s return to GitHub.
Select the branches by clicking.
Click on the active branch once you are on the branch’s main page.
Click on the name once you’re in the active branches.
The script that was written in the Cloud9 environment can be accessed by clicking on the name with the .py extension.
Below is a GitHub summary image.
Go ahead and click on compare & pull request to merge the branch into main.
Click create pull request on the following page.
You must combine pull request on the new page that will pop up after clicking it. Take a look at the illustration below.
You will then be prompted to confirm. Go ahead and delete your branch after confirming.
The ultimate outcome is displayed below.
You can follow this progress on my GitHub page.
https://github.com/lesekr/summerred/blob/11ff84e70531306e0412929a59e77ece3d99e58e/EC2generator.py