Monday, 23 September 2024

CloudFront AWS lab

 AWS CloudFront is a content delivery network (CDN) service that delivers content to users with low latency and high transfer speeds. It caches content at edge locations around the world, reducing the distance data travels and improving performance.

1. Prerequisites

  • An AWS account
  • Content to be distributed (e.g., static website files, images, videos)

2. Create a Distribution

  • Navigate to CloudFront: In the AWS Management Console, search for "CloudFront" and select the service.
  • Create a distribution: Click on "Create distribution".
  • Choose an origin: Select the origin of your content (e.g., S3 bucket, EC2 instance).
  • Configure settings: Specify additional settings like default cache behavior, viewer protocol policies, and distribution settings.
  • Create the distribution: Click "Create distribution".
  • Image of creating a distribution in AWS CloudFront

3. Upload Content to Origin

  • Access your origin: If your origin is an S3 bucket, use the AWS Management Console to upload your content.
  • Make content publicly accessible: Ensure that your content is publicly accessible so CloudFront can distribute it.

4. Test the Distribution

  • Get the distribution domain name: Copy the domain name of your CloudFront distribution.
  • Access content: Use a web browser to access your content using the CloudFront domain name.
  • Verify performance: Measure the performance of your content delivery using tools like CloudFront metrics or third-party performance testing tools.
  • Image of testing a CloudFront distribution

Additional Steps

  • Create custom behaviors: Configure custom behaviors for specific paths or files within your distribution.
  • Use CloudFront functions: Extend CloudFront functionality with CloudFront functions.
  • Optimize for performance: Implement best practices for optimizing content delivery, such as compressing images and using HTTP/2.
  • Integrate with other AWS services: CloudFront can be integrated with other AWS services like AWS WAF for web application firewall and AWS Shield for DDoS protection.

AWS Cloud Map lab

 AWS Cloud Map is a scalable service that provides DNS-based service discovery for microservices applications. It allows services to automatically register and discover each other, making it easier to build resilient and scalable applications.

1. Prerequisites

  • An AWS account
  • A deployed microservices application

2. Create a Service Discovery Namespace

  • Navigate to Cloud Map:
    In the AWS Management Console, search for "Cloud Map" and select the service.
  • Create a namespace: Click on "Create namespace".
  • Provide details: Give your namespace a name and description.
  • Choose a namespace type: Select "DNS" for DNS-based service discovery.
  • Create the namespace: Click "Create namespace".
  • Image of creating a namespace in AWS Cloud Map

3. Create a Service

  • Select your namespace: Click on the namespace you just created.
  • Create a service: Click on "Create service".
  • Provide details: Give your service a name and description.
  • Choose a service type: Select the appropriate service type (e.g., "HTTP").
  • Configure settings: Specify the service discovery settings, such as the DNS record type and the port on which the service is listening.
  • Create the service: Click "Create service".
  • Image of creating a service in AWS Cloud Map

4. Register Instances

  • Select your service: Click on the service you just created.
  • Register instances: Click on "Register instances".
  • Provide details: Specify the instance IDs or IP addresses of the instances that belong to your service.
  • Register instances: Click "Register instances".
  • Image of registering instances in AWS Cloud Map

5. Test Service Discovery

  • Use the service name: Use the DNS name of your service to discover instances.
  • Example: If your service name is "my-service", you can use the DNS name my-service.<your-namespace>.local to discover instances.

Additional Steps

  • Create custom health checks: Configure custom health checks to ensure that only healthy instances are registered.
  • Integrate with other AWS services: Cloud Map can be integrated with other AWS services like AWS ECS and AWS Lambda.
  • Use Cloud Map API: Access Cloud Map features programmatically using the AWS SDKs or the Cloud Map API.

Amazon Application Recovery Controller lab

 AWS Application Recovery Controller (ARC) is a managed service that helps you create, manage, and test recovery plans for your applications. It simplifies the process of ensuring business continuity and disaster recovery.

1. Prerequisites

  • An AWS account
  • An existing application or workload to be protected

2. Create a Recovery Plan

  • Navigate to ARC: In the AWS Management Console, search for "Application Recovery Controller" and select the service.
  • Create a recovery plan: Click on "Create recovery plan".
  • Provide details: Give your recovery plan a name and description.
  • Choose a recovery type: Select the appropriate recovery type (e.g., failover, failback).
  • Create the plan: Click "Create recovery plan".
  • Image of creating a recovery plan in ARC

3. Add Resources to the Recovery Plan

  • Select your plan: Click on the recovery plan you just created.
  • Add resources: Click on "Add resources".
  • Choose resource types: Select the types of resources you want to include (e.g., EC2 instances, RDS instances).
  • Add resources: Search for and select the specific resources you want to protect.
  • Add to plan: Click "Add to plan".
  • Image of adding resources to a recovery plan in ARC

