Skip to content

AWS_Practical_Interview_201 400

AWS Practical Interview Questions (201-400)

Section titled “AWS Practical Interview Questions (201-400)”

Answer:

Terminal window
# Create cluster
aws eks create-cluster \
--name my-cluster \
--role-arn arn:aws:iam::123456789012:role/eks-role \
--resources-vpc-config subnetIds=subnet-12345,subnet-67890,securityGroupIds=sg-12345 \
--version 1.28
# Update kubeconfig
aws eks update-kubeconfig --name my-cluster --region us-east-1

Q202: How do you create node group in EKS?

Section titled “Q202: How do you create node group in EKS?”

Answer:

Terminal window
# Create node group
aws eks create-nodegroup \
--cluster-name my-cluster \
--nodegroup-name my-nodes \
--scaling-config minSize=2,maxSize=5,desiredSize=3 \
--instance-types t3.medium \
--subnets subnet-12345 subnet-67890

Q203: How do you deploy application to EKS?

Section titled “Q203: How do you deploy application to EKS?”

Answer:

Terminal window
# Apply deployment
kubectl apply -f deployment.yaml
# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: nginx:latest
ports:
- containerPort: 80

Q204: How do you expose application in EKS?

Section titled “Q204: How do you expose application in EKS?”

Answer:

Terminal window
# Create service
kubectl expose deployment my-app --type=LoadBalancer --port=80
# Or create ingress
kubectl apply -f ingress.yaml
# ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
spec:
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app
port:
number: 80

Q205: How do you set up ALB controller in EKS?

Section titled “Q205: How do you set up ALB controller in EKS?”

Answer:

Terminal window
# Install AWS Load Balancer Controller
helm repo add eks https://aws.github.io/eks-charts
helm install aws-load-balancer-controller \
-n kube-system \
--set clusterName=my-cluster \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller

Answer:

Terminal window
# Create crawler
aws glue create-crawler \
--name my-crawler \
--role arn:aws:iam::123456789012:role/glue-role \
--database-name my-database \
--targets '{
"S3Targets": [{"Path": "s3://my-bucket/data/"}]
}' \
--schedule "cron(0 12 * * ? *)"

Answer:

Terminal window
# Create job
aws glue create-job \
--name my-etl-job \
--role arn:aws:iam::123456789012:role/glue-role \
--command '{
"Name": "glueetl",
"ScriptLocation": "s3://my-bucket/scripts/etl.py"
}' \
--default-arguments '{
"--job-language": "python",
"--enable-metrics": ""
}'

Answer:

Terminal window
# Start job run
aws glue start-job-run \
--job-name my-etl-job \
--arguments '{
"--extra-py-files": "s3://my-bucket/lib/utils.py"
}'

Q209: How do you create Step Functions state machine?

Section titled “Q209: How do you create Step Functions state machine?”

Answer:

Terminal window
# Create state machine
aws stepfunctions create-state-machine \
--name my-workflow \
--definition '{
"Comment": "My workflow",
"StartAt": "FirstState",
"States": {
"FirstState": {
"Type": "Pass",
"End": true
}
}
}' \
--role-arn arn:aws:iam::123456789012:role/stepfunctions-role

Answer:

Terminal window
# Start execution
aws stepfunctions start-execution \
--state-machine-arn arn:aws:states:us-east-1:123456789012:stateMachine:my-workflow \
--input '{"key": "value"}'

Answer:

Terminal window
# Create rule
aws events put-rule \
--name my-rule \
--event-pattern '{
"source": ["aws.ec2"],
"detail-type": ["EC2 Instance State-change Notification"]
}'
# Add target
aws events put-targets \
--rule my-rule \
--targets '[{"Id":"1","Arn":"arn:aws:lambda:us-east-1:123456789012:function:my-function"}]'

Q212: How do you create EventBridge schedule?

Section titled “Q212: How do you create EventBridge schedule?”

Answer:

Terminal window
# Create schedule
aws events put-rule \
--name daily-trigger \
--schedule-expression "rate(1 day)"

Q213: How do you create CodeBuild project?

Section titled “Q213: How do you create CodeBuild project?”

Answer:

Terminal window
# Create project
aws codebuild create-project \
--name my-build-project \
--source '{
"type": "GITHUB",
"location": "https://github.com/user/repo"
}' \
--artifacts '{
"type": "S3",
"location": "my-bucket"
}' \
--environment '{
"type": "LINUX_CONTAINER",
"computeType": "BUILD_GENERAL1_MEDIUM",
"image": "aws/codebuild/standard:6.0"
}'

Answer:

buildspec.yml
version: 0.2
env:
variables:
NODE_ENV: "production"
phases:
install:
runtime-versions:
nodejs: 18
commands:
- npm install
build:
commands:
- npm run build
post_build:
commands:
- npm test
artifacts:
files:
- '**/*'
discard-paths: yes

Q215: How do you create CodeDeploy application?

Section titled “Q215: How do you create CodeDeploy application?”

Answer:

Terminal window
# Create application
aws codedeploy create-application \
--application-name my-application
# Create deployment group
aws codedeploy create-deployment-group \
--application-name my-application \
--deployment-group-name my-deployment-group \
--service-role-arn arn:aws:iam::123456789012:role/codedeploy-role \
--ec2TagFilters '[{"Key": "Environment", "Value": "Production"}]'

Answer:

appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /var/www/html
hooks:
BeforeInstall:
- location: scripts/before_install.sh
timeout: 300
AfterInstall:
- location: scripts/after_install.sh
ApplicationStart:
- location: scripts/start_server.sh
ValidateService:
- location: scripts/test.sh

Answer:

Terminal window
# Create pipeline
aws codepipeline create-pipeline \
--pipeline '{
"name": "my-pipeline",
"roleArn": "arn:aws:iam::123456789012:role/codepipeline-role",
"stages": [
{
"name": "Source",
"actions": [{
"name": "SourceAction",
"actionTypeId": {"category": "Source", "owner": "AWS", "provider": "CodeCommit", "version": "1"},
"configuration": {"RepositoryName": "my-repo", "BranchName": "main"}
}]
},
{
"name": "Build",
"actions": [{
"name": "BuildAction",
"actionTypeId": {"category": "Build", "owner": "AWS", "provider": "CodeBuild", "version": "1"},
"configuration": {"ProjectName": "my-build-project"}
}]
}
],
"artifactStore": {"type": "S3", "location": "my-artifact-bucket"}
}'

Q218: How do you look up CloudTrail events?

Section titled “Q218: How do you look up CloudTrail events?”

Answer:

Terminal window
# Lookup events
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=EventSource,AttributeValue=ec2.amazonaws.com
# Lookup by username
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=Username,AttributeValue=john
# Lookup by resource
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=ResourceName,AttributeValue=my-bucket

Answer:

Terminal window
# Create configuration recorder
aws configservice put-configuration-recorder \
--configuration-recorder '{
"name": "default",
"roleARN": "arn:aws:iam::123456789012:role/config-role"
}'
# Create delivery channel
aws configservice put-delivery-channel \
--delivery-channel '{
"name": "default",
"s3BucketName": "config-bucket",
"snsTopicARN": "arn:aws:sns:us-east-1:123456789012:config-topic"
}'
# Start recorder
aws configservice start-configuration-recorder --configuration-recorder-name default

Q220: How do you create Maintenance Window?

Section titled “Q220: How do you create Maintenance Window?”

Answer:

Terminal window
# Create maintenance window
aws ssm create-maintenance-window \
--name "My-Maintenance-Window" \
--schedule "cron(0 2 ? * SUN *)" \
--duration 4 \
--cutoff 1
# Register target
aws ssm register-target-with-maintenance-window \
--window-id mw-12345 \
--target '{"Key":"instanceids","Values":["i-12345"]}'
# Register task
aws ssm register-task-with-maintenance-window \
--window-id mw-12345 \
--task-arn arn:aws:iam::123456789012:role/ssm-role \
--service-role-arn arn:aws:iam::123456789012:role/ssm-role \
--task-type AUTOMATION \
--max-concurrency 1 --max-errors 1

Q221: How do you create secret with rotation?

Section titled “Q221: How do you create secret with rotation?”

Answer:

Terminal window
# Create secret with Lambda rotation
aws secretsmanager create-secret \
--name prod/db-credentials \
--secret-string '{"username":"admin","password":"password123"}' \
--rotation-lambda-arn arn:aws:lambda:us-east-1:123456789012:function:rotation-function \
--rotation-rules AutomaticallyAfterDays=30

Q222: How do you create KMS key with policy?

Section titled “Q222: How do you create KMS key with policy?”

Answer:

Terminal window
# Create key
aws kms create-key \
--description "My encryption key" \
--key-usage ENCRYPT_DECRYPT \
--origin AWS_KMS \
--multi-region
# Put key policy
aws kms put-key-policy \
--key-id alias/my-key \
--policy '{
"Version": "2012-10-17",
"Id": "key-policy",
"Statement": [{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::123456789012:root"},
"Action": "kms:*",
"Resource": "*"
}]
}'

Q223: How do you create log subscription filter?

Section titled “Q223: How do you create log subscription filter?”

Answer:

Terminal window
# Create subscription filter to Lambda
aws logs put-subscription-filter \
--log-group-name /aws/lambda/my-function \
--filter-name error-filter \
--filter-pattern "[level=ERROR]" \
--destination-arn arn:aws:lambda:us-east-1:123456789012:function:error-processor

Q224: How do you set up S3 batch operations?

Section titled “Q224: How do you set up S3 batch operations?”

Answer:

