Difference between revisions of "Data."

From wikieduonline
Jump to navigation Jump to search
Line 54: Line 54:
 
== Errors ==
 
== Errors ==
 
* [[Error: Error in function call]]
 
* [[Error: Error in function call]]
 +
 +
== Related ==
 +
* [[each.]]
  
 
== See also ==
 
== See also ==

Revision as of 07:21, 3 April 2023

Terraform Data source



data.aws_caller_identity
data.aws_availability_zones.available.names
data.aws_subnets


provider "kubernetes" {
 host                   = data.aws_eks_cluster.cluster.endpoint
 token                  = data.aws_eks_cluster_auth.cluster.token
 cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
}


Examples

resource "aws_s3_bucket" "example" {
  bucket = "my-tf-test-bucket"
}

resource "aws_s3_bucket_policy" "allow_access_from_another_account" {
  bucket = aws_s3_bucket.example.id
  policy = data.aws_iam_policy_document.allow_access_from_another_account.json
}

aws_ami

data "aws_ami" "ubuntu" {
 most_recent = true

 filter {
   name   = "name"
   values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
 }

 filter {
   name   = "virtualization-type"
   values = ["hvm"]
 }

 owners = ["099720109477"] # Canonical
}


Errors

Related

See also

Advertising: