<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://coolscript.net/index.php?action=history&amp;feed=atom&amp;title=AWS_cheat_sheet</id>
	<title>AWS cheat sheet - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://coolscript.net/index.php?action=history&amp;feed=atom&amp;title=AWS_cheat_sheet"/>
	<link rel="alternate" type="text/html" href="https://coolscript.net/index.php?title=AWS_cheat_sheet&amp;action=history"/>
	<updated>2026-06-02T16:20:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://coolscript.net/index.php?title=AWS_cheat_sheet&amp;diff=989&amp;oldid=prev</id>
		<title>Admin: /* AMI Image */</title>
		<link rel="alternate" type="text/html" href="https://coolscript.net/index.php?title=AWS_cheat_sheet&amp;diff=989&amp;oldid=prev"/>
		<updated>2023-10-19T12:55:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;AMI Image&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:55, 19 October 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l80&quot;&gt;Line 80:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 80:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*List by AmiID, Return Creation Date&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*List by AmiID, Return Creation Date&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  aws ec2 describe-images --image-ids ami-xyz --query &amp;#039;Images[*].[CreationDate]&amp;#039; --output text&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  aws ec2 describe-images --image-ids ami-xyz --query &amp;#039;Images[*].[CreationDate]&amp;#039; --output text&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=S3=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*List all files/objects within a bucket&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; aws s3api list-objects --bucket my.bucket.name --output json&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*Sum of size and length&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; aws s3api list-objects --bucket my.bucket.name --output json --query &quot;[sum(Contents[].Size), length(Contents[])]&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Reference=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Reference=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://coolscript.net/index.php?title=AWS_cheat_sheet&amp;diff=988&amp;oldid=prev</id>
		<title>Admin: Created page with &quot; =Identity=  aws sts get-caller-identity =SSO Login=  aws sso login --profile ProfileName  =Secrets= *List secret  aws secretsmanager list-secrets *Get secret  aws secretsmanager get-secret-value --secret-id &quot;SecretName&quot;  =Instances= *List  aws ec2 describe-instances *Filter by ip address  aws ec2 describe-instances --filters Name=private-ip-address,Values=x.x.x.x *Query by ID, Time and IP  aws ec2 describe-instances --query &#039;Reservations[*].Instances[*].[InstanceId, Lau...&quot;</title>
		<link rel="alternate" type="text/html" href="https://coolscript.net/index.php?title=AWS_cheat_sheet&amp;diff=988&amp;oldid=prev"/>
		<updated>2023-10-14T18:49:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; =Identity=  aws sts get-caller-identity =SSO Login=  aws sso login --profile ProfileName  =Secrets= *List secret  aws secretsmanager list-secrets *Get secret  aws secretsmanager get-secret-value --secret-id &amp;quot;SecretName&amp;quot;  =Instances= *List  aws ec2 describe-instances *Filter by ip address  aws ec2 describe-instances --filters Name=private-ip-address,Values=x.x.x.x *Query by ID, Time and IP  aws ec2 describe-instances --query &amp;#039;Reservations[*].Instances[*].[InstanceId, Lau...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
=Identity=&lt;br /&gt;
 aws sts get-caller-identity&lt;br /&gt;
=SSO Login=&lt;br /&gt;
 aws sso login --profile ProfileName&lt;br /&gt;
&lt;br /&gt;
=Secrets=&lt;br /&gt;
*List secret&lt;br /&gt;
 aws secretsmanager list-secrets&lt;br /&gt;
*Get secret&lt;br /&gt;
 aws secretsmanager get-secret-value --secret-id &amp;quot;SecretName&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=Instances=&lt;br /&gt;
*List&lt;br /&gt;
 aws ec2 describe-instances&lt;br /&gt;
*Filter by ip address&lt;br /&gt;
 aws ec2 describe-instances --filters Name=private-ip-address,Values=x.x.x.x&lt;br /&gt;
*Query by ID, Time and IP&lt;br /&gt;
 aws ec2 describe-instances --query &amp;#039;Reservations[*].Instances[*].[InstanceId, LaunchTime, PrivateIpAddress]&amp;#039; --output text&lt;br /&gt;
*Query by Tags, ID, VolumeID&lt;br /&gt;
 aws ec2 describe-instances --query &amp;#039;Reservations[*].Instances[*].[Tags[?Key==`Name`].Value,InstanceId,BlockDeviceMappings[*].Ebs.VolumeId]&amp;#039;&lt;br /&gt;
*Query by ClusterName, show Ami ImageId&lt;br /&gt;
 aws ec2 describe-instances --filters &amp;quot;Name=tag:SomeTag,Values=SomeVal&amp;quot; --query &amp;#039;Reservations[*].Instances[*].ImageId&amp;#039; --output text&lt;br /&gt;
*Query by ClusterName, show Ami ImageId,PrivateIp&lt;br /&gt;
 aws ec2 describe-instances --filters &amp;quot;Name=tag:SomeTag,Values=SomeVal&amp;quot; --query &amp;#039;Reservations[*].Instances[*].[ImageId, PrivateIpAddress]&amp;#039; --output text&lt;br /&gt;
&lt;br /&gt;
=EKS=&lt;br /&gt;
*Update Cluster in Kubeconfig&lt;br /&gt;
 aws eks update-kubeconfig --name ClusterName&lt;br /&gt;