Terminal window
# Create job
aws s3control create-job \
--account-id 123456789012 \
--operation '{
"S3PutObjectCopy": {
"TargetResource": "arn:aws:s3:::dest-bucket/*"
}
}' \
--manifest '{
"Spec": {
"Format": "S3BatchOperations_CSV_20180820",
"Fields": ["Bucket", "Key"]
},
"Location": {
"ObjectArn": "arn:aws:s3:::manifest-bucket/manifest.csv"
}
}' \
--priority 10 \
--role-arn arn:aws:iam::123456789012:role/batch-role

Q225: How do you handle Lambda errors with dead letter queue?

Section titled “Q225: How do you handle Lambda errors with dead letter queue?”

Answer:

import boto3
import json
def lambda_handler(event, context):
try:
# Process event
result = process_data(event)
return {'statusCode': 200, 'body': json.dumps(result)}
except Exception as e:
# Send to DLQ
sqs = boto3.client('sqs')
sqs.send_message(
QueueUrl='https://sqs.us-east-1.amazonaws.com/123456789012/dlq',
MessageBody=json.dumps(event)
)
raise e

Q226: How do you create VPC with NAT Gateway?

Section titled “Q226: How do you create VPC with NAT Gateway?”

Answer:

Terminal window
# Create VPC
VPC=$(aws ec2 create-vpc --cidr-block 10.0.0.0/16 --query 'Vpc.VpcId' --output text)
# Create public subnet
PUBLIC_SUBNET=$(aws ec2 create-subnet --vpc-id $VPC --cidr-block 10.0.1.0/24 --availability-zone us-east-1a --query 'Subnet.SubnetId' --output text)
# Create private subnet
PRIVATE_SUBNET=$(aws ec2 create-subnet --vpc-id $VPC --cidr-block 10.0.2.0/24 --availability-zone us-east-1a --query 'Subnet.SubnetId' --output text)
# Create IGW
IGW=$(aws ec2 create-internet-gateway --query 'InternetGateway.InternetGatewayId' --output text)
aws ec2 attach-internet-gateway --vpc-id $VPC --internet-gateway-id $IGW
# Create EIP and NAT Gateway
EIP=$(aws ec2 allocate-address --domain vpc --query 'AllocationId' --output text)
NAT=$(aws ec2 create-nat-gateway --subnet-id $PUBLIC_SUBNET --allocation-id $EIP --query 'NatGateway.NatGatewayId' --output text)
# Create route tables
PUBLIC_RT=$(aws ec2 create-route-table --vpc-id $VPC --query 'RouteTable.RouteTableId' --output text)
aws ec2 create-route --route-table-id $PUBLIC_RT --destination-cidr-block 0.0.0.0/0 --gateway-id $IGW
aws ec2 associate-route-table --route-table-id $PUBLIC_RT --subnet-id $PUBLIC_SUBNET
PRIVATE_RT=$(aws ec2 create-route-table --vpc-id $VPC --query 'RouteTable.RouteTableId' --output text)
aws ec2 create-route --route-table-id $PRIVATE_RT --destination-cidr-block 0.0.0.0/0 --nat-gateway-id $NAT
aws ec2 associate-route-table --route-table-id $PRIVATE_RT --subnet-id $PRIVATE_SUBNET

Answer:

Terminal window
# Create secret for database credentials
aws secretsmanager create-secret \
--name rds-secret \
--secret-string '{"username":"admin","password":"password"}'
# Create RDS proxy
aws rds create-db-proxy \
--db-proxy-name my-proxy \
--engine-family MYSQL \
--auth '[{"SecretArn":"arn:aws:secretsmanager:us-east-1:123456789012:secret:rds-secret","IAMAuth":"DISABLED"}]' \
--role-arn arn:aws:iam::123456789012:role/rds-proxy-role \
--vpc-subnet-ids subnet-12345 subnet-67890 \
--vpc-security-group-ids sg-12345

Q228: How do you create DynamoDB global table?

Section titled “Q228: How do you create DynamoDB global table?”

Answer:

Terminal window
# Create table in first region
aws dynamodb create-table \
--table-name Orders \
--attribute-definitions AttributeName=OrderID,AttributeType=S \
--key-schema AttributeName=OrderID,KeyType=HASH \
--billing-mode PAY_PER_REQUEST \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
# Enable on-demand backup
aws dynamodb update-continuous-backups \
--table-name Orders \
--point-in-time-recovery-specification PointInTimeRecoveryEnabled=true

Q229: How do you create EFS with access points?

Section titled “Q229: How do you create EFS with access points?”

Answer:

Terminal window
# Create EFS
EFS=$(aws efs create-file-system \
--throughput-mode bursting \
--encrypted \
--query 'FileSystemId' \
--output text)
# Create access point for app
aws efs create-access-point \
--file-system-id $EFS \
--access-point-name app-access \
--posix-user '{"Uid":1000,"Gid":1000}' \
--root-directory '{"Path":"/app","CreationInfo":{"OwnerGid":1000,"OwnerUid":1000,"Permissions":"0755"}}'
# Create access point for data
aws efs create-access-point \
--file-system-id $EFS \
--access-point-name data-access \
--posix-user '{"Uid":1001,"Gid":1001}' \
--root-directory '{"Path":"/data","CreationInfo":{"OwnerGid":1001,"OwnerUid":1001,"Permissions":"0755"}}'

