Difference between revisions of "Terraform data source: data"

From wikieduonline
Jump to navigation Jump to search
Line 7: Line 7:
 
* [[Data sources]]: <code>[[Data sources: template file|template_file]]</code>, <code>[[template]]</code>
 
* [[Data sources]]: <code>[[Data sources: template file|template_file]]</code>, <code>[[template]]</code>
 
* <code>data</code> [[Terraform blocks|block]]
 
* <code>data</code> [[Terraform blocks|block]]
 
==Example==
 
 
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: