Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to force replacement of a resource named 'aws_instance.example'.
Terraform
terraform apply [1]aws_instance.example Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-destroy' instead of '-replace'.
Forgetting to specify the resource name after the flag.
✗ Incorrect
The '-replace' flag tells Terraform to destroy and recreate the specified resource during apply.
2fill in blank
mediumComplete the command to replace two resources: 'aws_instance.web' and 'aws_s3_bucket.data'.
Terraform
terraform apply [1]aws_instance.web [2]aws_s3_bucket.data
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using only one '-replace' flag for multiple resources.
Omitting the equals sign '=' after '-replace'.
✗ Incorrect
The '-replace=' flag is repeated for each resource to be replaced during apply.
3fill in blank
hardFix the error in this command to replace the resource 'aws_db_instance.main'.
Terraform
terraform apply [1]aws_db_instance.main Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Missing '=' after '-replace'.
Using '-replace' without specifying the resource.
✗ Incorrect
The '-replace' flag requires an equals sign before the resource name, like '-replace=resource'.
4fill in blank
hardFill both blanks to correctly replace 'aws_lambda_function.func' and approve automatically.
Terraform
terraform apply [1]aws_lambda_function.func [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting '-auto-approve' causes Terraform to wait for confirmation.
Missing '=' after '-replace' causes syntax errors.
✗ Incorrect
Use '-replace=' to specify the resource and '-auto-approve' to skip confirmation.
5fill in blank
hardFill all three blanks to replace 'aws_security_group.sg', refresh state, and auto-approve.
Terraform
terraform apply [1]aws_security_group.sg [2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-destroy' instead of '-replace'.
Omitting '-auto-approve' causes manual confirmation.
Missing '=' after '-replace'.
✗ Incorrect
Use '-replace=' to replace the resource, '-refresh' to update state, and '-auto-approve' to skip confirmation.