AWS::S3Outposts::Bucket - AWS CloudFormation

AWS::S3Outposts::Bucket

The AWS::S3Outposts::Bucket resource specifies a new Amazon S3 on Outposts bucket. To create an S3 on Outposts bucket, you must have S3 on Outposts capacity provisioned on your Outpost. For more information, see Using Amazon S3 on Outposts.

S3 on Outposts buckets support the following:

  • Tags

  • Lifecycle configuration rules for deleting expired objects

For a complete list of restrictions and Amazon S3 feature limitations on S3 on Outposts, see Amazon S3 on Outposts Restrictions and Limitations.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::S3Outposts::Bucket", "Properties" : { "BucketName" : String, "LifecycleConfiguration" : LifecycleConfiguration, "OutpostId" : String, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::S3Outposts::Bucket Properties: BucketName: String LifecycleConfiguration: LifecycleConfiguration OutpostId: String Tags: - Tag

Properties

BucketName

A name for the S3 on Outposts bucket. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and must follow Amazon S3 bucket restrictions and limitations. For more information, see Bucket naming rules.

Important

If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.

Required: Yes

Type: String

Update requires: Replacement

LifecycleConfiguration

Creates a new lifecycle configuration for the S3 on Outposts bucket or replaces an existing lifecycle configuration. Outposts buckets only support lifecycle configurations that delete/expire objects after a certain period of time and abort incomplete multipart uploads.

Required: No

Type: LifecycleConfiguration

Update requires: No interruption

OutpostId

The ID of the Outpost of the specified bucket.

Required: Yes

Type: String

Update requires: Replacement

Tags

Sets the tags for an S3 on Outposts bucket. For more information, see Using Amazon S3 on Outposts.

Use tags to organize your AWS bill to reflect your own cost structure. To do this, sign up to get your AWS account bill with tag key values included. Then, to see the cost of combined resources, organize your billing information according to resources with the same tag key values. For example, you can tag several resources with a specific application name, and then organize your billing information to see the total cost of that application across several services. For more information, see Cost allocation and tags.

Note

Within a bucket, if you add a tag that has the same key as an existing tag, the new value overwrites the old value. For more information, see Using cost allocation and bucket tags.

To use this resource, you must have permissions to perform the s3-outposts:PutBucketTagging. The S3 on Outposts bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing access permissions to your Amazon S3 resources.

Required: No

Type: List of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the S3 on Outposts bucket Amazon Resource Name (ARN).

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

Returns the ARN of the specified bucket.

Example: arn:aws:s3Outposts:::DOC-EXAMPLE-BUCKET

Examples

The following examples creates an Amazon S3 on Outposts bucket using AWS CloudFormation

Create an S3 on Outposts bucket

The following example creates an S3 on Outposts bucket without tags or lifecycle configuration.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Bucket, no tags, no lifecycle configuration", "Resources": { "ExampleS3OutpostsBucket": { "Type": "AWS::S3Outposts::Bucket", "Properties": { "BucketName": "DOC-EXAMPLE-BUCKET", "OutpostID": "op-01ac5d28a6a232904" } } }, "Outputs": { "ExampleS3OutpostsBucketARN": { "Description": "The ARN of ExampleS3OutpostsBucket", "Value": { "Ref": "ExampleS3OutpostsBucket" } }, "ExampleS3OutpostsStackID": { "Description": "The Stack ID", "Value": { "Ref": "AWS::StackID" }, "Export": { "Name": { "Fn::Sub": "${AWS::StackName}-StackID" } } } } }

YAML

AWSTemplateFormatVersion: '2010-09-09' Description: Bucket, no tags, no lifecycle configuration Resources: ExampleS3OutpostsBucket: Type: AWS::S3Outposts::Bucket Properties: BucketName: DOC-EXAMPLE-BUCKET OutpostID: op-01ac5d28a6a232904 Outputs: ExampleS3OutpostsBucketARN: Description: The ARN of ExampleS3OutpostsBucket Value: Ref: ExampleS3OutpostsBucket ExampleS3OutpostsStackID: Description: The Stack ID Value: Ref: AWS::StackID Export: Name: Fn::Sub: "${AWS::StackName}-StackID"

Creates an S3 on Outposts bucket with tags

The following example creates an S3 on Outposts bucket with tags and no lifecycle configuration.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Bucket, tags, no lifecycle configuration", "Resources": { "ExampleS3OutpostsBucket": { "Type": "AWS::S3Outposts::Bucket", "Properties": { "BucketName": "DOC-EXAMPLE-BUCKET", "OutpostID": "op-01ac5d28a6a232904", "Tags": [ { "Key": "stage", "Value": "beta" }, { "Key": "purpose", "Value": "testing" } ] } } }, "Outputs": { "ExampleS3OutpostsBucketARN": { "Description": "The ARN of ExampleS3OutpostsBucket", "Value": { "Ref": "ExampleS3OutpostsBucket" } }, "ExampleS3OutpostsStackID": { "Description": "The Stack ID", "Value": { "Ref": "AWS::StackID" }, "Export": { "Name": { "Fn::Sub": "${AWS::StackName}-StackID" } } } } }

YAML

AWSTemplateFormatVersion: '2010-09-09' Description: Bucket, tags, no lifecycle configuration Resources: ExampleS3OutpostsBucket: Type: AWS::S3Outposts::Bucket Properties: BucketName: DOC-EXAMPLE-BUCKET OutpostID: op-01ac5d28a6a232904 Tags: - Key: stage Value: beta - Key: purpose Value: testing Outputs: ExampleS3OutpostsBucketARN: Description: The ARN of ExampleS3OutpostsBucket Value: Ref: ExampleS3OutpostsBucket ExampleS3OutpostsStackID: Description: The Stack ID Value: Ref: AWS::StackID Export: Name: Fn::Sub: "${AWS::StackName}-StackID"

Creates an S3 on Outposts bucket with tags and lifecycle configuration

The following example creates an S3 on Outposts bucket with tags and four lifecycle configuration rules. Three of the four lifecycle rules are disabled.

Note

All lifecycle rules must have values for either ExpirationInDays, ExpirationDate, or DaysAfterInitiation for AbortIncompleteMultipartUpload to be valid.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Bucket, tags, lifecycle configuration", "Resources": { "ExampleS3OutpostsBucket": { "Type": "AWS::S3Outposts::Bucket", "Properties": { "BucketName": "DOC-EXAMPLE-BUCKET", "OutpostID": "op-01ac5d28a6a232904", "Tags": [ { "Key": "stage", "Value": "beta" }, { "Key": "purpose", "Value": "testing" } ], "LifecycleConfiguration": { "Rules": [ { "ExpirationInDays": 2, "ID": "rule1", "Status": "Enabled" }, { "AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 2 }, "ID": "rule2", "Status": "Disabled", "Filter": { "AndOperator": { "Prefix": "st", "Tags": [ { "Key": "purpose", "Value": "testing" } ] } } }, { "ExpirationDate": "2020-02-25T00:00:00Z", "ID": "rule3", "Status": "Disabled", "Filter": { "Tag": { "Key": "stage", "Value": "beta" } } }, { "ExpirationInDays": 4, "ID": "rule4", "Status": "Disabled", "Filter": { "Prefix": "st" } } ] } } } }, "Outputs": { "ExampleS3OutpostsBucketARN": { "Description": "The ARN of ExampleS3OutpostsBucket", "Value": { "Ref": "ExampleS3OutpostsBucket" } }, "ExampleStackID": { "Description": "The Stack ID", "Value": { "Ref": "AWS::StackID" }, "Export": { "Name": { "Fn::Sub": "${AWS::StackName}-StackID" } } } } }

YAML

--- AWSTemplateFormatVersion: '2010-09-09' Description: Bucket, tags, lifecycle configuration Resources: ExampleS3OutpostsBucket: Type: AWS::S3Outposts::Bucket Properties: BucketName: DOC-EXAMPLE-BUCKET OutpostID: op-01ac5d28a6a232904 Tags: - Key: stage Value: beta - Key: purpose Value: testing LifecycleConfiguration: Rules: - ExpirationInDays: 2 ID: rule1 Status: Enabled - AbortIncompleteMultipartUpload: DaysAfterInitiation: 2 ID: rule2 Status: Disabled Filter: AndOperator: Prefix: st Tags: - Key: purpose Value: testing - ExpirationDate: '2020-02-25T00:00:00Z' ID: rule3 Status: Disabled Filter: Tag: Key: stage Value: beta - ExpirationInDays: 4 ID: rule4 Status: Disabled Filter: Prefix: st Outputs: ExampleS3OutpostsBucketARN: Description: The ARN of ExampleS3OutpostsBucket Value: Ref: ExampleS3OutpostsBucket ExampleStackID: Description: The Stack ID Value: Ref: AWS::StackID Export: Name: Fn::Sub: "${AWS::StackName}-StackID"