Skip to content

Instantly share code, notes, and snippets.

View ShubhamRasal's full-sized avatar
💻
Cooking software

Shubham Rasal ShubhamRasal

💻
Cooking software
View GitHub Profile
@ShubhamRasal
ShubhamRasal / s3 cp
Created December 6, 2020 10:55
s3 cp
aws s3 cp aws_image.jpg s3://dev-creatorsbyheart.com
aws s3api put-bucket-policy --bucket dev-creatorsbyheart.com --policy file://s3_bucket_policy.json
{
"Version": "2008-10-17",
"Id": "PolicyForPublicWebsiteContent",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@ShubhamRasal
ShubhamRasal / create-bucket
Created December 6, 2020 10:25
create-bucket creatorsbyheart
aws s3api create-bucket --bucket dev-creatorsbyheart.com --region us-east-1
@ShubhamRasal
ShubhamRasal / run-instances-role
Last active December 6, 2020 10:08
run-instances-role
aws ec2 run-instances --image-id ami-0e306788ff2473ccb \
--count 1 --instance-type t2.micro \
--key-name creatorsbyheart \
--security-groups "MySecurityGroup" \
--placement AvailabilityZone=ap-south-1a \
--iam-instance-profile "Name=aws-system-manager"
aws ec2 authorize-security-group-ingress --group-id sg-04e749bf892aa62e7 --protocol tcp --port 80 --cidr 0.0.0.0/24
@ShubhamRasal
ShubhamRasal / add-role-to-instance-profile
Created December 6, 2020 09:42
add-role-to-instance-profile
aws iam add-role-to-instance-profile --instance-profile aws-system-manager --role-name aws-system-manager
@ShubhamRasal
ShubhamRasal / create-instance-profile
Created December 6, 2020 09:40
create-instance-profile
aws iam create-instance-profile --instance-profile-name aws-system-manager
@ShubhamRasal
ShubhamRasal / attach-role-policy
Created December 6, 2020 09:38
attach ssm policy to ec2 role
aws iam attach-role-policy --role-name aws-system-manager --policy-arn "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
@ShubhamRasal
ShubhamRasal / aws-ssm-ec2-policy
Created December 6, 2020 09:33
policy for creating role for assm
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {"Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}
}