4. Configure Recovery Settings

  • Select your plan: Click on the recovery plan you just created.
  • Configure settings: Click on "Configure settings".
  • Set recovery options: Define recovery options like failover criteria, failback strategies, and recovery time objectives (RTOs).
  • Save settings: Click "Save".
  • Image of configuring recovery settings in ARC

5. Test the Recovery Plan

  • Select your plan: Click on the recovery plan you just created.
  • Test the plan: Click on "Test recovery plan".
  • Initiate test: Follow the prompts to initiate a test failover.
  • Validate recovery: Verify that your application is successfully running in the target environment.
  • Image of testing a recovery plan in ARC

Additional Steps

  • Create recovery groups: Organize resources into recovery groups for better management.
  • Integrate with other AWS services: ARC can be integrated with other AWS services like AWS Systems Manager for automation and AWS CloudWatch for monitoring.
  • Customize recovery plans: Tailor recovery plans to meet specific business requirements.

AWS App Mesh AWS lab

 AWS App Mesh is a service mesh that provides application-level networking for microservices-based applications. It makes it easy to discover, route, and monitor traffic between your services.

1. Prerequisites

  • An AWS account
  • An Amazon Elastic Kubernetes Service (EKS) cluster
  • A deployed microservices application

2. Create an App Mesh

  • Navigate to App Mesh:
    In the AWS Management Console, search for "App Mesh" and select the service.
  • Create a new mesh: Click on "Create mesh".
  • Provide details: Give your mesh a name and description.
  • Choose a mesh type: For this lab, select "Virtual Node".
  • Create the mesh: Click "Create".
  • Image of creating a new App Mesh in AWS

3. Create a Virtual Node

  • Select your mesh: Click on the mesh you just created.
  • Create a virtual node: Click on "Create virtual node".
  • Provide details: Give your virtual node a name and description.
  • Choose a namespace: Select the namespace where your microservice is running.
  • Configure the port mapping: Specify the port on which your service is listening.
  • Create the virtual node: Click "Create".
  • Image of creating a virtual node in App Mesh

4. Deploy the App Mesh Sidecar

  • Update your deployment: Modify your Kubernetes deployment manifest to include the App Mesh sidecar.
  • Deploy the updated manifest: Use kubectl apply to deploy the updated manifest.

5. Test Your Application

  • Access your application: Try to access your application. The App Mesh sidecar will handle traffic routing and management.
  • Monitor metrics: Use AWS CloudWatch to monitor metrics related to your application and App Mesh.
  • Image of monitoring App Mesh metrics in CloudWatch

Additional Steps

  • Create virtual routers and routes: If you have multiple microservices, you can create virtual routers and routes to control traffic flow.
  • Configure fault tolerance: Use App Mesh to implement fault tolerance mechanisms like retries and timeouts.
  • Integrate with other AWS services: App Mesh can be integrated with other AWS services like X-Ray for distributed tracing and AWS WAF for web application firewall.

API Gateway aws lab

 1. Log in to your AWS Management Console and navigate to API Gateway:

  • Go to the AWS Management Console.
  • Search for "API Gateway" in the search bar and select it.

2. Create a new API:

  • Click on the "Create API" button.
  • Choose "REST API" and click "Build".

3. Configure the API:

  • API Name: Give your API a meaningful name (e.g., "MyFirstAPI").
  • Description: Add an optional description.
  • Endpoint Type: Choose "Regional" for a single region or "Edge" for global distribution.
  • Protocol Type: Select "HTTP" or "WebSocket" based on your needs.
  • Security: Choose the appropriate security mechanism (e.g., IAM, API Key, Cognito).
  • Click "Create API".

4. Create a Resource:

  • In the API designer, click on the "Actions" button next to your API and select "Create Resource".
  • Give your resource a name (e.g., "hello").
  • Choose the "Method" (e.g., GET).
  • Click "Create Resource".

5. Configure the Method:

  • Click on the "Method Integration" button.
  • Choose "Lambda Function" as the integration type.
  • Select the Lambda function you want to integrate with.
  • Set the "Integration Type" to "Lambda Proxy Integration".
  • Click "Save".

6. Deploy the API:

  • Click on the "Actions" button next to your API and select "Deploy".
  • Choose a stage name (e.g., "dev").
  • Click "Deploy".

7. Test the API:

  • In the API designer, click on the "Test" button next to your method.
  • Enter any required parameters and click "Test".
  • You should see the response from your Lambda function.

8. Get the API Endpoint:

  • In the API designer, click on the "Stages" tab.
  • Click on the stage you deployed (e.g., "dev").
  • Copy the "Invoke URL" to access your API.