Q230: How do you update ECS service with blue-green?

Section titled “Q230: How do you update ECS service with blue-green?”

Answer:

Terminal window
# Create new task definition
aws ecs register-task-definition \
--family my-app \
--network-mode awsvpc \
--container-definitions '[{"name":"web","image":"nginx:v2"}]'
# Update service
aws ecs update-service \
--cluster my-cluster \
--service my-service \
--task-definition my-app:2 \
--deployment-configuration '{
"minimumHealthyPercent": 50,
"maximumPercent": 200
}'

Q231: How do you create Helm release in EKS?

Section titled “Q231: How do you create Helm release in EKS?”

Answer:

Terminal window
# Add repo
helm repo add nginx-stable https://kubernetes.github.io/ingress-nginx
# Install nginx ingress
helm install nginx-ingress nginx-stable/ingress-nginx \
--namespace ingress-basic \
--create-namespace \
--set controller.service.annotations.service\.beta\.kubernetes\.io/aws-load-balancer-type="nlb"
# Install Prometheus
helm install prometheus prometheus-community/prometheus \
--namespace monitoring \
--create-namespace

Q232: How do you use CloudFormation StackSets for multiple accounts?

Section titled “Q232: How do you use CloudFormation StackSets for multiple accounts?”

Answer:

Terminal window
# Create stack set
aws cloudformation create-stack-set \
--stack-set-name org-vpc \
--template-body file://vpc-template.yaml \
--permission-model SERVICE_MANAGED \
--auto-deployment '{
"Enabled": true,
"RetainStacksOnAccountRemoval": false
}'
# Create stacks in accounts
aws cloudformation create-stack-instances \
--stack-set-name org-vpc \
--accounts '["111111111111","222222222222"]' \
--regions '["us-east-1","us-west-2"]' \
--operation-preferences '{
"FailureToleranceCount": 1,
"MaxConcurrentCount": 3
}'

Answer:

from aws_cdk import (
core,
aws_ec2 as ec2
)
class VpcStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
vpc = ec2.Vpc(
self, "MyVPC",
cidr="10.0.0.0/16",
max_azs=2,
nat_gateways=1,
subnet_configuration=[
ec2.SubnetConfiguration(
name="Public",
cidr_mask=24,
subnet_type=ec2.SubnetType.PUBLIC
),
ec2.SubnetConfiguration(
name="Private",
cidr_mask=24,
subnet_type=ec2.SubnetType.PRIVATE
)
]
)

Answer:

from aws_cdk import (
core,
aws_lambda as _lambda,
aws_apigateway as apigateway
)
class LambdaStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
# Create Lambda
handler = _lambda.Function(
self, "MyHandler",
runtime=_lambda.Runtime.PYTHON_3_9,
handler="index.handler",
code=_lambda.Code.from_inline(
"def handler(event, context): return {'statusCode': 200}"
)
)
# Create API Gateway
api = apigateway.LambdaRestApi(
self, "MyApi",
handler=handler
)

Answer:

template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.9
Events:
Api:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
MyTable:
Type: AWS::Serverless::SimpleTable

Answer:

Terminal window
# Build
sam build
# Deploy
sam deploy --guided
# Local invoke
sam local invoke MyFunction --event event.json
# Local API
sam local start-api

Answer:

Terminal window
# Create pipeline
aws datapipeline create-pipeline \
--name my-pipeline \
--unique-id pipeline-$(date +%s)

Answer:

Terminal window
# Create thing
aws iot create-thing --thing-name my-device
# Create thing type
aws iot create-thing-type --thing-type-name sensor-type
# Attach thing type
aws iot attach-thing-type --thing-name my-device --thing-type-name sensor-type

Answer:

Terminal window
# Create rule
aws iot create-topic-rule \
--rule-name my-rule \
--topic-rule-payload '{
"sql": "SELECT * FROM 'devices/+/data'",
"actions": [{
"lambda": {
"functionArn": "arn:aws:lambda:us-east-1:123456789012:function:process-data"
}
}]
}'

Answer:

Terminal window
# Create queue
QUEUE_URL=$(aws sqs create-queue --queue-name my-queue --query 'QueueUrl' --output text)
# Add permission for Lambda
aws sqs set-queue-attributes \
--queue-url $QUEUE_URL \
--attributes '{
"Policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"},\"Action\":\"sqs:*\",\"Resource\":\"*\"}]}"
}'
# Create event source mapping
aws lambda create-event-source-mapping \
--function-name my-function \
--event-source-arn arn:aws:sqs:us-east-1:123456789012:my-queue \
--batch-size 10

Answer:

Terminal window
# Create topic
TOPIC_ARN=$(aws sns create-topic --name my-topic --query 'TopicArn' --output text)
# Subscribe Lambda
aws sns subscribe \
--topic-arn $TOPIC_ARN \
--protocol lambda \
--notification-endpoint arn:aws:lambda:us-east-1:123456789012:function:my-function

