How Do You Create and Store an Application-Level Secret on the AWS Cloud?

Problem scenario
You want to create and save an application-level secret in AWS. What do you do?

Solution
Use Secrets Manager.

Procedures

  1. Log into the AWS console.
  2. Go to “Secrets Manager”
  3. Click “Store a new secret”
  4. For the secret type choose “Other type of secrets”.
  5. For the left-most field,

 » Read more..

How Do You Set the S3 Policy to Archive after 60 Days?

Problem scenario
You want items in an S3 bucket to be archived automatically after they are 60 days old. What do you do?

Solution
1. Log into the AWS console.
2. Click on your S3 bucket.
3. Click on the “Management” tab on the right.
4. Click on “Add lifecycle rule”
5. Give the rule a name.

 » Read more..

How Do You Delete an Aurora Database when You Get an Error about It Not Being Started?

Problem scenario
You are trying to delete an Aurora database but you get this error: “This database is not started.” What do you do?

Possible Solution #1 (with the web console)
1. Log into the web console.
2. Go to “Amazon RDS”.
3. Go to “Databases”
4. Click on the Aurora cluster of the database you want to delete or its parent.

 » Read more..

How Do You Troubleshoot the AWS Error “could not get token: NoCredentialProviders: no valid providers in chain. Deprecated.”

Problem scenario
You run this command: kubectl get svc

You receive this:
” could not get token: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors”

What should you do?

Solution
Install and configure the AWS CLI. If you need assistance with this, see this posting.

 » Read more..

How Do You Install pip on a RHEL Server in AWS?

Problem scenario
You want to install pip on a RedHat Enterprise Linux server in AWS.  What do you do?

Solution
Prerequisites
This assumes that Python has been installed. If it has not, run this command:
sudo yum -y install python3


Procedures

Run these two commands:
curl “https://bootstrap.pypa.io/get-pip.py” -o “get-pip.py”
sudo python3 get-pip.py # use python is python3 is not found
sudo ln -s /usr/local/bin/pip /usr/bin/pip

 » Read more..

How Do You Grant a Role The Ability to Run a Lambda Function?

Problem scenario
You have a role that you want to execute a Lambda function. What do you do?

Solution
1. Log into the AWS console.
2. Go to IAM -Roles
3. Click on the role you want to change.
4. Click on “Attach policies”
5. In the “Filter policies” field search for “lambda” with no quotes
6.

 » Read more..

How Do You Troubleshoot the boto Message “NoRegionError”?

Problem scenarios (one or both of the following are happening)
#1 You are getting “botocore.exceptions.NoRegionError: You must specify a region” when you run a Python program (that involves boto and AWS).

#2 You are trying to create a session with a Python/boto program. You are printing out the Session information in your Python program using boto but you see this:

Session(region_name=None)

What should you do?

 » Read more..

How Do You Delete a Kubernetes Cluster in AWS?

Problem scenario
You try to manually delete EC-2 instances (both worker nodes and the master node of Kubernetes), but this does not work. The EC-2 instances are re-created. How do you delete the cluster?

Solution
Prerequisite
Install and configure the AWS CLI; if you need assistance, see this posting.

Procedures
Run these three commands but substitute “contint.k8s.local” with the name of your cluster:

export KOPS_CLUSTER_NAME=contint.k8s.local
export KOPS_STATE_STORE=s3://$KOPS_CLUSTER_NAME-state
kops delete cluster –name contint.k8s.local –yes  » Read more..

How Do You Use the AWS CLI to List Aurora Databases?

Problem scenario
You have an Amazon Aurora database in you AWS account. You want to see the status of this database with the AWS CLI. How do you list information about your Aurora databases?

Solution
Prerequisites

You must have the AWS CLI installed and configured with a user that has the ability to view Aurora databases (e.g., an administrator of your AWS account).

 » Read more..

How Do You Find the URL (or HTTP Endpoint) of a Kubernetes Cluster Running in Amazon EKS?

Problem scenario
You have a Kubernetes cluster in AWS. You have the AWS CLI installed. How do you find the URL for the Kubernetes cluster?

Solution
1. Run this command: aws eks list-clusters

2. Run this command: aws eks describe-cluster foobar # where “foobar” was name determined in above command

 » Read more..