*List clusters&lt;br /&gt;
 aws eks list-clusters&lt;br /&gt;
*List Nodegroups on Clustername&lt;br /&gt;
 aws eks list-nodegroups --cluster-name ClusterName&lt;br /&gt;
*Describe Nodegroup&lt;br /&gt;
 aws eks describe-nodegroup --cluster-name ClusterName --nodegroup-name NodegroupName&lt;br /&gt;
*Describe Nodegroup, Query created at&lt;br /&gt;
 aws eks describe-nodegroup --cluster-name ClusterName --nodegroup-name NodegroupName | jq &amp;#039;.nodegroup.createdAt&amp;#039; | tr -d &amp;#039;&amp;quot;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=Volumes=&lt;br /&gt;
*Filter by state&lt;br /&gt;
 aws ec2 describe-volumes --filters Name=status,Values=in-use&lt;br /&gt;
 aws ec2 describe-volumes --filters Name=status,Values=available&lt;br /&gt;
&lt;br /&gt;
*List by Tag&lt;br /&gt;
 aws ec2 describe-volumes --filters &amp;quot;Name=SomeTagName,Values=Tag-Value&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*Count available disks&lt;br /&gt;
 aws ec2 describe-volumes --filters Name=status,Values=available --query &amp;#039;Volumes[*].{ID:VolumeId}&amp;#039; --output text | wc -l&lt;br /&gt;
&lt;br /&gt;
*Sum of all available disks&lt;br /&gt;
 aws ec2 describe-volumes --filters Name=status,Values=in-use | jq &amp;quot;[.Volumes[].Size] | add&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*Filter by state=in-use, query IDs, AZ, Size&lt;br /&gt;
 aws ec2 describe-volumes --filters Name=status,Values=in-use --query &amp;#039;Volumes[*].{ID:VolumeId,InstanceId:Attachments[0].InstanceId,AZ:AvailabilityZone,Size:Size}&amp;#039; --output text&lt;br /&gt;
&lt;br /&gt;
*Delete volumes with state available&lt;br /&gt;
 for vol in $(aws ec2 describe-volumes  | jq -r &amp;quot;.Volumes[] | select(.State==\&amp;quot;available\&amp;quot;) | .VolumeId&amp;quot;); do echo $vol ; $(aws ec2 delete-volume --volume-id $vol) ; done&lt;br /&gt;
&lt;br /&gt;
*List/Loop by create date after 2023-09-29&lt;br /&gt;
 for vol in $(aws ec2 describe-volumes --query &amp;quot;Volumes[?(CreateTime&amp;gt;&amp;#039;2023-09-29&amp;#039;)].[VolumeId]&amp;quot; --output text); do echo &amp;quot;$vol&amp;quot; ; done&lt;br /&gt;
&lt;br /&gt;
*List by create date before 5 days or before 1 month&lt;br /&gt;
 aws ec2 describe-volumes --query &amp;quot;Volumes[?(CreateTime&amp;lt;&amp;#039;$(date --date=&amp;#039;-5 day&amp;#039; &amp;#039;+%Y-%m-%d&amp;#039;)&amp;#039;)].[VolumeId, CreateTime]&amp;quot; --output text&lt;br /&gt;
 aws ec2 describe-volumes --query &amp;quot;Volumes[?(CreateTime&amp;lt;&amp;#039;$(date --date=&amp;#039;-1 month&amp;#039; &amp;#039;+%Y-%m-%d&amp;#039;)&amp;#039;)].[VolumeId, CreateTime]&amp;quot; --output text&lt;br /&gt;
&lt;br /&gt;
*Loop by create date before 5 days&lt;br /&gt;
 for vol in $(aws ec2 describe-volumes --query &amp;quot;Volumes[?(CreateTime&amp;lt;&amp;#039;$(date --date=&amp;#039;-5 day&amp;#039; &amp;#039;+%Y-%m-%d&amp;#039;)&amp;#039;)].[VolumeId]&amp;quot; --output text); do echo &amp;quot;Volume $vol&amp;quot; ; done&lt;br /&gt;
&lt;br /&gt;
=Autoscaling=&lt;br /&gt;
*List&lt;br /&gt;
 aws autoscaling describe-auto-scaling-groups&lt;br /&gt;
&lt;br /&gt;
=Parameter Store=&lt;br /&gt;
 aws ssm get-parameters-by-path --path &amp;quot;/somepath&amp;quot; --recursive --query &amp;quot;Parameters[*].Name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=AMI Image=&lt;br /&gt;
*List by AmiID&lt;br /&gt;
 aws ec2 describe-images --image-ids ami-xyz&lt;br /&gt;
*List by AmiID, Return Creation Date&lt;br /&gt;
 aws ec2 describe-images --image-ids ami-xyz --query &amp;#039;Images[*].[CreationDate]&amp;#039; --output text&lt;br /&gt;
&lt;br /&gt;
=Reference=&lt;br /&gt;
*https://gist.github.com/avoidik/de015c0841aabec5e2d6c9fd6092d206&lt;br /&gt;
*https://gist.github.com/nickGermi/290fd28e10e6648e039dc4a64dca7968&lt;br /&gt;
*https://jmespath.org/tutorial.html&lt;br /&gt;
*https://jmespath.org/specification.html#and-expressions&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>