Cloud

Adding Tags in AWS CDK

This is a quick reference guide for adding tags in AWS CDK. Introduction Environment Adding Tags in CDK Examples Adding Tags at the Stack Level Adding Tags at the Construct Level Note: Deprecated Tag Assignment Method Conclusion References…

Nesting Stacks in AWS CDK

This article describes how to nest Stacks when deploying with AWS CDK. Introduction Environment Nesting Stacks in CDK Problem: Stacks Cannot Be Simply Nested Solution: Use NestedStack Conclusion References Introduction When I tried to nest…

Essential AWS CDK Commands

This article summarizes the basic commands frequently used in AWS CDK. Introduction Environment CDK Commands Summary Check CDK Version Install CDK Create CDK Project Preparation Before Running CDK Commands List CDK Stacks Generate CloudFor…

Dynamically Configuring Terraform Backend Settings

This guide explains how to dynamically configure backend settings for storing Terraform state files. Introduction How to Dynamically Configure the Terraform Backend Conclusion References Introduction I encountered a use case where I needed…

Getting AWS Region in Terraform

A quick reference for how to get the AWS region in Terraform. Introduction Getting AWS Region in Terraform How to do it Bonus: Reading the Terraform Source Code Conclusion References Introduction When working with AWS resources in Terrafor…

Getting AWS Account ID in Terraform

This is a brief guide on how to retrieve the current AWS account ID in Terraform. Introduction Getting AWS Account ID in Terraform How to Do It Bonus: Reading the Terraform Source Code Conclusion References Introduction When writing Terraf…

Understanding one() Function in Terraform

Understanding the behavior of Terraform's one() function. Introduction Understanding the Behavior of one() Specification of one() Examples When to Use one() Conclusion References Introduction Terraform provides a one() function. Because th…

How to Output Resources with `count` in Terraform

This post explains how to output a resource in Terraform when its creation is controlled using the count parameter. Introduction Outputting Resources Controlled by count Method 1: Use the one Function Method 2: Use the try Function Conclus…

How to AssumeRoles with Boto3 | AWS SDK for Python

This post summarizes how to perform AssumeRole using Boto3. Introduction Assuming Roles with Boto3 Implementing the AssumeRole function Example Usage Conclusion References Introduction There are many situations where you need to AssumeRole…

Deploying Terraform Backend (S3/DynamoDB) with CloudFormation

This post explains the CloudFormation template that sets up the backend (S3/DynamoDB) to store Terraform state. Introduction CloudFormation Template to Provision Terraform Backend Conclusion References Introduction How to provision the bac…

Output DEBUG-Level Logs from AWS CLI: A Quick Guide

This is a quick note on how to output DEBUG-level logs using the AWS CLI. Introduction Outputting DEBUG-Level Logs with AWS CLI How to do it Example Execution Conclusion References Introduction There are times when you want to run AWS CLI …

How to List All Available AWS Services with CLI

This is a quick memo on how to retrieve all AWS service names (subcommands) provided via AWS CLI. Introduction How to List All Available Services in AWS CLI Method Example Conclusion References Introduction Sometimes you might want to list…

Fixing 'aws help' Output That Won’t Work with 'grep'

How to fix the issue where searching with grep the output of aws help doesn't work as expected? Introduction Why You Can't Grep AWS CLI Help Output Cause Solution Example Conclusion References Introduction When you try to grep or use sed o…

How to Output DEBUG-Level Logs in Terraform

This is a quick note on how to change the log output level in Terraform. Introduction Outputting DEBUG-Level Logs in Terraform Setting Log Levels Separately for Terraform and Providers Appendix: Reading Terraform's Source Code Conclusion R…

Using !FindInMap Inside !Sub | CloudFormation

This post summarizes how to use !FindInMap inside !Sub in AWS CloudFormation. Introduction Using !FindInMap Inside !Sub Conclusion References Introduction CloudFormation's !Sub is a function that substitutes values into a string, while !Fi…

How to Operate as ec2-user or root in Session Manager | AWS Systems Manager

This post summarizes how to work as ec2-user or root user in AWS Systems Manager (SSM) Session Manager. Introduction Working as ec2-user or root with Session Manager Current Situation: Shell Access as ssm-user Solution: sudo su --login ec2…

Get the Absolute Path of the Default Working Directory in GitHub Actions

This is a note on how to get the absolute path of the default working directory in GitHub Actions. Introduction Getting the Absolute Path of the Default Working Directory Cannot Retrieve Using ${{ env.GITHUB_WORKSPACE }} Can Be Retrieved U…

"aws s3 cp" vs "aws s3 sync": Key Differences

This post explains the differences between the AWS CLI commands s3 cp and s3 sync. Introduction Key Differences Between cp and sync Comparing Descriptions Comparing Command Options Comparing Command Behaviors Simple S3 copy Copy updated S3…

How to Handle Errors in boto3 | AWS SDK for Python

This article summarizes how to handle errors in boto3, AWS SDK for Python. Introduction Handling Errors in boto3 Using client.exceptions Using botocore.exceptions Example Code Handling BucketAlreadyExists error in S3 create_bucket Handling…

boto3 vs boto: Differences and History

This post summarizes the differences between boto3 and boto, the origins of "boto" itself, and the history of the AWS SDK for Python. Introduction The History of AWS SDK for Python Differences Between boto3 and boto What Happened to boto2?…

How to Use the Ternary Operator in Terraform

This article summarizes how to use the ternary operator in Terraform, along with practical examples. Introduction Ternary Operator in Terraform How to Use Practical Examples Simple Example Combining Conditions Example of Type Casting Error…

S3 Bucket Policies and IAM Policies: How They Work Together

This post provides an overview of how S3 bucket policies and IAM policies interact for both same-account and cross-account access scenarios. Introduction S3 Bucket Policies and IAM Policies: How They Work Together Conclusion First Preparat…

What is SKU in Azure?

Understanding The meaning of SKU in Azure. Introduction What is SKU in Azure? What does SKU stand for? What does SKU mean in Azure? Conclusion References Introduction I've been using AWS for a long time, but recently I started learning Azu…