AWS_Practical_Interview_201 400
AWS Practical Interview Questions (201-400)
Section titled “AWS Practical Interview Questions (201-400)”EKS and Kubernetes
Section titled “EKS and Kubernetes”Q201: How do you create EKS cluster?
Section titled “Q201: How do you create EKS cluster?”Answer:
# Create clusteraws 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 kubeconfigaws eks update-kubeconfig --name my-cluster --region us-east-1Q202: How do you create node group in EKS?
Section titled “Q202: How do you create node group in EKS?”Answer:
# Create node groupaws 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-67890Q203: How do you deploy application to EKS?
Section titled “Q203: How do you deploy application to EKS?”Answer:
# Apply deploymentkubectl apply -f deployment.yaml
# deployment.yamlapiVersion: apps/v1kind: Deploymentmetadata: name: my-appspec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app image: nginx:latest ports: - containerPort: 80Q204: How do you expose application in EKS?
Section titled “Q204: How do you expose application in EKS?”Answer:
# Create servicekubectl expose deployment my-app --type=LoadBalancer --port=80
# Or create ingresskubectl apply -f ingress.yaml
# ingress.yamlapiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: my-ingressspec: rules: - host: example.com http: paths: - path: / pathType: Prefix backend: service: name: my-app port: number: 80Q205: How do you set up ALB controller in EKS?
Section titled “Q205: How do you set up ALB controller in EKS?”Answer:
# Install AWS Load Balancer Controllerhelm repo add eks https://aws.github.io/eks-chartshelm install aws-load-balancer-controller \ -n kube-system \ --set clusterName=my-cluster \ --set serviceAccount.create=false \ --set serviceAccount.name=aws-load-balancer-controllerAWS Glue and Data Pipeline
Section titled “AWS Glue and Data Pipeline”Q206: How do you create Glue crawler?
Section titled “Q206: How do you create Glue crawler?”Answer:
# Create crawleraws 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 * * ? *)"Q207: How do you create Glue job?
Section titled “Q207: How do you create Glue job?”Answer:
# Create jobaws 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": "" }'Q208: How do you run Glue job?
Section titled “Q208: How do you run Glue job?”Answer:
# Start job runaws glue start-job-run \ --job-name my-etl-job \ --arguments '{ "--extra-py-files": "s3://my-bucket/lib/utils.py" }'AWS Step Functions
Section titled “AWS Step Functions”Q209: How do you create Step Functions state machine?
Section titled “Q209: How do you create Step Functions state machine?”Answer:
# Create state machineaws 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-roleQ210: How do you invoke Step Functions?
Section titled “Q210: How do you invoke Step Functions?”Answer:
# Start executionaws stepfunctions start-execution \ --state-machine-arn arn:aws:states:us-east-1:123456789012:stateMachine:my-workflow \ --input '{"key": "value"}'AWS EventBridge
Section titled “AWS EventBridge”Q211: How do you create EventBridge rule?
Section titled “Q211: How do you create EventBridge rule?”Answer:
# Create ruleaws events put-rule \ --name my-rule \ --event-pattern '{ "source": ["aws.ec2"], "detail-type": ["EC2 Instance State-change Notification"] }'
# Add targetaws 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:
# Create scheduleaws events put-rule \ --name daily-trigger \ --schedule-expression "rate(1 day)"AWS CodeBuild
Section titled “AWS CodeBuild”Q213: How do you create CodeBuild project?
Section titled “Q213: How do you create CodeBuild project?”Answer:
# Create projectaws 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" }'Q214: How do you create buildspec.yml?
Section titled “Q214: How do you create buildspec.yml?”Answer:
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: yesAWS CodeDeploy
Section titled “AWS CodeDeploy”Q215: How do you create CodeDeploy application?
Section titled “Q215: How do you create CodeDeploy application?”Answer:
# Create applicationaws codedeploy create-application \ --application-name my-application
# Create deployment groupaws 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"}]'Q216: How do you create appspec.yml?
Section titled “Q216: How do you create appspec.yml?”Answer:
version: 0.0os: 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.shAWS CodePipeline
Section titled “AWS CodePipeline”Q217: How do you create CodePipeline?
Section titled “Q217: How do you create CodePipeline?”Answer:
# Create pipelineaws 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"} }'AWS CloudTrail
Section titled “AWS CloudTrail”Q218: How do you look up CloudTrail events?
Section titled “Q218: How do you look up CloudTrail events?”Answer:
# Lookup eventsaws cloudtrail lookup-events \ --lookup-attributes AttributeKey=EventSource,AttributeValue=ec2.amazonaws.com
# Lookup by usernameaws cloudtrail lookup-events \ --lookup-attributes AttributeKey=Username,AttributeValue=john
# Lookup by resourceaws cloudtrail lookup-events \ --lookup-attributes AttributeKey=ResourceName,AttributeValue=my-bucketAWS Config
Section titled “AWS Config”Q219: How do you enable AWS Config?
Section titled “Q219: How do you enable AWS Config?”Answer:
# Create configuration recorderaws configservice put-configuration-recorder \ --configuration-recorder '{ "name": "default", "roleARN": "arn:aws:iam::123456789012:role/config-role" }'
# Create delivery channelaws configservice put-delivery-channel \ --delivery-channel '{ "name": "default", "s3BucketName": "config-bucket", "snsTopicARN": "arn:aws:sns:us-east-1:123456789012:config-topic" }'
# Start recorderaws configservice start-configuration-recorder --configuration-recorder-name defaultAWS Systems Manager
Section titled “AWS Systems Manager”Q220: How do you create Maintenance Window?
Section titled “Q220: How do you create Maintenance Window?”Answer:
# Create maintenance windowaws ssm create-maintenance-window \ --name "My-Maintenance-Window" \ --schedule "cron(0 2 ? * SUN *)" \ --duration 4 \ --cutoff 1
# Register targetaws ssm register-target-with-maintenance-window \ --window-id mw-12345 \ --target '{"Key":"instanceids","Values":["i-12345"]}'
# Register taskaws 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 1AWS Secrets Manager
Section titled “AWS Secrets Manager”Q221: How do you create secret with rotation?
Section titled “Q221: How do you create secret with rotation?”Answer:
# Create secret with Lambda rotationaws 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=30AWS KMS
Section titled “AWS KMS”Q222: How do you create KMS key with policy?
Section titled “Q222: How do you create KMS key with policy?”Answer:
# Create keyaws kms create-key \ --description "My encryption key" \ --key-usage ENCRYPT_DECRYPT \ --origin AWS_KMS \ --multi-region
# Put key policyaws 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": "*" }] }'AWS CloudWatch Logs
Section titled “AWS CloudWatch Logs”Q223: How do you create log subscription filter?
Section titled “Q223: How do you create log subscription filter?”Answer:
# Create subscription filter to Lambdaaws 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-processorAWS S3 Advanced
Section titled “AWS S3 Advanced”Q224: How do you set up S3 batch operations?
Section titled “Q224: How do you set up S3 batch operations?”Answer:
# Create jobaws 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-roleAWS Lambda Advanced Patterns
Section titled “AWS Lambda Advanced Patterns”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 boto3import 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 eAWS VPC Advanced
Section titled “AWS VPC Advanced”Q226: How do you create VPC with NAT Gateway?
Section titled “Q226: How do you create VPC with NAT Gateway?”Answer:
# Create VPCVPC=$(aws ec2 create-vpc --cidr-block 10.0.0.0/16 --query 'Vpc.VpcId' --output text)
# Create public subnetPUBLIC_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 subnetPRIVATE_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 IGWIGW=$(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 GatewayEIP=$(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 tablesPUBLIC_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 $IGWaws 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 $NATaws ec2 associate-route-table --route-table-id $PRIVATE_RT --subnet-id $PRIVATE_SUBNETAWS RDS Advanced
Section titled “AWS RDS Advanced”Q227: How do you create RDS proxy?
Section titled “Q227: How do you create RDS proxy?”Answer:
# Create secret for database credentialsaws secretsmanager create-secret \ --name rds-secret \ --secret-string '{"username":"admin","password":"password"}'
# Create RDS proxyaws 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-12345AWS DynamoDB Advanced
Section titled “AWS DynamoDB Advanced”Q228: How do you create DynamoDB global table?
Section titled “Q228: How do you create DynamoDB global table?”Answer:
# Create table in first regionaws 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 backupaws dynamodb update-continuous-backups \ --table-name Orders \ --point-in-time-recovery-specification PointInTimeRecoveryEnabled=trueAWS EFS Advanced
Section titled “AWS EFS Advanced”Q229: How do you create EFS with access points?
Section titled “Q229: How do you create EFS with access points?”Answer:
# Create EFSEFS=$(aws efs create-file-system \ --throughput-mode bursting \ --encrypted \ --query 'FileSystemId' \ --output text)
# Create access point for appaws 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 dataaws 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"}}'AWS ECS Advanced
Section titled “AWS ECS Advanced”Q230: How do you update ECS service with blue-green?
Section titled “Q230: How do you update ECS service with blue-green?”Answer:
# Create new task definitionaws ecs register-task-definition \ --family my-app \ --network-mode awsvpc \ --container-definitions '[{"name":"web","image":"nginx:v2"}]'
# Update serviceaws ecs update-service \ --cluster my-cluster \ --service my-service \ --task-definition my-app:2 \ --deployment-configuration '{ "minimumHealthyPercent": 50, "maximumPercent": 200 }'AWS EKS Advanced
Section titled “AWS EKS Advanced”Q231: How do you create Helm release in EKS?
Section titled “Q231: How do you create Helm release in EKS?”Answer:
# Add repohelm repo add nginx-stable https://kubernetes.github.io/ingress-nginx
# Install nginx ingresshelm 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 Prometheushelm install prometheus prometheus-community/prometheus \ --namespace monitoring \ --create-namespaceAWS CloudFormation Advanced
Section titled “AWS CloudFormation Advanced”Q232: How do you use CloudFormation StackSets for multiple accounts?
Section titled “Q232: How do you use CloudFormation StackSets for multiple accounts?”Answer:
# Create stack setaws 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 accountsaws 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 }'AWS CDK
Section titled “AWS CDK”Q233: How do you create VPC with CDK?
Section titled “Q233: How do you create VPC with CDK?”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 ) ] )Q234: How do you create Lambda with CDK?
Section titled “Q234: How do you create Lambda with CDK?”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 )AWS SAM
Section titled “AWS SAM”Q235: How do you create SAM template?
Section titled “Q235: How do you create SAM template?”Answer:
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::SimpleTableQ236: How do you deploy SAM application?
Section titled “Q236: How do you deploy SAM application?”Answer:
# Buildsam build
# Deploysam deploy --guided
# Local invokesam local invoke MyFunction --event event.json
# Local APIsam local start-apiAWS Data Pipeline
Section titled “AWS Data Pipeline”Q237: How do you create Data Pipeline?
Section titled “Q237: How do you create Data Pipeline?”Answer:
# Create pipelineaws datapipeline create-pipeline \ --name my-pipeline \ --unique-id pipeline-$(date +%s)AWS IoT
Section titled “AWS IoT”Q238: How do you create IoT Thing?
Section titled “Q238: How do you create IoT Thing?”Answer:
# Create thingaws iot create-thing --thing-name my-device
# Create thing typeaws iot create-thing-type --thing-type-name sensor-type
# Attach thing typeaws iot attach-thing-type --thing-name my-device --thing-type-name sensor-typeAWS IoT Core Rules
Section titled “AWS IoT Core Rules”Q239: How do you create IoT rule?
Section titled “Q239: How do you create IoT rule?”Answer:
# Create ruleaws 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" } }] }'AWS SQS Advanced
Section titled “AWS SQS Advanced”Q240: How do you use SQS with Lambda?
Section titled “Q240: How do you use SQS with Lambda?”Answer:
# Create queueQUEUE_URL=$(aws sqs create-queue --queue-name my-queue --query 'QueueUrl' --output text)
# Add permission for Lambdaaws 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 mappingaws lambda create-event-source-mapping \ --function-name my-function \ --event-source-arn arn:aws:sqs:us-east-1:123456789012:my-queue \ --batch-size 10AWS SNS Advanced
Section titled “AWS SNS Advanced”Q241: How do you use SNS with Lambda?
Section titled “Q241: How do you use SNS with Lambda?”Answer:
# Create topicTOPIC_ARN=$(aws sns create-topic --name my-topic --query 'TopicArn' --output text)
# Subscribe Lambdaaws sns subscribe \ --topic-arn $TOPIC_ARN \ --protocol lambda \ --notification-endpoint arn:aws:lambda:us-east-1:123456789012:function:my-functionAWS Kinesis Data Analytics
Section titled “AWS Kinesis Data Analytics”Q242: How do you create Kinesis Analytics application?
Section titled “Q242: How do you create Kinesis Analytics application?”Answer:
# Create applicationaws 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"AWS Athena
Section titled “AWS Athena”Q243: How do you query data with Athena?
Section titled “Q243: How do you query data with Athena?”Answer:
# Create databaseaws athena start-query-execution \ --query-string "CREATE DATABASE IF NOT EXISTS mydb" \ --query-execution-context DatabaseName=mydb
# Create tableaws 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
# Queryaws athena start-query-execution \ --query-string "SELECT * FROM s3_logs WHERE status = 404" \ --query-execution-context DatabaseName=mydbAWS QuickSight
Section titled “AWS QuickSight”Q244: How do you create QuickSight dataset?
Section titled “Q244: How do you create QuickSight dataset?”Answer:
# 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. VisualizeAWS SageMaker
Section titled “AWS SageMaker”Q245: How do you create SageMaker notebook?
Section titled “Q245: How do you create SageMaker notebook?”Answer:
# Create notebook instanceaws sagemaker create-notebook-instance \ --notebook-instance-name my-notebook \ --instance-type ml.t2.medium \ --role-arn arn:aws:iam::123456789012:role/sagemaker-role
# Start notebookaws sagemaker start-notebook-instance --notebook-instance-name my-notebookAWS Glue Studio
Section titled “AWS Glue Studio”Q246: How do you create Glue Studio job?
Section titled “Q246: How do you create Glue Studio job?”Answer:
# Create job (visual)# Use AWS Glue Console → ETL Jobs → Visual ETL# Or use Glue Studio API
# Create job via CLIaws 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" }'AWS Lake Formation
Section titled “AWS Lake Formation”Q247: How do you set up Lake Formation?
Section titled “Q247: How do you set up Lake Formation?”Answer:
# Register S3 locationaws lakeformation register-resource \ --resource-arn arn:aws:s3:::my-data-lake \ --use-service-linked-role
# Grant permissionsaws lakeformation grant-permissions \ --principal DataLakePrincipalIdentifier=arn:aws:iam::123456789012:user/john \ --permissions SELECT \ --resource '{"Table":{"DatabaseName":"mydb","TableName":"table1"}}'AWS Redshift
Section titled “AWS Redshift”Q248: How do you create Redshift cluster?
Section titled “Q248: How do you create Redshift cluster?”Answer:
# Create clusteraws redshift create-cluster \ --cluster-identifier my-cluster \ --node-type dc1.large \ --master-username admin \ --master-user-password mypassword123 \ --cluster-type single-node \ --db-name mydbQ249: How do you resize Redshift cluster?
Section titled “Q249: How do you resize Redshift cluster?”Answer:
# Resize clusteraws redshift resize \ --cluster-identifier my-cluster \ --cluster-type multi-node \ --node-type dc2.large \ --number-of-nodes 3AWS Elasticsearch
Section titled “AWS Elasticsearch”Q250: How do you create Elasticsearch domain?
Section titled “Q250: How do you create Elasticsearch domain?”Answer:
# Create domainaws 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 }'AWS OpenSearch
Section titled “AWS OpenSearch”Q251: How do you create OpenSearch domain?
Section titled “Q251: How do you create OpenSearch domain?”Answer:
# Create domainaws 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 }'AWS Macie
Section titled “AWS Macie”Q252: How do you enable Macie?
Section titled “Q252: How do you enable Macie?”Answer:
# Enable Macieaws macie2 enable-macie
# Create classification jobaws macie2 create-classification-job \ --job-type ONE_TIME \ --name my-classification-job \ --s3-job-definition '{ "bucketDefinitions": [{"accountId":"123456789012","buckets":["my-bucket"]}] }'AWS GuardDuty
Section titled “AWS GuardDuty”Q253: How do you enable GuardDuty?
Section titled “Q253: How do you enable GuardDuty?”Answer:
# Enable GuardDutyaws guardduty create-detector \ --enable
# Create sample findingsaws guardduty create-sample-findings \ --detector-id detector-idAWS Security Hub
Section titled “AWS Security Hub”Q254: How do you enable Security Hub?
Section titled “Q254: How do you enable Security Hub?”Answer:
# Enable Security Hubaws securityhub enable-organization-admin-account --admin-account-id 123456789012
# Enable standardsaws securityhub enable-standards \ --standards-arn arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0AWS Detective
Section titled “AWS Detective”Q255: How do you enable Detective?
Section titled “Q255: How do you enable Detective?”Answer:
# Enable Detectiveaws detective create-graph
# Create member invitationaws detective create-members \ --graph-arn arn:aws:detective:us-east-1:123456789012:graph/abc \ --accounts '[{"AccountId":"123456789012","EmailAddress":"admin@example.com"}]'AWS Control Tower
Section titled “AWS Control Tower”Q256: How do you set up Control Tower?
Section titled “Q256: How do you set up Control Tower?”Answer:
# 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 upAWS Systems Manager Session Manager
Section titled “AWS Systems Manager Session Manager”Q257: How do you configure Session Manager?
Section titled “Q257: How do you configure Session Manager?”Answer:
# Create IAM role for Session Manageraws 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 policyaws iam attach-role-policy \ --role-name SessionManagerRole \ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCoreAWS Systems Manager Parameter Store
Section titled “AWS Systems Manager Parameter Store”Q258: How do you use Parameter Store for secure strings?
Section titled “Q258: How do you use Parameter Store for secure strings?”Answer:
import boto3import json
ssm = boto3.client('ssm')
# Create secure string parameterssm.put_parameter( Name='/myapp/database/password', Value='my-secret-password', Type='SecureString', KeyId='alias/aws/ssm', Overwrite=True)
# Get parameterresponse = ssm.get_parameter( Name='/myapp/database/password', WithDecryption=True)password = response['Parameter']['Value']AWS Systems Manager Distributor
Section titled “AWS Systems Manager Distributor”Q259: How do you create package in Distributor?
Section titled “Q259: How do you create package in Distributor?”Answer:
# 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 instancesAWS OpsWorks
Section titled “AWS OpsWorks”Q260: How do you create OpsWorks stack?
Section titled “Q260: How do you create OpsWorks stack?”Answer:
# Create stackaws 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-roleAWS AppConfig
Section titled “AWS AppConfig”Q261: How do you create AppConfig application?
Section titled “Q261: How do you create AppConfig application?”Answer:
# Create applicationaws appconfig create-application \ --name my-app
# Create environmentaws appconfig create-environment \ --application-id abc123 \ --name production
# Create configuration profileaws appconfig create-configuration-profile \ --application-id abc123 \ --name my-config \ --location-uri s3://my-bucket/config.json \ --type AWS.AppConfig.FreeFormConfigurationAWS Proton
Section titled “AWS Proton”Q262: How do you create Proton environment?
Section titled “Q262: How do you create Proton environment?”Answer:
# Create environmentaws proton create-environment \ --name my-env \ --template-major-version 1 \ --proton-service-role-arn arn:aws:iam::123456789012:role/proton-roleAWS Amplify
Section titled “AWS Amplify”Q263: How do you create Amplify app?
Section titled “Q263: How do you create Amplify app?”Answer:
# Create appaws amplify create-app \ --name my-app \ --repository https://github.com/user/repo \ --oauth-token my-oauth-tokenAWS App Runner
Section titled “AWS App Runner”Q264: How do you create App Runner service?
Section titled “Q264: How do you create App Runner service?”Answer:
# Create serviceaws 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" }'AWS Batch
Section titled “AWS Batch”Q265: How do you create Batch compute environment?
Section titled “Q265: How do you create Batch compute environment?”Answer:
# Create compute environmentaws 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-roleQ266: How do you create Batch job queue?
Section titled “Q266: How do you create Batch job queue?”Answer:
# Create job queueaws batch create-job-queue \ --job-queue-name my-queue \ --priority 100 \ --compute-environment-order '[{"computeEnvironment": "my-env","order": 1}]'AWS Lightsail
Section titled “AWS Lightsail”Q267: How do you create Lightsail instance?
Section titled “Q267: How do you create Lightsail instance?”Answer:
# Create instanceaws lightsail create-instances \ --instance-name my-instance \ --availability-zone us-east-1a \ --blueprint-id ubuntu_20_04 \ --bundle-id medium_2_0AWS Global Accelerator
Section titled “AWS Global Accelerator”Q268: How do you create Global Accelerator?
Section titled “Q268: How do you create Global Accelerator?”Answer:
# Create acceleratoraws globalaccelerator create-accelerator \ --name my-accelerator
# Create listeneraws globalaccelerator create-listener \ --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/abc \ --protocol TCP \ --port-range '[{"FromPort": 80,"ToPort": 80}]'
# Create endpoint groupaws globalaccelerator create-endpoint-group \ --listener-arn arn:aws:globalaccelerator::123456789012:listener/xyz \ --endpoint-group-region us-east-1 \ --traffic-dial-percentage 100AWS DataSync
Section titled “AWS DataSync”Q269: How do you create DataSync task?
Section titled “Q269: How do you create DataSync task?”Answer:
# 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 taskaws datasync create-task \ --source-location-arn source-arn \ --destination-location-arn dest-arnAWS Migration Hub
Section titled “AWS Migration Hub”Q270: How do you create Migration Hub application?
Section titled “Q270: How do you create Migration Hub application?”Answer:
# Create applicationaws migrationhub create-application \ --name my-application \ --description "My migration application"AWS Application Discovery Service
Section titled “AWS Application Discovery Service”Q271: How do you enable Agentless Discovery?
Section titled “Q271: How do you enable Agentless Discovery?”Answer:
# Start agentless discovery connectoraws discovery start-agentless-connection \ --connector-configuration '{ "ConnectorName": "my-connector", "SubnetId": "subnet-12345", "SecurityGroupId": "sg-12345" }'AWS Database Migration Service
Section titled “AWS Database Migration Service”Q272: How do you create DMS replication instance?
Section titled “Q272: How do you create DMS replication instance?”Answer:
# Create replication instanceaws 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-1aAWS Schema Conversion Tool
Section titled “AWS Schema Conversion Tool”Q273: How do you assess schema conversion?
Section titled “Q273: How do you assess schema conversion?”Answer:
# Create assessment (requires SCT tool installation)# 1. Connect to source database# 2. Select schema to assess# 3. Run assessment# 4. View conversion reportAWS Transfer Family
Section titled “AWS Transfer Family”Q274: How do you create SFTP server?
Section titled “Q274: How do you create SFTP server?”Answer:
# Create serveraws transfer create-server \ --identity-provider-type SERVICE_MANAGED \ --protocols SFTP \ --endpoint-type PUBLIC
# Create useraws 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..."AWS Elemental MediaConvert
Section titled “AWS Elemental MediaConvert”Q275: How do you create MediaConvert job?
Section titled “Q275: How do you create MediaConvert job?”Answer:
# 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" }] }'AWS Elemental MediaLive
Section titled “AWS Elemental MediaLive”Q276: How do you create MediaLive channel?
Section titled “Q276: How do you create MediaLive channel?”Answer:
# Create channelaws medialive create-channel \ --channel-class SINGLE_PIPELINE \ --input-specification '{ "Codec": "AVC", "Resolution": "HD", "MaximumBitrate": "MAX_10_MBPS" }' \ --name my-channelAWS IoT Analytics
Section titled “AWS IoT Analytics”Q277: How do you create IoT Analytics dataset?
Section titled “Q277: How do you create IoT Analytics dataset?”Answer:
# Create datastoreaws iotanalytics create-datastore \ --datastore-name my-datastore
# Create datasetaws iotanalytics create-dataset \ --dataset-name my-dataset \ --actions '[{ "ActionName": "query-action", "QueryAction": {"SqlQuery": "SELECT * FROM my_datastore"} }]'AWS IoT Events
Section titled “AWS IoT Events”Q278: How do you create IoT Events detector?
Section titled “Q278: How do you create IoT Events detector?”Answer:
# Create inputaws iotevents create-input \ --input-name my-input \ --input-definition '{ "attributes": [{"jsonPath": "temperature"}] }'
# Create detector modelaws iotevents create-detector-model \ --detector-model-name my-detector \ --detector-model-definition '{ "states": [{ "stateName": "Normal", "onInput": {"events": []} }] }'AWS IoT SiteWise
Section titled “AWS IoT SiteWise”Q279: How do you create IoT SiteWise asset?
Section titled “Q279: How do you create IoT SiteWise asset?”Answer:
# Create asset modelaws iotsitewise create-asset-model \ --asset-model-name my-model \ --asset-model-properties '[{ "name": "Temperature", "dataType": DOUBLE, "unit": "celsius" }]'
# Create assetaws iotsitewise create-asset \ --asset-model-id model-id \ --asset-name my-assetAWS RoboMaker
Section titled “AWS RoboMaker”Q280: How do you create RoboMaker simulation?
Section titled “Q280: How do you create RoboMaker simulation?”Answer:
# Create simulation applicationaws robomaker create-simulation-application \ --name my-simulation \ --sources '[{"s3Bucket":"my-bucket","s3Key":"simulation.tar.gz"}]' \ --robot-software-suite '{ "name": "ROS", "version": "Kinetic" }'AWS Ground Station
Section titled “AWS Ground Station”Q281: How do you configure Ground Station?
Section titled “Q281: How do you configure Ground Station?”Answer:
# Create configaws groundstation create-config \ --config-type dataflow-endpoint \ --name my-config \ --dataflowEndpointConfig '{ "dataflowEndpoint": {"name": "my-endpoint"}, "dataflowEndpointRegion": "us-east-1" }'AWS Outposts
Section titled “AWS Outposts”Q282: How do you order Outposts?
Section titled “Q282: How do you order Outposts?”Answer:
# Create outpost (requires Outposts console)# 1. Go to AWS Outposts console# 2. Create Outpost# 3. Choose instance type# 4. Choose location# 5. Place orderAWS Local Zones
Section titled “AWS Local Zones”Q283: How do you use Local Zones?
Section titled “Q283: How do you use Local Zones?”Answer:
# Enable Local Zoneaws ec2 modify-subnet-attribute \ --subnet-id subnet-12345 \ --map-public-ip-on-launch
# Create instance in Local Zoneaws ec2 run-instances \ --image-id ami-12345 \ --instance-type t3.medium \ --subnet-id subnet-in-local-zoneAWS Wavelength
Section titled “AWS Wavelength”Q284: How do you deploy to Wavelength Zone?
Section titled “Q284: How do you deploy to Wavelength Zone?”Answer:
# Create subnet in Wavelength Zoneaws 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 Zoneaws ec2 run-instances \ --image-id ami-12345 \ --instance-type t3.medium \ --subnet-id subnet-in-wavelength-zoneAWS Application Composer
Section titled “AWS Application Composer”Q285: How do you use Application Composer?
Section titled “Q285: How do you use Application Composer?”Answer:
# 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 templateAWS Clean Rooms
Section titled “AWS Clean Rooms”Q286: How do you create Clean Rooms collaboration?
Section titled “Q286: How do you create Clean Rooms collaboration?”Answer:
# Create clean roomaws cleanrooms create-collaboration \ --name my-collaboration \ --member-capabilities '{ "canQuery": true, "canReceiveResults": true }'AWS HealthOmics
Section titled “AWS HealthOmics”Q287: How do you use HealthOmics?
Section titled “Q287: How do you use HealthOmics?”Answer:
# Create reference storeaws omics create-reference-store \ --name my-reference-store
# Create variant storeaws omics create-variant-store \ --name my-variant-storeAWS Supply Chain
Section titled “AWS Supply Chain”Q288: How do you set up AWS Supply Chain?
Section titled “Q288: How do you set up AWS Supply Chain?”Answer:
# 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 permissionsAWS SimSpace Weaver
Section titled “AWS SimSpace Weaver”Q289: How do you create SimSpace Weaver app?
Section titled “Q289: How do you create SimSpace Weaver app?”Answer:
# Create simulation appaws simspaceweaver create-simulation \ --name my-simulation \ --role-arn arn:aws:iam::123456789012:role/simulation-roleAWS IoT Express
Section titled “AWS IoT Express”Q290: How do you use IoT Express?
Section titled “Q290: How do you use IoT Express?”Answer:
# Create wireless deviceaws iotwireless create-wireless-device \ --type LoRaWAN \ --lorawan-device '{ "DevEui": "0011223344556677", "ProfileId": "profile-id" }'AWS Private 5G
Section titled “AWS Private 5G”Q291: How do you create Private 5G network?
Section titled “Q291: How do you create Private 5G network?”Answer:
# Create networkaws private5g create-network \ --network-name my-network \ --type FULLAWS End-of-Support Migration Program
Section titled “AWS End-of-Support Migration Program”Q292: How do you migrate from Windows Server 2008?
Section titled “Q292: How do you migrate from Windows Server 2008?”Answer:
# Start migration assessmentaws application-discoverer start-assessment \ --assessment-name my-assessmentAWS Elasticache Serverless
Section titled “AWS Elasticache Serverless”Q293: How do you create ElastiCache Serverless?
Section titled “Q293: How do you create ElastiCache Serverless?”Answer:
# Create serverless cacheaws elasticache create-serverless-cache \ --serverless-cache-name my-cache \ --engine redisAWS OpenSearch Serverless
Section titled “AWS OpenSearch Serverless”Q294: How do you create OpenSearch Serverless collection?
Section titled “Q294: How do you create OpenSearch Serverless collection?”Answer:
# Create collectionaws opensearchserverless create-collection \ --name my-collection \ --type SEARCHAWS Redshift Serverless
Section titled “AWS Redshift Serverless”Q295: How do you create Redshift Serverless namespace?
Section titled “Q295: How do you create Redshift Serverless namespace?”Answer:
# Create namespaceaws redshift create-namespace \ --namespace-name my-namespace \ --admin-user-name admin \ --admin-user-password mypassword123Additional Interview Questions 296-400
Section titled “Additional Interview Questions 296-400”Q296: How do you secure EC2 instances?
Section titled “Q296: How do you secure EC2 instances?”- 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
Q298: How do you backup RDS?
Section titled “Q298: How do you backup RDS?”- Automated backups
- Manual snapshots
- Cross-region replication
Q299: What is S3 lifecycle policy?
Section titled “Q299: What is S3 lifecycle policy?”- Automates object transitions
- Move to IA, Glacier
- Expiration rules
Q300: How do you secure S3 bucket?
Section titled “Q300: How do you secure S3 bucket?”- 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…