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 / cloudfront create-invalidation
Created October 18, 2020 17:19
cloudfront create-invalidation
aws cloudfront create-invalidation --distribution-id EENNAX11SI81 --paths '/*'
@ShubhamRasal
ShubhamRasal / cloudfront url
Created October 18, 2020 17:33
cloudfront url
aws cloudfront list-distributions --query DistributionList.Items[*].[Id,DomainName,Origins.Items[0].Id]
@ShubhamRasal
ShubhamRasal / create aws-system-manager role
Created December 6, 2020 09:29
command which creates new role
aws iam create-role --role-name aws-system-manager --assume-role-policy-document file://system-manager-role-policy.json --permissions-boundary "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM" --tags "Key=name,Value=aws-system-manager"
@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"
}
}
@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 / 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 / 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
aws ec2 authorize-security-group-ingress --group-id sg-04e749bf892aa62e7 --protocol tcp --port 80 --cidr 0.0.0.0/24
@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"
@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