Skip to content

Latest commit

 

History

History
151 lines (142 loc) · 3.64 KB

AWS_Hosting.md

File metadata and controls

151 lines (142 loc) · 3.64 KB

AWS Hosting

Resoures

S3 Development Bucket

bucket_name

yenius--rails6-api--s3-bucket-dev

region

us-east-2

access

Objects can be public

bucket_policy

{
  "Version": "2012-10-17",
  "Id": "DevBucketAdminPolicy",
  "Statement": [
    {
      "Sid": "DevAdminStatement",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::157703510654:user/yenius--rails6-api--s3-admin-user"
      },
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-dev/*",
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-dev"
       ]
     }
   ]
}

bucket_CORS

[
    {
        "AllowedHeaders": [
            "Authorization"
        ],
        "AllowedMethods": [
            "GET",
            "POST",
            "PUT"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    }
]

S3 Production Bucket

bucket_name

yenius--rails6-api--s3-bucket-prod

region

us-east-2

access

Objects can be public

bucket_policy

{
  "Version": "2012-10-17",
  "Id": "ProdBucketAdminPolicy",
  "Statement": [
    {
      "Sid": "ProdAdminStatement",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::157703510654:user/yenius--rails6-api--s3-admin-user"
      },
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-prod/*",
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-prod"
       ]
     }
   ]
}

bucket_CORS

[
    {
        "AllowedHeaders": [
            "Authorization"
        ],
        "AllowedMethods": [
            "GET",
            "POST",
            "PUT"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    }
]

IAM

IAM User Name

yenius--rails6-api--s3-admin-user

IAM Group Name

yenius--rails6-api--s3-admin-group

IAM Policy Name

yenius--rails6-api--s3-admin-group-policy

the managed policy is attached to the group, and the user is a member of the group

IAM Policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "YeniusRails6ApiS3AdminGroupPolicy",
      "Effect": "Allow",
      "Action": "s3:*",
      "Resource": [
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-dev",
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-dev/*",
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-prod",
        "arn:aws:s3:::yenius--rails6-api--s3-bucket-prod/*"
      ]
    }
  ]
}