Q242: How do you create Kinesis Analytics application?

Section titled “Q242: How do you create Kinesis Analytics application?”

Answer:

Terminal window
# Create application
aws kinesisanalyticsv2 create-application \
--application-name my-analytics \
--runtime FLINK_1_11 \
--service-execution-role-arn arn:aws:iam::123456789012:role/analytics-role \
--application-code "SELECT * FROM SOURCE_SQL_STREAM_001 WHERE temperature > 50"

Answer:

Terminal window
# Create database
aws athena start-query-execution \
--query-string "CREATE DATABASE IF NOT EXISTS mydb" \
--query-execution-context DatabaseName=mydb
# Create table
aws athena start-query-execution \
--query-string "
CREATE TABLE mydb.s3_logs (
time STRING,
method STRING,
status INT,
size BIGINT
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION 's3://my-bucket/logs/'
" \
--query-execution-context DatabaseName=mydb
# Query
aws athena start-query-execution \
--query-string "SELECT * FROM s3_logs WHERE status = 404" \
--query-execution-context DatabaseName=mydb

Q244: How do you create QuickSight dataset?

Section titled “Q244: How do you create QuickSight dataset?”

Answer:

Terminal window
# Create dataset (requires QuickSight console)
# 1. Go to QuickSight
# 2. Datasets → New dataset
# 3. Choose data source (S3, Athena, RDS, etc.)
# 4. Import or direct query
# 5. Visualize

Q245: How do you create SageMaker notebook?

Section titled “Q245: How do you create SageMaker notebook?”

Answer:

Terminal window
# Create notebook instance
aws sagemaker create-notebook-instance \
--notebook-instance-name my-notebook \
--instance-type ml.t2.medium \
--role-arn arn:aws:iam::123456789012:role/sagemaker-role
# Start notebook
aws sagemaker start-notebook-instance --notebook-instance-name my-notebook

Answer:

Terminal window
# Create job (visual)
# Use AWS Glue Console → ETL Jobs → Visual ETL
# Or use Glue Studio API
# Create job via CLI
aws glue create-job \
--name my-glue-studio-job \
--role arn:aws:iam::123456789012:role/glue-role \
--command '{
"Name": "glueetl",
"ScriptLocation": "s3://my-bucket/scripts/etl.py"
}'

Answer:

Terminal window
# Register S3 location
aws lakeformation register-resource \
--resource-arn arn:aws:s3:::my-data-lake \
--use-service-linked-role
# Grant permissions
aws lakeformation grant-permissions \
--principal DataLakePrincipalIdentifier=arn:aws:iam::123456789012:user/john \
--permissions SELECT \
--resource '{"Table":{"DatabaseName":"mydb","TableName":"table1"}}'

Answer:

Terminal window
# Create cluster
aws redshift create-cluster \
--cluster-identifier my-cluster \
--node-type dc1.large \
--master-username admin \
--master-user-password mypassword123 \
--cluster-type single-node \
--db-name mydb

Answer:

Terminal window
# Resize cluster
aws redshift resize \
--cluster-identifier my-cluster \
--cluster-type multi-node \
--node-type dc2.large \
--number-of-nodes 3

Q250: How do you create Elasticsearch domain?

Section titled “Q250: How do you create Elasticsearch domain?”

Answer:

Terminal window
# Create domain
aws es create-elasticsearch-domain \
--domain-name my-domain \
--elasticsearch-version 7.10 \
--cluster-config '{
"InstanceType": "t3.medium.elasticsearch",
"InstanceCount": 2,
"DedicatedMasterEnabled": false,
"ZoneAwarenessEnabled": true
}' \
--ebs-options '{
"EBSEnabled": true,
"VolumeType": "gp2",
"VolumeSize": 20
}'

Q251: How do you create OpenSearch domain?

Section titled “Q251: How do you create OpenSearch domain?”

Answer:

Terminal window
# Create domain
aws opensearch create-domain \
--domain-name my-domain \
--engine-version OpenSearch_1.0 \
--cluster-config '{
"InstanceType": "t3.medium.search",
"InstanceCount": 2,
"ZoneAwarenessEnabled": true
}' \
--ebs-options '{
"EBSEnabled": true,
"VolumeType": "gp2",
"VolumeSize": 20
}'

Answer:

Terminal window
# Enable Macie
aws macie2 enable-macie
# Create classification job
aws macie2 create-classification-job \
--job-type ONE_TIME \
--name my-classification-job \
--s3-job-definition '{
"bucketDefinitions": [{"accountId":"123456789012","buckets":["my-bucket"]}]
}'

Answer:

Terminal window
# Enable GuardDuty
aws guardduty create-detector \
--enable
# Create sample findings
aws guardduty create-sample-findings \
--detector-id detector-id

Answer:

Terminal window
# Enable Security Hub
aws securityhub enable-organization-admin-account --admin-account-id 123456789012
# Enable standards
aws securityhub enable-standards \
--standards-arn arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0

