Skip to content

Latest commit

Β 

History

History
92 lines (74 loc) Β· 2.35 KB

File metadata and controls

92 lines (74 loc) Β· 2.35 KB

Quick AWS Deployment Checklist

βœ… What You Need to Do in AWS Console

1. Create S3 Bucket

  • Go to S3 β†’ Create bucket
  • Name: yourcompany-product-images-prod (unique name)
  • Region: Same as your EC2 (e.g., us-east-1)
  • Encryption: Enable (SSE-S3)
  • Save bucket name

2. Create IAM Policy

  • Go to IAM β†’ Policies β†’ Create policy
  • Use JSON tab, paste:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:HeadObject"],
            "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
        },
        {
            "Effect": "Allow",
            "Action": ["s3:ListBucket"],
            "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME"
        }
    ]
}
  • Replace YOUR-BUCKET-NAME with your bucket name
  • Name: ProductServiceS3Policy

3. Create IAM Role (Recommended)

  • Go to IAM β†’ Roles β†’ Create role
  • Select EC2 β†’ Next
  • Attach ProductServiceS3Policy β†’ Next
  • Name: EC2-S3-Access-Role β†’ Create role

4. Attach Role to EC2

  • Go to EC2 β†’ Instances
  • Select your instance β†’ Actions β†’ Security β†’ Modify IAM role
  • Select EC2-S3-Access-Role β†’ Update

5. Update Application Configuration

Create application-prod.properties or use environment variables:

aws.region=us-east-1
aws.s3.bucket=your-bucket-name-here
aws.s3.endpoint-override=
aws.s3.path-style-enabled=false
aws.access-key-id=
aws.secret-access-key=

Note: Leave access keys empty if using IAM role (recommended)

6. Deploy Application

# Build
mvn clean package

# Copy to EC2
scp -i key.pem target/product-service.jar ec2-user@your-ec2-ip:~/app/

# SSH into EC2
ssh -i key.pem ec2-user@your-ec2-ip

# Run with production config
cd ~/app
java -jar product-service.jar --spring.config.location=application-prod.properties

πŸ” Alternative: Using Access Keys (Less Secure)

If not using IAM role, create IAM user:

  • IAM β†’ Users β†’ Create user
  • Attach ProductServiceS3Policy
  • Create access key β†’ Save keys securely
  • Set environment variables on EC2:
export AWS_ACCESS_KEY_ID=your-key-id
export AWS_SECRET_ACCESS_KEY=your-secret-key

See AWS_DEPLOYMENT_GUIDE.md for detailed step-by-step instructions.