deploying my resume
Welcome to the CloudmyTribe Cloud Challenge projects! This initiative is designed to help you build cloud-based products using AWS services. Whether you're just getting started with cloud technologies or looking to sharpen your skills, these projects offer a comprehensive, hands-on experience.
Action: Follow the steps below to deploy your HTML resume as a static website on S3.
aws s3 mb s3://your-bucket-name
aws s3 cp /path/to/your/resume s3://your-bucket-name/ --recursive
aws s3 website s3://your-bucket-name/ --index-document index.html
aws s3api put-bucket-policy --bucket your-bucket-name --policy '{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
}
]
}'
Outcome: Your resume hosted on an S3 static website.
Action: Use the following steps to enable HTTPS for your S3 website using CloudFront.
DISTRIBUTION_ID=$(aws cloudfront create-distribution --origin-domain-name your-bucket-name.s3.amazonaws.com --default-root-object index.html --query 'Distribution.Id' --output text)
aws acm request-certificate --domain-name yourdomain.com --validation-method DNS
CERTIFICATE_ARN=$(aws acm list-certificates --query "CertificateSummaryList[?DomainName=='yourdomain.com'].CertificateArn" --output text)
aws cloudfront update-distribution --id $DISTRIBUTION_ID --default-root-object index.html --origins Quantity=1,Items=[{Id=1,DomainName=your-bucket-name.s3.amazonaws.com,OriginPath=,CustomHeaders={Quantity=0},S3OriginConfig={OriginAccessIdentity=}},DefaultCacheBehavior={TargetOriginId=1,ViewerProtocolPolicy=redirect-to-https,AllowedMethods={Quantity=2,Items=[GET,HEAD]},ForwardedValues={QueryString=false,Cookies={Forward=none}},TrustedSigners={Enabled=false,Quantity=0},ViewerCertificate={ACMCertificateArn=$CERTIFICATE_ARN,SSLSupportMethod=sni-only,MinimumProtocolVersion=TLSv1.2_2019},DefaultCacheBehavior={TargetOriginId=1,ViewerProtocolPolicy=redirect-to-https}}]
Outcome: Your resume accessible over HTTPS.
Action: Configure a custom domain to point to your CloudFront distribution using Route 53.
aws route53 create-hosted-zone --name yourdomain.com --caller-reference $(date +%s)
HOSTED_ZONE_ID=$(aws route53 list-hosted-zones-by-name --dns-name yourdomain.com --query "HostedZones[0].Id" --output text | cut -d'/' -f3)
aws route53 change-resource-record-sets --hosted-zone-id $HOSTED_ZONE_ID --change-batch '{
"Changes": [
{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "yourdomain.com",
"Type": "A",
"AliasTarget": {
"HostedZoneId": "Z2FDTNDATAQYW2", # CloudFront hosted zone ID
"DNSName": "your-distribution.cloudfront.net",
"EvaluateTargetHealth": false
}
}
}
]
}'
Outcome: Your resume accessible at your custom domain.
aws iam create-role --role-name S3AccessRole --assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}'
aws iam attach-role-policy --role-name S3AccessRole --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess
aws iam create-user --user-name S3AccessUser
aws iam attach-user-policy --user-name S3AccessUser --policy-arn arn:aws:iam::aws:policy/A