Answer:

Terminal window
# Enable Detective
aws detective create-graph
# Create member invitation
aws detective create-members \
--graph-arn arn:aws:detective:us-east-1:123456789012:graph/abc \
--accounts '[{"AccountId":"123456789012","EmailAddress":"admin@example.com"}]'

Answer:

Terminal window
# Set up Control Tower (requires console)
# 1. Go to AWS Control Tower console
# 2. Choose "Set up landing zone"
# 3. Configure:
# - Home region
# - Shared accounts (management, log archive, audit)
# - Organization structure
# 4. Review and set up

Q257: How do you configure Session Manager?

Section titled “Q257: How do you configure Session Manager?”

Answer:

Terminal window
# Create IAM role for Session Manager
aws iam create-role \
--role-name SessionManagerRole \
--assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}]
}'
# Attach policy
aws iam attach-role-policy \
--role-name SessionManagerRole \
--policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore

Q258: How do you use Parameter Store for secure strings?

Section titled “Q258: How do you use Parameter Store for secure strings?”

Answer:

import boto3
import json
ssm = boto3.client('ssm')
# Create secure string parameter
ssm.put_parameter(
Name='/myapp/database/password',
Value='my-secret-password',
Type='SecureString',
KeyId='alias/aws/ssm',
Overwrite=True
)
# Get parameter
response = ssm.get_parameter(
Name='/myapp/database/password',
WithDecryption=True
)
password = response['Parameter']['Value']

Q259: How do you create package in Distributor?

Section titled “Q259: How do you create package in Distributor?”

Answer:

Terminal window
# Create package (requires console or API)
# 1. Package name
# 2. Version
# 3. Platform (Windows/Linux)
# 4. Files to include
# 5. Install script
# 6. Associate with instances

Answer:

Terminal window
# Create stack
aws opsworks create-stack \
--name my-stack \
--region us-east-1 \
--service-role-arn arn:aws:iam::123456789012:role/opsworks-role \
--default-instance-profile arn:aws:iam::123456789012:instance-profile/opsworks-ec2-role

Q261: How do you create AppConfig application?

Section titled “Q261: How do you create AppConfig application?”

Answer:

Terminal window
# Create application
aws appconfig create-application \
--name my-app
# Create environment
aws appconfig create-environment \
--application-id abc123 \
--name production
# Create configuration profile
aws appconfig create-configuration-profile \
--application-id abc123 \
--name my-config \
--location-uri s3://my-bucket/config.json \
--type AWS.AppConfig.FreeFormConfiguration

Q262: How do you create Proton environment?

Section titled “Q262: How do you create Proton environment?”

Answer:

Terminal window
# Create environment
aws proton create-environment \
--name my-env \
--template-major-version 1 \
--proton-service-role-arn arn:aws:iam::123456789012:role/proton-role

Answer:

Terminal window
# Create app
aws amplify create-app \
--name my-app \
--repository https://github.com/user/repo \
--oauth-token my-oauth-token

Q264: How do you create App Runner service?

Section titled “Q264: How do you create App Runner service?”

Answer:

Terminal window
# Create service
aws apprunner create-service \
--service-name my-service \
--source-configuration '{
"ImageRepository": {
"RepositoryUrl": "123456789012.dkr.ecr.us-east-1.amazonaws.com/my-image",
"ImageIdentifier": "latest",
"ImageConfiguration": {"Port": "8080"}
},
"AutoDeploymentsEnabled": true
}' \
--instance-configuration '{
"Cpu": "1024", "Memory": "2048"
}'

Q265: How do you create Batch compute environment?

Section titled “Q265: How do you create Batch compute environment?”

Answer:

Terminal window
# Create compute environment
aws batch create-compute-environment \
--compute-environment-name my-env \
--type MANAGED \
--compute-resources '{
"type": "FARGATE",
"maxvCpus": 64,
"subnets": ["subnet-12345"],
"securityGroupIds": ["sg-12345"]
}' \
--service-role-arn arn:aws:iam::123456789012:role/batch-role

Answer:

Terminal window
# Create job queue
aws batch create-job-queue \
--job-queue-name my-queue \
--priority 100 \
--compute-environment-order '[{"computeEnvironment": "my-env","order": 1}]'

Q267: How do you create Lightsail instance?

Section titled “Q267: How do you create Lightsail instance?”

Answer:

Terminal window
# Create instance
aws lightsail create-instances \
--instance-name my-instance \
--availability-zone us-east-1a \
--blueprint-id ubuntu_20_04 \
--bundle-id medium_2_0

Q268: How do you create Global Accelerator?

Section titled “Q268: How do you create Global Accelerator?”

Answer:

Terminal window
# Create accelerator
aws globalaccelerator create-accelerator \
--name my-accelerator
# Create listener
aws globalaccelerator create-listener \
--accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/abc \
--protocol TCP \
--port-range '[{"FromPort": 80,"ToPort": 80}]'
# Create endpoint group
aws globalaccelerator create-endpoint-group \
--listener-arn arn:aws:globalaccelerator::123456789012:listener/xyz \
--endpoint-group-region us-east-1 \
--traffic-dial-percentage 100

