Resource: aws_s3_access_point

Provides a resource to manage an S3 Access Point.

Example Usage

AWS Partition General Purpose Bucket

resource "aws_s3_bucket" "example" {
  bucket = "example"
}

resource "aws_s3_access_point" "example" {
  bucket = aws_s3_bucket.example.id
  name   = "example"
}

S3 on Outposts Bucket

resource "aws_s3control_bucket" "example" {
  bucket = "example"
}

resource "aws_s3_access_point" "example" {
  bucket = aws_s3control_bucket.example.arn
  name   = "example"

  # VPC must be specified for S3 on Outposts
  vpc_configuration {
    vpc_id = aws_vpc.example.id
  }
}

resource "aws_vpc" "example" {
  cidr_block = "10.0.0.0/16"
}

Argument Reference

The following arguments are required:

The following arguments are optional:

public_access_block_configuration Configuration Block

The following arguments are optional:

vpc_configuration Configuration Block

The following arguments are required:

Attribute Reference

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

Import

In Terraform v1.5.0 and later, use an import block to import this resource using the account_id and name separated by a colon (:) for Access Points associated with an AWS Partition S3 Bucket or the ARN for Access Points associated with an S3 on Outposts Bucket. For example:

Import using the account_id and name separated by a colon (:) for Access Points associated with an AWS Partition S3 Bucket:

import {
  to = aws_s3_access_point.example
  id = "123456789012:example"
}

Import using the ARN for Access Points associated with an S3 on Outposts Bucket:

import {
  to = aws_s3_access_point.example
  id = "arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-1234567890123456/accesspoint/example"
}

Using terraform import to import. For example:

Import using the account_id and name separated by a colon (:) for Access Points associated with an AWS Partition S3 Bucket:

% terraform import aws_s3_access_point.example 123456789012:example

Import using the ARN for Access Points associated with an S3 on Outposts Bucket:

% terraform import aws_s3_access_point.example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-1234567890123456/accesspoint/example