1. Google Cloud Documentation - VPC firewall rules overview: Under the "Components of a firewall rule" section
it states that a rule's target can be specified using "Target tags
" which applies the rule to instances with a matching network tag. The "Direction of traffic" component must be set to ingress for incoming connections.
Source: Google Cloud
"VPC firewall rules overview"
cloud.google.com/vpc/docs/firewalls#components.
2. Google Cloud Documentation - Using VPC firewall rules: This page provides examples of creating firewall rules. The common pattern shown is to define a rule with a direction (INGRESS)
a target (using targetTags)
a source filter
and a protocol/port specification. This directly aligns with the procedure described in the correct answer.
Source: Google Cloud
"Using VPC firewall rules"
cloud.google.com/vpc/docs/using-firewalls#creatingfirewallrules.
3. Google Cloud Documentation - Network tags overview: "Tags are useful for applying firewall rules... You make a firewall rule applicable to specific instances by using target tags." This reference clarifies that the primary purpose of tags in this context is to be used as targets for firewall rules
invalidating the option that suggests using a tag alone is sufficient.
Source: Google Cloud
"Configure network tags"
cloud.google.com/vpc/docs/add-remove-network-tags.