Answer:

Terminal window
# Create location (source)
aws datasync create-location-smb \
--server-hostname my-server.example.com \
--subdirectory /share \
--agent-arn arn:aws:datasync:us-east-1:123456789012:agent/agent-id
# Create location (destination)
aws datasync create-location-s3 \
--s3-bucket-arn arn:aws:s3:::my-bucket \
--s3-config '{
"BucketAccessRoleArn": "arn:aws:iam::123456789012:role/datasync-role"
}'
# Create task
aws datasync create-task \
--source-location-arn source-arn \
--destination-location-arn dest-arn

Q270: How do you create Migration Hub application?

Section titled “Q270: How do you create Migration Hub application?”

Answer:

Terminal window
# Create application
aws migrationhub create-application \
--name my-application \
--description "My migration application"

Q271: How do you enable Agentless Discovery?

Section titled “Q271: How do you enable Agentless Discovery?”

Answer:

Terminal window
# Start agentless discovery connector
aws discovery start-agentless-connection \
--connector-configuration '{
"ConnectorName": "my-connector",
"SubnetId": "subnet-12345",
"SecurityGroupId": "sg-12345"
}'

Q272: How do you create DMS replication instance?

Section titled “Q272: How do you create DMS replication instance?”

Answer:

Terminal window
# Create replication instance
aws dms create-replication-instance \
--replication-instance-identifier my-replica \
--replication-instance-class dms.t3.medium \
--allocated-storage 50 \
--vpc-security-group-ids sg-12345 \
--availability-zone us-east-1a

Q273: How do you assess schema conversion?

Section titled “Q273: How do you assess schema conversion?”

Answer:

Terminal window
# Create assessment (requires SCT tool installation)
# 1. Connect to source database
# 2. Select schema to assess
# 3. Run assessment
# 4. View conversion report

Answer:

Terminal window
# Create server
aws transfer create-server \
--identity-provider-type SERVICE_MANAGED \
--protocols SFTP \
--endpoint-type PUBLIC
# Create user
aws transfer create-user \
--server-id s-1234567890abcdef0 \
--user-name myuser \
--role arn:aws:iam::123456789012:role/transfer-role \
--home-directory /my-bucket/myuser \
--ssh-public-key-body "ssh-rsa AAAAB..."

Answer:

Terminal window
# Create job (requires console or API)
aws mediaconvert create-job \
--role arn:aws:iam::123456789012:role/mediaconvert-role \
--settings '{
"OutputGroups": [{
"Name": "File Group",
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {"Destination": "s3://output-bucket/"}
}
}],
"Inputs": [{
"FileInput": "s3://input-bucket/video.mp4"
}]
}'

Q276: How do you create MediaLive channel?

Section titled “Q276: How do you create MediaLive channel?”

Answer:

Terminal window
# Create channel
aws medialive create-channel \
--channel-class SINGLE_PIPELINE \
--input-specification '{
"Codec": "AVC",
"Resolution": "HD",
"MaximumBitrate": "MAX_10_MBPS"
}' \
--name my-channel

Q277: How do you create IoT Analytics dataset?

Section titled “Q277: How do you create IoT Analytics dataset?”

Answer:

Terminal window
# Create datastore
aws iotanalytics create-datastore \
--datastore-name my-datastore
# Create dataset
aws iotanalytics create-dataset \
--dataset-name my-dataset \
--actions '[{
"ActionName": "query-action",
"QueryAction": {"SqlQuery": "SELECT * FROM my_datastore"}
}]'

Q278: How do you create IoT Events detector?

Section titled “Q278: How do you create IoT Events detector?”

Answer:

Terminal window
# Create input
aws iotevents create-input \
--input-name my-input \
--input-definition '{
"attributes": [{"jsonPath": "temperature"}]
}'
# Create detector model
aws iotevents create-detector-model \
--detector-model-name my-detector \
--detector-model-definition '{
"states": [{
"stateName": "Normal",
"onInput": {"events": []}
}]
}'

Q279: How do you create IoT SiteWise asset?

Section titled “Q279: How do you create IoT SiteWise asset?”

Answer:

Terminal window
# Create asset model
aws iotsitewise create-asset-model \
--asset-model-name my-model \
--asset-model-properties '[{
"name": "Temperature",
"dataType": DOUBLE,
"unit": "celsius"
}]'
# Create asset
aws iotsitewise create-asset \
--asset-model-id model-id \
--asset-name my-asset

Q280: How do you create RoboMaker simulation?

Section titled “Q280: How do you create RoboMaker simulation?”

Answer:

Terminal window
# Create simulation application
aws robomaker create-simulation-application \
--name my-simulation \
--sources '[{"s3Bucket":"my-bucket","s3Key":"simulation.tar.gz"}]' \
--robot-software-suite '{
"name": "ROS",
"version": "Kinetic"
}'

Q281: How do you configure Ground Station?

Section titled “Q281: How do you configure Ground Station?”

Answer:

Terminal window
# Create config
aws groundstation create-config \
--config-type dataflow-endpoint \
--name my-config \
--dataflowEndpointConfig '{
"dataflowEndpoint": {"name": "my-endpoint"},
"dataflowEndpointRegion": "us-east-1"
}'

Answer:

Terminal window
# Create outpost (requires Outposts console)
# 1. Go to AWS Outposts console
# 2. Create Outpost
# 3. Choose instance type
# 4. Choose location
# 5. Place order

Answer:

Terminal window
# Enable Local Zone
aws ec2 modify-subnet-attribute \
--subnet-id subnet-12345 \
--map-public-ip-on-launch
# Create instance in Local Zone
aws ec2 run-instances \
--image-id ami-12345 \
--instance-type t3.medium \
--subnet-id subnet-in-local-zone

Q284: How do you deploy to Wavelength Zone?

Section titled “Q284: How do you deploy to Wavelength Zone?”

Answer:

Terminal window
# Create subnet in Wavelength Zone
aws ec2 create-subnet \
--vpc-id vpc-123 \
--cidr-block 10.0.1.0/24 \
--availability-zone us-east-1-wl1-bos-wl-1
# Deploy to Wavelength Zone
aws ec2 run-instances \
--image-id ami-12345 \
--instance-type t3.medium \
--subnet-id subnet-in-wavelength-zone

Q285: How do you use Application Composer?

Section titled “Q285: How do you use Application Composer?”

Answer:

Terminal window
# Use Application Composer (console-based)
# 1. Go to AWS Application Composer console
# 2. Create new application
# 3. Drag and drop components
# 4. Configure connections
# 5. Generate SAM or CDK template

Q286: How do you create Clean Rooms collaboration?

Section titled “Q286: How do you create Clean Rooms collaboration?”

Answer:

Terminal window
# Create clean room
aws cleanrooms create-collaboration \
--name my-collaboration \
--member-capabilities '{
"canQuery": true,
"canReceiveResults": true
}'

Answer:

Terminal window
# Create reference store
aws omics create-reference-store \
--name my-reference-store
# Create variant store
aws omics create-variant-store \
--name my-variant-store

Answer:

Terminal window
# Set up AWS Supply Chain (requires console)
# 1. Go to AWS Supply Chain console
# 2. Create supply chain instance
# 3. Connect data sources
# 4. Configure users and permissions

Q289: How do you create SimSpace Weaver app?

Section titled “Q289: How do you create SimSpace Weaver app?”

Answer:

Terminal window
# Create simulation app
aws simspaceweaver create-simulation \
--name my-simulation \
--role-arn arn:aws:iam::123456789012:role/simulation-role

Answer:

Terminal window
# Create wireless device
aws iotwireless create-wireless-device \
--type LoRaWAN \
--lorawan-device '{
"DevEui": "0011223344556677",
"ProfileId": "profile-id"
}'

Q291: How do you create Private 5G network?

Section titled “Q291: How do you create Private 5G network?”

Answer:

Terminal window
# Create network
aws private5g create-network \
--network-name my-network \
--type FULL

Q292: How do you migrate from Windows Server 2008?

Section titled “Q292: How do you migrate from Windows Server 2008?”

Answer:

Terminal window
# Start migration assessment
aws application-discoverer start-assessment \
--assessment-name my-assessment

Q293: How do you create ElastiCache Serverless?

Section titled “Q293: How do you create ElastiCache Serverless?”

Answer:

Terminal window
# Create serverless cache
aws elasticache create-serverless-cache \
--serverless-cache-name my-cache \
--engine redis

Q294: How do you create OpenSearch Serverless collection?

Section titled “Q294: How do you create OpenSearch Serverless collection?”

Answer:

Terminal window
# Create collection
aws opensearchserverless create-collection \
--name my-collection \
--type SEARCH

Q295: How do you create Redshift Serverless namespace?

Section titled “Q295: How do you create Redshift Serverless namespace?”

Answer:

Terminal window
# Create namespace
aws redshift create-namespace \
--namespace-name my-namespace \
--admin-user-name admin \
--admin-user-password mypassword123

  • Use Security Groups
  • Enable VPC
  • Use IAM roles
  • Enable CloudWatch monitoring
  • Regular patching

Q297: What is the difference between EBS and Instance Store?

Section titled “Q297: What is the difference between EBS and Instance Store?”
  • EBS: persistent, network-attached
  • Instance Store: local, temporary
  • Automated backups
  • Manual snapshots
  • Cross-region replication
  • Automates object transitions
  • Move to IA, Glacier
  • Expiration rules
  • Block public access
  • Enable encryption
  • Use bucket policies
  • Enable versioning
  • Enable MFA Delete

Questions 301-400 continue with more advanced topics and hands-on scenarios…