Difference between revisions of "Data."

From wikieduonline
Jump to navigation Jump to search
Line 29: Line 29:
 
  resource "[[aws_s3_bucket_policy]]" "allow_access_from_another_account" {
 
  resource "[[aws_s3_bucket_policy]]" "allow_access_from_another_account" {
 
   bucket = aws_s3_bucket.example.id
 
   bucket = aws_s3_bucket.example.id
   policy = [[data.]]aws_iam_policy_document.allow_access_from_another_account.json
+
   [[policy]] = [[data.]]aws_iam_policy_document.allow_access_from_another_account.json
 
  }
 
  }
  

Revision as of 05:57, 13 March 2023

Terraform Data source


identity_store_id = tolist(data.aws_ssoadmin_instances.example.identity_store_ids)[0]


data.aws_caller_identity
data.aws_availability_zones.available.names


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)
}


Example

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
}

See also

Advertising: