Difference between revisions of "Terraform AWS data sources"

From wikieduonline
Jump to navigation Jump to search
Line 8: Line 8:
 
* <code>[[Terraform data source: aws_vpc|aws_vpc]]</code>
 
* <code>[[Terraform data source: aws_vpc|aws_vpc]]</code>
 
* <code>[[Terraform data source: aws_region|aws_region]]</code>
 
* <code>[[Terraform data source: aws_region|aws_region]]</code>
 +
 +
== Examples ==
 +
 +
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami
 +
[[data]] "[[aws_ami]]" "myexample" {
 +
  most_recent = true
 +
 +
  owners = ["self"]
 +
  tags = {
 +
    Name  = "app-server"
 +
    Tested = "true"
 +
  }
 +
}
 +
 +
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc
 +
data "[[aws_vpc]]" "selected" {
 +
  id = var.[[my_vpc_id]]
 +
}
 +
 +
data "[[template_file]]" "my-secret" {
 +
  template = [[aws_iam_access_key]].my_new_user.encrypted_secret
 +
}
 +
  
 
== Related terms ==
 
== Related terms ==

Revision as of 13:52, 31 January 2023

Advertising: