EC2 RANDOM NAME GENERATOR

Lesekr
4 min readAug 6, 2023

--

The Python program ought to:

  1. Allow the user to input how many EC2 instances they want names for and output the same amount of unique names.
  2. Allow the user to input the name of their department that is used in the unique name.
  3. Generate random characters and numbers that will be included in the unique name.
  4. Push your code to GitHub.

Requirements:

  1. AWS
  2. GitHub
  3. Python

Initially, sign into your AWS Console.

Type “Cloud9” into the search box. Build the environment.

Click Open after it has been finished.

under the Cloud9 IDE, click on Open hyperlink.

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:

with a cloud UP arrow next to your branch name to publish branch to GitHub.

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.

The top half
The bottom

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.

Look for the U.

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.

1 UP ARROW needs to be pushed.

Let’s return to GitHub.

Select the branches by clicking.

Two branches

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.

MAIN HOME PAGE

--

--