0
0
AWScloud~10 mins

Secrets Manager for credentials in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a secret in AWS Secrets Manager using AWS CLI.

AWS
aws secretsmanager create-secret --name MySecret --secret-string [1]
Drag options to blanks, or click blank then click option'
A"MySecretValue"
B"secret"
C"MyPassword"
D"{\"username\":\"admin\",\"password\":\"pass123\"}"
Attempts:
3 left
💡 Hint
Common Mistakes
Using plain text without JSON format.
Not escaping quotes inside the JSON string.
2fill in blank
medium

Complete the code to retrieve the secret value using AWS CLI.

AWS
aws secretsmanager get-secret-value --secret-id MySecret --query [1] --output text
Drag options to blanks, or click blank then click option'
A"SecretString"
B"SecretValue"
C"Secret"
D"Value"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect key names like 'SecretValue' or 'Value'.
Not using --query to extract the secret string.
3fill in blank
hard

Fix the error in the AWS CLI command to update a secret's value.

AWS
aws secretsmanager update-secret --secret-id MySecret --secret-string [1]
Drag options to blanks, or click blank then click option'
A"{username:admin,password:newpass}"
B'{"username":"admin","password":"newpass"}'
C"{\"username\":\"admin\",\"password\":\"newpass\"}"
D'{username:admin,password:newpass}'
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes which may not be supported in all shells.
Not quoting keys and values properly in JSON.
4fill in blank
hard

Fill both blanks to create a secret with a description and tags.

AWS
aws secretsmanager create-secret --name MySecret --secret-string [1] --description [2]
Drag options to blanks, or click blank then click option'
A"{\"username\":\"admin\",\"password\":\"pass123\"}"
B"My secret for database credentials"
C"Database credentials"
D"{username:admin,password:pass123}"
Attempts:
3 left
💡 Hint
Common Mistakes
Not escaping quotes inside the JSON string.
Using JSON format for description instead of plain text.
5fill in blank
hard

Fill all three blanks to tag a secret with environment and project tags.

AWS
aws secretsmanager tag-resource --secret-id MySecret --tags Key=[1],Value=[2] Key=[3],Value=ProjectX
Drag options to blanks, or click blank then click option'
A"Environment"
B"Production"
C"Env"
D"Prod"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or inconsistent tag keys.
Not quoting tag keys and values properly.