How do you architect Disaster Recovery in AWS?

Disaster recovery (DR) in AWS involves creating a plan and set of procedures to help your organization recover from a catastrophic event, such as a natural disaster, power outage, or cyber attack, that could impact your business operations. AWS provides a range of tools and services to help you architect an effective DR solution in the cloud. Here are the high-level steps to architect a Disaster Recovery solution in AWS:...

March 26, 2023 · 3 min · 633 words · Andrew

How to Return a List of All AWS Lambda Function Names in CLI

If you would like to list all AWS Lambda Function Names in your CLI using the AWS CLI, then you can do this: Get a List of all Lambda Functions aws lambda list-functions However, note that this will return a potentially large JSON payload back to your CLI. So what if you only want a list of the function names themselves? You can couple the AWS command above, with the jq command as follows:...

February 24, 2023 · 1 min · 88 words · Andrew

How to Install AWS SAM CLI on Mac

If you need to install AWS SAM CLI on a Mac, then the easiest option is to use Homebrew with the following commands: brew tap aws/tap brew install aws-sam-cli Now you can validate the installation as follows: sam --version

February 15, 2023 · 1 min · 39 words · Andrew

How to solve AWS MediaPackage PackagingGroup Quota Limit

If you are using AWS Elemental MediaPackage and hit the following error, then you need to either do one of the following: Error: error waiting for CloudFormation Stack (arn:aws:cloudformation:eu-west-1:800417762774:stack/dev-MediaPackage-Vod-1/511fc7a0-a092-11ed-b853-068baf6ac251) create: failed to create CloudFormation stack, delete requested (DELETE_COMPLETE): ["The following resource(s) failed to create: [PackagingGroup]. Delete requested by user." "Resource handler returned message: \"Limit exceeded for resource of type 'AWS::MediaPackage::PackagingGroup'. Reason: You reached the quota for resource=PackagingGroup. Delete the resources that you don?...

January 31, 2023 · 1 min · 126 words · Andrew

How to Run Cdk Bootstrap

To bootstrap an AWS CDK environment, you simply need to do the following: npx aws-cdk bootstrap …for each environment that you would like the CD to operate within. This will deploy all the required prerequisites to the AWS account, such as the: An Amazon S3 bucket for storing files and IAM roles that grant permissions needed to perform deployments. The required resources are defined in an AWS CloudFormation stack, called the bootstrap stack, which is usually named CDKToolkit....

January 30, 2023 · 1 min · 95 words · Andrew

How to Get Account Number from AWS Lambda

If you need to get the current Account Number, or Account ID from within a Lambda execution, then you can access invoked_function_arn from the context and return the associated value as follows: aws_account_id = context.invoked_function_arn.split(":")[4]

January 24, 2023 · 1 min · 35 words · Andrew

Summary of the Frequently Used AWS STS API calls

AssumeRole – is useful for allowing existing IAM users to access AWS resources that they don’t already have access to. For example, the user might need access to resources in another AWS account. It is also useful as a means to temporarily gain privileged access—for example, to provide multi-factor authentication (MFA). You must call this API using existing IAM user credentials. AssumeRoleWithWebIdentity – returns a set of temporary security credentials for federated users who are authenticated through a public identity provider....

January 19, 2023 · 2 min · 289 words · Andrew

Understanding Locking and Conditional Writes in AWS DynamoDB

Optimistic locking is a strategy to ensure that the client-side item that you are updating (or deleting) is the same as the item in DynamoDB. Optimistic concurrency depends on checking a value upon save to ensure that it has not changed. If you use this strategy, then your database writes are protected from being overwritten by the writes of others — and vice-versa. By default, the DynamoDB write operations (PutItem, UpdateItem, DeleteItem) are unconditional: each of these operations will overwrite an existing item that has the specified primary key....

January 18, 2023 · 2 min · 258 words · Andrew

AWS CodeDeploy Deployment Type Options

CodeDeploy provides two (2) deployment type options: Option 1 – In-place Deployment In-place deployment: The application on each instance in the deployment group is stopped, the latest application revision is installed, and the new version of the application is started and validated. You can use a load balancer so that each instance is deregistered during its deployment and then restored to service after the deployment is complete. Only deployments that use the EC2/On-Premises compute platform can use in-place deployments....

January 17, 2023 · 2 min · 364 words · Andrew

Defining Amazon ECS Task Placement Strategies

Amazon ECS supports the following task placement strategies: binpack – Place tasks based on the least available amount of CPU or memory. This minimizes the number of instances in use. random – Place tasks randomly. spread – Place tasks evenly based on the specified value. Accepted values are attribute key-value pairs, instanceId, or host.

January 16, 2023 · 1 min · 54 words · Andrew