How to delete Memcached cluster using AWS CLI

If you have an ElastiCache Memcached cluster that you no longer need, it’s better to delete it. Dno’t believe me? Even AWS said so too: It is almost always a good idea to delete clusters that you are not actively using. Until a cluster’s status is deleted, you continue to incur charges for it. [1] Well, I have a Memcached cluster that I don’t need anymore. But instead of deleting this cluster using AWS console [1], I’m going to do this via AWS CLI....

September 29, 2023 · 2 min · 326 words · kenno

Deleting VPC Endpoints With AWS CLI

This is a quick note on how to delete VPC endpoints that are no longer needed with AWS CLI. First, we need to find all the vpc-endpoints-ids [1]. ❯ aws ec2 describe-vpc-endpoints --query 'VpcEndpoints[].VpcEndpointId' [ "vpce-097008f8d26caxxxx", "vpce-07aaeabdefd8xxxx", "vpce-0bc6d548ff2e0xxxx" ] Note: I replaced the last 4 digit with ‘xxxx’. It’s a good idea to try out without really deleting the VPC endpoints by supplying --dry-run to the command below: ❯ aws ec2 delete-vpc-endpoints --vpc-endpoint-ids vpce-097008f8d26caxxxx vpce-07aaeabdefd8xxxx vpce-0bc6d548ff2e0xxxx --dry-run An error occurred (DryRunOperation) when calling the DeleteVpcEndpoints operation: Request would have succeeded, but DryRun flag is set....

September 27, 2023 · 1 min · 166 words · kenno

Installing AWS CLI on AlmaLinux

I already wrote a blog post on How to install AWS CLI on RockyLinux, where I shared how to leverage the RPM package from EPEL repository. So what do I need to create a post here? Well, when I tried to use the same method to install the AWS CLI on an AlmaLinux 9.2, there was an issue with dependency. Here is what happened: [kenno@wedev1 ~]$ sudo dnf install awscli [sudo] password for kenno: Last metadata expiration check: 0:05:08 ago on Sun 20 Aug 2023 18:35:23....

August 20, 2023 · 2 min · 226 words · kenno

How to delete AWS Workspace with AWS CLI

When you are finished with a WorkSpace, you can delete it. You can also delete related resources. In this post, I’ll be using AWS CLI to delete a WorkSpace that is no longer needed. To delete a WorkSpace using AWS CLI, we can use terminate-workspaces command [2]. But first, I’d need to find the workspace id. ➜ aws workspaces describe-workspaces --query 'Workspaces[].WorkspaceId' --output text ws-9xm222222 Now that I got the WorkSpace id as ws-9xm222222, I can proceed to terminate this WorkSpace....

August 10, 2023 · 3 min · 538 words · kenno

How to stop AWS Workspace with CLI

I need to stop a WorkSpace now and I don’t want to login to AWS WorkSpace console. The following is the steps I’m literally taking to achieve this goal. Find out the WorkSpace ID, assuming that my AWS CLI has been setup correctly. ❯ aws workspaces describe-workspaces { "Workspaces": [ { "WorkspaceId": "ws-9xm222222", "DirectoryId": "d-9767555555", "UserName": "kenno", "IpAddress": "172.xx.x.xx", "State": "AVAILABLE", "BundleId": "wsb-clj855555", "SubnetId": "subnet-0a4ae4b324a799999", "ComputerName": "A-2B99WV33TITAN", "WorkspaceProperties": { "RunningMode": "AUTO_STOP", "RunningModeAutoStopTimeoutInMinutes": 60, "RootVolumeSizeGib": 80, "UserVolumeSizeGib": 50, "ComputeTypeName": "STANDARD", "Protocols": [ "PCOIP" ] }, "ModificationStates": [] } ] } We can see that the WorkSpace ‘ws-9xm222222’ is in AVAILABLE state....

August 9, 2023 · 2 min · 249 words · kenno

Query Latest Debian 12 AMI Id Using AWS SSM Parameter Store

Debian publishes their releases of Amazon Machine Image (AMI) for bookworm at Debian bookworm on Amazon EC2 [1]. There, you can find the AMIs for various regions and two architecture amd64 and arm64. Another way to search for AMI for Debian 12 (bookworm) is to use AWS CLI with describe-images. Here is an example on how to list the 3 most recent AMIs of Debian 12 (amd64 architecture), sorted by most recent to the oldest:...

August 5, 2023 · 2 min · 365 words · kenno

How to find EC2 instance ID from a known private IP using AWS CLI

When I first started to use AWS CLI, I felt overwhelmed, and I wondered how long it would take me to be familiar with the tool. Fast forward to many months later, I find the AWS CLI very pleasant to use. For example, there are same patterns and the CLI reference page online is quite useful. Anyway, like many thing I’ve learned about Linux, I learned and could retain the information better with practice and document....

May 26, 2023 · 1 min · 208 words · kenno

How to Install AWS CLI on RockyLinux

The awscli package is available from the EPEL repository, which is not enabled by default on RockyLinux. Enable the EPEL repo by installing epel-release pacakge. $ sudo dnf install epel-release Once the EPEL repo is successfully enabled, we can install awscli package. $ sudo dnf install awscli Enable and verify that the awscli is installed on the system. $ aws --version aws-cli/1.18.156 Python/3.6.8 Linux/4.18.0-425.10.1.el8_7.x86_64 botocore/1.18.15 As a bonus, here is how to configure the AWS credential....

January 31, 2023 · 1 min · 144 words · kenno