Skip to main content
Providers

S3Bucket

A resource of the AWS provider, version 0.3.0, in its Storage group. Import it with:

import S3Bucket from "aws/storage"

Example

resource S3Bucket example {
    bucket                       = "example-value"
    acl                          = "private"
    versioning                   = false
    region                       = "example-value"
    serverSideEncryption         = "AES256"
    kmsKeyId                     = "example-value"
    blockPublicAccess            = true
    websiteIndexDocument         = "example-value"
    websiteErrorDocument         = "example-value"
    websiteRedirectAllRequestsTo = "example-value"
    corsRules                    = "..."
    lifecycleRules               = "..."
    logging                      = "..."
    tags                         = "..."
}

Properties

Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.

NameTypeDefaultRequiredDescription
bucketstring—NoBucket name (globally unique, DNS-compliant)
aclstring"private"NoCanned ACL for the bucket Allowed: "private", "public-read", "public-read-write", "authenticated-read"
versioningbooleanfalseNoEnable versioning for the bucket
regionstring—NoAWS region for the bucket
serverSideEncryptionstring—NoServer-side encryption algorithm Allowed: "AES256", "aws:kms"
kmsKeyIdstring—NoKMS key ID for encryption (when using aws:kms)
blockPublicAccessbooleantrueNoBlock all public access
websiteIndexDocumentstring—NoIndex document for static website hosting
websiteErrorDocumentstring—NoError document for static website hosting
websiteRedirectAllRequestsTostring—NoRedirect all requests to another host
corsRulesany[]—NoCORS configuration rules
lifecycleRulesany[]—NoLifecycle rules for object management
loggingany—NoAccess logging configuration
tagsobject—NoTags to apply to the bucket

Set by AWS after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.

NameTypeImportableDescription
arnstringYesThe ARN of the bucket
domainNamestringNoThe domain name of the bucket
regionalDomainNamestringNoThe regional domain name of the bucket
websiteEndpointstringNoWebsite endpoint (if hosting enabled)
creationDatestringNoThe creation date of the bucket

On this page