USING AWS IN CLI WITH SOME EXAMPLES OF EC2

Shubham kumar
3 min readOct 27, 2020

--

#awscloud #awscli #aws #vimaldaga #righteducation #educationredefine #rightmentor #worldrecordholder #linuxworld #makingindiafutureready #righeudcation #arthbylw #awsbylw\

Task 3

1. Creating a key pair

create-key-pair

— key-name <value>

[ — dry-run | — no-dry-run]

[ — tag-specifications <value>]

[ — cli-input-json <value>]

[ — generate-cli-skeleton <value>]

2. Create a security group

create-security-group--description <value>--group-name <value>[--vpc-id <value>][--tag-specifications <value>][--dry-run | --no-dry-run][--cli-input-json <value>][--generate-cli-skeleton <value>

3. Launch an instance using the above created key pair and security group.

run-instances[--block-device-mappings <value>][--image-id <value>][--instance-type <value>][--ipv6-address-count <value>][--ipv6-addresses <value>][--kernel-id <value>][--key-name <value>][--monitoring <value>][--placement <value>][--ramdisk-id <value>][--security-group-ids <value>][--security-groups <value>][--subnet-id <value>][--user-data <value>][--additional-info <value>][--client-token <value>][--disable-api-termination | --enable-api-termination][--dry-run | --no-dry-run][--ebs-optimized | --no-ebs-optimized][--iam-instance-profile <value>][--instance-initiated-shutdown-behavior <value>][--network-interfaces <value>][--private-ip-address <value>][--elastic-gpu-specification <value>][--elastic-inference-accelerators <value>][--tag-specifications <value>][--launch-template <value>][--instance-market-options <value>][--credit-specification <value>][--cpu-options <value>][--capacity-reservation-specification <value>][--hibernation-options <value>][--license-specifications <value>][--metadata-options <value>][--count <value>][--secondary-private-ip-addresses <value>][--secondary-private-ip-address-count <value>][--associate-public-ip-address | --no-associate-public-ip-address][--cli-input-json <value>][--generate-cli-skeleton <value>]

4. Create an EBS volume of 1 GB.

create-volume--availability-zone <value>[--encrypted | --no-encrypted][--iops <value>][--kms-key-id <value>][--outpost-arn <value>][--size <value>][--snapshot-id <value>][--volume-type <value>][--dry-run | --no-dry-run][--tag-specifications <value>][--multi-attach-enabled | --no-multi-attach-enabled][--cli-input-json <value>][--generate-cli-skeleton <value>]

5. The final step is to attach the above created EBS volume to the instance you created in the previous steps.

attach-volume--device <value>--instance-id <value>--volume-id <value>[--dry-run | --no-dry-run][--cli-input-json <value>][--generate-cli-skeleton <value>]
Reference:- https://docs.aws.amazon.com/cli/latest/reference/ec2/

--

--

No responses yet