Additional Considerations:

  • Authorization: If you need to authorize API calls, configure the appropriate authorization mechanism in the API Gateway settings.
  • Throttling and Quotas: Set limits on API usage to prevent abuse.
  • Monitoring and Logging: Use CloudWatch to monitor API usage and troubleshoot issues.

Thursday, 19 September 2024

VPC AWS labs step by stepwith screenshot

 

1. Create a VPC

  • Navigate to VPC Console: In the AWS Management Console, search for "VPC" and select the service.
  • Create VPC: Click "Create VPC".
  • Configure VPC:
    • Name: Provide a meaningful name.
    • CIDR block: Choose a suitable CIDR block for your VPC.
  • Create VPC:
    Click "Create VPC".
  • Image of AWS VPC Console showing the creation of a VPC

2. Create Subnets

  • Select VPC: Choose the newly created VPC.
  • Create Subnet: Click "Create subnet".
  • Configure Subnet:
    • Name: Provide a meaningful name.
    • Availability zone: Choose the desired availability zone.
    • CIDR block: Choose a suitable CIDR block for the subnet.
  • Create Subnet: Click "Create subnet".
  • Image of AWS VPC Console showing the creation of a subnet

3. Create an Internet Gateway

  • Select VPC: Choose the VPC containing your subnets.
  • Create Internet Gateway: Click "Create internet gateway".
  • Attach Internet Gateway: Attach the internet gateway to the VPC.
  • Image of AWS VPC Console showing the creation and attachment of an internet gateway

4. Create a Route Table

  • Select VPC: Choose the VPC containing your subnets.
  • Create Route Table: Click "Create route table".
  • Associate Route Table: Associate the route table with your subnets.
  • Image of AWS VPC Console showing the creation and association of a route table

5. Create a Route

  • Select Route Table: Choose the route table associated with your subnets.
  • Create Route: Click "Create route".
  • Configure Route:
    • Destination: Specify the destination CIDR block (e.g., 0.0.0.0/0 for all traffic).
    • Target: Choose the internet gateway as the target.
  • Create Route: Click "Create route".
  • Image of AWS VPC Console showing the creation of a route

6. Launch an EC2 Instance

  • Navigate to EC2 Console: In the AWS Management Console, search for "EC2" and select the service.
  • Launch Instance: Click "Launch instance".
  • Choose Instance Type: Choose an appropriate instance type.
  • Configure Instance Details: Configure instance details (e.g., key pair, security group).
  • Configure Networking: Choose the VPC and subnet created earlier.
  • Launch Instance: Click "Launch".
  • Image of AWS EC2 Console showing the launch of an instance

7. Access the Instance

  • Connect to Instance: Use the provided SSH key to connect to the instance.
  • Image of terminal showing the connection to an EC2 instance

8. Additional Considerations

  • CIDR Blocks: Choose suitable CIDR blocks to avoid overlapping.
  • Subnet Types: Create public and private subnets based on your requirements.
  • Security Groups: Configure security groups to control network access.
  • NAT Gateways: Use NAT gateways to allow instances in private subnets to access the internet.

Route 53 labs step by stepwith screenshot

1. Create a Hosted Zone

  • Navigate to Route 53 Console: In the AWS Management Console, search for "Route 53" and select the service.
  • Create Hosted Zone: Click "Create hosted zone".
  • Configure Hosted Zone:
    • Name: Provide a meaningful name for your domain.
    • Comment:
      Add an optional comment.
  • Create Hosted Zone: Click "Create".
  • Image of AWS Route 53 Console showing the creation of a hosted zone

2. Create a Record Set

  • Select Hosted Zone: Choose the newly created hosted zone.
  • Create Record Set: Click "Create record set".
  • Configure Record Set:
    • Type: Choose the record type (e.g., A, CNAME).
    • Name: Specify the record name (e.g., "www").
    • Value: Enter the value for the record (e.g., IP address for A record, domain name for CNAME record).
    • TTL: Set the time to live for the record.
  • Create Record Set: Click "Create".
  • Image of AWS Route 53 Console showing the creation of a record set

3. Use the DNS Name

  • Obtain DNS Name: Use the provided DNS name for your hosted zone.
  • Configure DNS: Configure your DNS settings to point to the Route 53 DNS name.
  • Image of DNS configuration using the Route 53 DNS name

4. Additional Considerations

  • Record Types: Choose the appropriate record type based on your requirements (e.g., A for IPv4, CNAME for aliases).
  • Alias Records: Use alias records to route traffic to other AWS services (e.g., S3, CloudFront).
  • Routing Policies: Configure routing policies for complex routing scenarios (e.g., weighted routing, latency-based routing).
  • Monitoring: Use Route 53 metrics and health checks to monitor DNS resolution and performance.