Cloud Bootcamp: Cloud Project

You cant leave out learning more about a cloud provider when learning cloud engineering. I stuck with AWS since it is what I know best. Cloud computing is the future is it best to learn it now. More and more companies will be adopting cloud infrastructure.        -         

What is cloud computing? Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data centers and servers, you can access technology services, such as computing power, storage, and databases, on an as-needed basis

-          What are the big 3 cloud providers? Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP)

       Serverless Sending Application:

  1.    Manage email and SMS sendings using Step Functions;

  2.   Create and send an email with AWS using SES and Lambda;

  3.    Lambda: AWS Lambda is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers. You can trigger Lambda from over 200 AWS services and software as a service (SaaS) applications, and only pay for what you use. Lambda's strength lies in its ability to interact with other AWS services. It is possible to make instructions such as "send the received data to SQS" or "change the format of an image uploaded to S3" using Lambda. In order for a Lambda function to interact with a service, the function must have what is called a Lambda Role. The Lambda Role contains the permissions of our Lambda function, such as the permission to use all actions of the SNS service for example.

  1. To interact with AWS services like SES, SNS, and Step Functions, a Lambda Role needs to be created with execution rights for these services. Here is a summary of the steps to create the Lambda Role

  2.      Go to the IAM (Identity and Access Management) console and select "Roles".

  3.     Click on "Create Role" to start creating a new role.

  4.    Choose "AWS Service" as the trusted entity type and select "Lambda" as the use case.

  5.   Add permissions to the role by searching for the service names (SES, SNS, and Step Functions) and selecting "Full Access" to grant all necessary permissions.

  6. Note: It is recommended to refine the permissions by specifying only the necessary rights for the actions you intend to perform with the services.

  7.     Validate and create the Lambda Role with a desired name.

  8. Once the Lambda Role is created, you can proceed to create the first Lambda function, "email.py".

  9.   SES- an email platform that provides an easy, cost-effective way for you to send and receive email using your own email addresses and domains


  1. Before using SES, ensure that the sender's and recipient's email addresses are verified in SES.

  2. Create a Lambda function called "email" using Python 3.9.

  3. Import the boto3 library to interact with AWS services.

  4. Initialize the SES client using boto3.client('ses').

  5. Define the lambda_handler function, which receives the event and context arguments.

  6. Use the SES send_email function to send an email. Specify the source, destination, and message fields.

  7. Retrieve the destination email address and message from the event argument instead of hard-coding them.

  8. Add a return statement at the end of the function.

  9. Deploy and test the Lambda function by configuring a test event with the destination email address and message.

  10. Verify that the email is successfully sent and received.

  11.    Step function- a visual workflow service that helps developers use AWS services to build distributed applications, automate processes, orchestrate microservices, and create data and machine learning (ML) pipelines

  1. I couldn’t verify my phone number so I was unable to get SMS to work.

  2. Step Functions is a low-code, visual workflow service provided by AWS. It allows developers to build distributed applications, automate IT and business processes, and create data and machine learning pipelines using AWS services. To manage how to send messages using Step Functions, follow these steps:

  3. Access the Step Functions console and select "State machines".

  4. Click on "Create state machine".

  5. Choose the option to "Write your workflow in code".

  6. Select the "Standard" type for the state machine, as it is eligible for the Free Tier.

  7. Define the state machine using JSON code.

  8. Start by adding a comment explaining the functionality of the state machine.

  9. Set the starting point of the state machine using the "StartAt" field.

  10. Create states for handling different types of sending, such as email or SMS.

  11. Use the "Choice" type state to select the appropriate action based on the value of the "typeOfSending" variable.

  12. Define the "Email" and "SMS" states as "Task" types, specifying the ARNs of the corresponding Lambda functions.

  13. Mark the "Email" and "SMS" states as the end states.

  14. Add the ARNs of the Lambda functions to the corresponding states.

  15. Provide a name for the state machine and create it.

  16. Start an execution of the state machine by providing a test input with the required variables.

  17. Verify the successful execution of the state machine by checking the generated workflow graph and confirming the message delivery.

  18. With the completion of the state machine, you can proceed to the next step, which is creating the REST API handler using Lambda.

This resource was very helpful. https://tutorialsdojo.com/aws-cheat-sheets/

Previous
Previous

Cloud Bootcamp: DevOps

Next
Next

Cloud Bootcamp: Python and Git