What is a resource block and how is it addressed?
BeginnerConceptProviders, Resources and Data Sources
Answer
A resource block declares one infrastructure object. The first label is the type (provider prefix plus kind), the second a local name; together they form the address aws_instance.web.
resource "aws_instance" "web" {
ami = data.aws_ami.al2023.id
instance_type = "t3.micro"
}
More on Providers, Resources and Data Sources
What is the difference between a resource and a data source?BeginnerHow do you configure a provider such as AWS?BeginnerHow do you use the same provider with multiple regions or accounts?IntermediateIn what order does the AWS provider look for credentials?IntermediateWhat does `default_tags` in the AWS provider do and what are its pitfalls?IntermediateWhat is the difference between arguments and attributes?Beginner