Code Monkey home page Code Monkey logo

aws-hands-on-1's Introduction

AWS Hands on Continuation

Amazon RDS

  • The process of creating a database aws-1

  • AWS RDS Aurora being created using the mySQL database engine aws-2

  • Then the creation of AWS Elasticache Redis Cache

aws-3

  • The creation of a domain abdulhamid.com on amazon Route53,

aws-4

  • Creation of an S3 Bucket

    aws-5

  • S3 bucket named myabdulbucket being created already

    aws-6

  • Uploading a png file on my AWS S3 bucket

aws-7

aws-8

Sample of an S3 Bucket policy

{

"id" : "Policy15672859245",
"Version": "2012-10-17",
"Statement": [

{

"Sid": "Stmt12674263965",
"Action":[

"s3: BetObject"
],
"Effect":"Allow",
"Resource":"arn:aws:s3:::myabdulbucket",
"Principal":"*"
}
]


}


  • Uploading a static website on AWS S3, index.html file

aws-9 aws-10 aws-11

  • Bucket Versioning enabled aws-1

  • Bucket version for the index.html file shown there

aws-2

  • S3 Bucket Replica being created, by first creating the bucket and its replica

aws-3

  • Creation of a destination bucket replication rule

aws-4

  • Batch Object Operations asking if we want to replicate exisiting objects aws-5

  • the replication rule created finally

aws-6

  • Setting of storage classes for the AWS S3 Bucket object from the properties tab

aws-7

aws-8

  • Ading a lifecycle rule for the objects in the S3 Bucket

aws-9

  • Getting started with the EC2 instance metadata Version 2 (V2)

launching of eC2 instance for the instance metadata

aws-10

  • The first token code for the imdsV2 being put in our EC2 instance connect to get our token for the metadata

aws-11

  • Here are the tokens to be used
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/
  • Our token for imdsV2 getting our EC2 instance metadata works as expected

aws-12

  • Creation of an S3 Event from the property section in the S3 bucket you created

aws-13

  • Creation of an event notification

  • Creation of queue for the event notification destination

aws-15

  • Editing the SQS Queue policy to accept the event notification

aws-16

  • Generating the policy for the amazon SQS Queue using the aws policy generator

aws-17

Here is the policy in JSON

{
  "Id": "Policy1711364311955",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1711364309953",
      "Action": [
        "sqs:SendMessage"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:sqs:us-east-1:058264276076:demos3notification",
      "Principal": "*"
    }
  ]
}

Now our event notification has been created finally

aws-18

  • Working on the server side encryption settings on the objects in the S3 bucket

aws-19

  • Here is the final encryption being created finally

aws-20

  • Setting up an statice website hosting and then planning to work on CORS(Cross Origin Resource Sharing)

aws-21

  • Got an error from setting the static website

aws-22

  • Finally working now

aws-23

Due to the bucket policy I added to allow public access

Here is the bucket policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::demo-encryption-mide/*"
        }
    ]
}
  • Created another bucket to allow the CORS

aws-24

  • Then we have the CORS policy to allow the cross origin possible
[
    {
        "AllowedHeaders": [
            "Authorization"
        ],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "http://demo-encryption-mide.s3-website-us-east-1.amazonaws.com"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    }
]
  • CORS origin worked finally

aws-25

  • Getting the server side logging for the S3 bucket done

aws-26

  • Making use of S3 presigned URL to share files and data for a specific period of time

aws-27

  • Creation of an S3 Bucket for cloudfront

aws-28

  • Creation of a Cloudfront distribution using our S3 bucket aws-29

  • The Cloudfront distribution has been successfully made and then the S3 policy has been updated:

  • Here is the S3 bucket policy

{
    "Version": "2008-10-17",
    "Id": "PolicyForCloudFrontPrivateContent",
    "Statement": [
        {
            "Sid": "AllowCloudFrontServicePrincipal",
            "Effect": "Allow",
            "Principal": {
                "Service": "cloudfront.amazonaws.com"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::demo-cloudfront-mide/*",
            "Condition": {
                "StringEquals": {
                    "AWS:SourceArn": "arn:aws:cloudfront::058264276076:distribution/E2LL851ED9SCNW"
                }
            }
        }
    ]
}

aws-30

aws-hands-on-1's People

Contributors

ham12-3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.