Resource: aws_quicksight_vpc_connection

Terraform resource for managing an AWS QuickSight VPC Connection.

Example Usage

Basic Usage

resource "aws_iam_role" "vpc_connection_role" {
  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Effect = "Allow"
        Action = "sts:AssumeRole"
        Principal = {
          Service = "quicksight.amazonaws.com"
        }
      }
    ]
  })
  inline_policy {
    name = "QuickSightVPCConnectionRolePolicy"
    policy = jsonencode({
      Version = "2012-10-17"
      Statement = [
        {
          Effect = "Allow"
          Action = [
            "ec2:CreateNetworkInterface",
            "ec2:ModifyNetworkInterfaceAttribute",
            "ec2:DeleteNetworkInterface",
            "ec2:DescribeSubnets",
            "ec2:DescribeSecurityGroups"
          ]
          Resource = ["*"]
        }
      ]
    })
  }
}

resource "aws_quicksight_vpc_connection" "example" {
  vpc_connection_id  = "example-connection-id"
  name               = "Example Connection"
  role_arn           = aws_iam_role.vpc_connection_role.arn
  security_group_ids = ["sg-00000000000000000"]
  subnet_ids = [
    "subnet-00000000000000000",
    "subnet-00000000000000001",
  ]
}

Argument Reference

The following arguments are required:

The following arguments are optional:

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 QuickSight VPC connection using the AWS account ID and VPC connection ID separated by commas (,). For example:

import {
  to = aws_quicksight_vpc_connection.example
  id = "123456789012,example"
}

Using terraform import, import QuickSight VPC connection using the AWS account ID and VPC connection ID separated by commas (,). For example:

% terraform import aws_quicksight_vpc_connection.example 123456789012,example