Bird
0
0

Which of the following is the correct way to define a resource in AWS CloudFormation?

easy📝 Configuration Q12 of 15
AWS - CloudFormation
Which of the following is the correct way to define a resource in AWS CloudFormation?
A<code>resource "aws_ec2_instance" "web" {}</code>
B<code>resource "aws_instance" "web" {}</code>
C<code>AWS::EC2::Instance:</code>
D<code>resource "ec2_instance" "web" {}</code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify CloudFormation syntax

    CloudFormation uses YAML or JSON with resource types like 'AWS::EC2::Instance'.
  2. Step 2: Recognize Terraform syntax

    Terraform uses 'resource "aws_instance" "name" {}'.
  3. Final Answer:

    CloudFormation resource types use 'AWS::Service::Resource' format. -> Option C
  4. Quick Check:

    CloudFormation uses AWS:: notation [OK]
Quick Trick: CloudFormation uses AWS::Service::Resource format [OK]
Common Mistakes:
  • Confusing Terraform resource syntax with CloudFormation
  • Using Terraform resource blocks in CloudFormation
  • Misnaming resource types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes