Resource: aws_vpclattice_auth_policy

Terraform resource for managing an AWS VPC Lattice Auth Policy.

Example Usage

Basic Usage

resource "aws_vpclattice_service" "example" {
  name               = "example-vpclattice-service"
  auth_type          = "AWS_IAM"
  custom_domain_name = "example.com"
}

resource "aws_vpclattice_auth_policy" "example" {
  resource_identifier = aws_vpclattice_service.example.arn
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Action    = "*"
        Effect    = "Allow"
        Principal = "*"
        Resource  = "*"
        Condition = {
          StringNotEqualsIgnoreCase = {
            "aws:PrincipalType" = "anonymous"
          }
        }
      }
    ]
  })
}

Argument Reference

The following arguments are required:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import VPC Lattice Auth Policy using the id. For example:

import {
  to = aws_vpclattice_auth_policy.example
  id = "abcd-12345678"
}

Using terraform import, import VPC Lattice Auth Policy using the id. For example:

% terraform import aws_vpclattice_auth_policy.example abcd-12345678