1. Packages
  2. AWS
  3. API Docs
  4. s3tables
  5. TableBucketPolicy
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.s3tables.TableBucketPolicy

Explore with Pulumi AI

Resource for managing an Amazon S3 Tables Table Bucket Policy.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.iam.getPolicyDocument({
    statements: [{}],
});
const exampleTableBucketPolicy = new aws.s3tables.TableBucketPolicy("example", {
    resourcePolicy: example.then(example => example.json),
    tableBucketArn: exampleAwsS3tablesTableBucket.arn,
});
const test = new aws.s3tables.TableBucket("test", {name: "example-bucket"});
Copy
import pulumi
import pulumi_aws as aws

example = aws.iam.get_policy_document(statements=[{}])
example_table_bucket_policy = aws.s3tables.TableBucketPolicy("example",
    resource_policy=example.json,
    table_bucket_arn=example_aws_s3tables_table_bucket["arn"])
test = aws.s3tables.TableBucket("test", name="example-bucket")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3tables"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = s3tables.NewTableBucketPolicy(ctx, "example", &s3tables.TableBucketPolicyArgs{
			ResourcePolicy: pulumi.String(example.Json),
			TableBucketArn: pulumi.Any(exampleAwsS3tablesTableBucket.Arn),
		})
		if err != nil {
			return err
		}
		_, err = s3tables.NewTableBucket(ctx, "test", &s3tables.TableBucketArgs{
			Name: pulumi.String("example-bucket"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            null,
        },
    });

    var exampleTableBucketPolicy = new Aws.S3Tables.TableBucketPolicy("example", new()
    {
        ResourcePolicy = example.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
        TableBucketArn = exampleAwsS3tablesTableBucket.Arn,
    });

    var test = new Aws.S3Tables.TableBucket("test", new()
    {
        Name = "example-bucket",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.s3tables.TableBucketPolicy;
import com.pulumi.aws.s3tables.TableBucketPolicyArgs;
import com.pulumi.aws.s3tables.TableBucket;
import com.pulumi.aws.s3tables.TableBucketArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .build())
            .build());

        var exampleTableBucketPolicy = new TableBucketPolicy("exampleTableBucketPolicy", TableBucketPolicyArgs.builder()
            .resourcePolicy(example.json())
            .tableBucketArn(exampleAwsS3tablesTableBucket.arn())
            .build());

        var test = new TableBucket("test", TableBucketArgs.builder()
            .name("example-bucket")
            .build());

    }
}
Copy
resources:
  exampleTableBucketPolicy:
    type: aws:s3tables:TableBucketPolicy
    name: example
    properties:
      resourcePolicy: ${example.json}
      tableBucketArn: ${exampleAwsS3tablesTableBucket.arn}
  test:
    type: aws:s3tables:TableBucket
    properties:
      name: example-bucket
variables:
  example:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - {}
Copy

Create TableBucketPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TableBucketPolicy(name: string, args: TableBucketPolicyArgs, opts?: CustomResourceOptions);
@overload
def TableBucketPolicy(resource_name: str,
                      args: TableBucketPolicyArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def TableBucketPolicy(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      resource_policy: Optional[str] = None,
                      table_bucket_arn: Optional[str] = None)
func NewTableBucketPolicy(ctx *Context, name string, args TableBucketPolicyArgs, opts ...ResourceOption) (*TableBucketPolicy, error)
public TableBucketPolicy(string name, TableBucketPolicyArgs args, CustomResourceOptions? opts = null)
public TableBucketPolicy(String name, TableBucketPolicyArgs args)
public TableBucketPolicy(String name, TableBucketPolicyArgs args, CustomResourceOptions options)
type: aws:s3tables:TableBucketPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TableBucketPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TableBucketPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TableBucketPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TableBucketPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TableBucketPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var tableBucketPolicyResource = new Aws.S3Tables.TableBucketPolicy("tableBucketPolicyResource", new()
{
    ResourcePolicy = "string",
    TableBucketArn = "string",
});
Copy
example, err := s3tables.NewTableBucketPolicy(ctx, "tableBucketPolicyResource", &s3tables.TableBucketPolicyArgs{
	ResourcePolicy: pulumi.String("string"),
	TableBucketArn: pulumi.String("string"),
})
Copy
var tableBucketPolicyResource = new TableBucketPolicy("tableBucketPolicyResource", TableBucketPolicyArgs.builder()
    .resourcePolicy("string")
    .tableBucketArn("string")
    .build());
Copy
table_bucket_policy_resource = aws.s3tables.TableBucketPolicy("tableBucketPolicyResource",
    resource_policy="string",
    table_bucket_arn="string")
Copy
const tableBucketPolicyResource = new aws.s3tables.TableBucketPolicy("tableBucketPolicyResource", {
    resourcePolicy: "string",
    tableBucketArn: "string",
});
Copy
type: aws:s3tables:TableBucketPolicy
properties:
    resourcePolicy: string
    tableBucketArn: string
Copy

TableBucketPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TableBucketPolicy resource accepts the following input properties:

ResourcePolicy This property is required. string
Amazon Web Services resource-based policy document in JSON format.
TableBucketArn This property is required. string
ARN referencing the Table Bucket that owns this policy.
ResourcePolicy This property is required. string
Amazon Web Services resource-based policy document in JSON format.
TableBucketArn This property is required. string
ARN referencing the Table Bucket that owns this policy.
resourcePolicy This property is required. String
Amazon Web Services resource-based policy document in JSON format.
tableBucketArn This property is required. String
ARN referencing the Table Bucket that owns this policy.
resourcePolicy This property is required. string
Amazon Web Services resource-based policy document in JSON format.
tableBucketArn This property is required. string
ARN referencing the Table Bucket that owns this policy.
resource_policy This property is required. str
Amazon Web Services resource-based policy document in JSON format.
table_bucket_arn This property is required. str
ARN referencing the Table Bucket that owns this policy.
resourcePolicy This property is required. String
Amazon Web Services resource-based policy document in JSON format.
tableBucketArn This property is required. String
ARN referencing the Table Bucket that owns this policy.

Outputs

All input properties are implicitly available as output properties. Additionally, the TableBucketPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TableBucketPolicy Resource

Get an existing TableBucketPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TableBucketPolicyState, opts?: CustomResourceOptions): TableBucketPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        resource_policy: Optional[str] = None,
        table_bucket_arn: Optional[str] = None) -> TableBucketPolicy
func GetTableBucketPolicy(ctx *Context, name string, id IDInput, state *TableBucketPolicyState, opts ...ResourceOption) (*TableBucketPolicy, error)
public static TableBucketPolicy Get(string name, Input<string> id, TableBucketPolicyState? state, CustomResourceOptions? opts = null)
public static TableBucketPolicy get(String name, Output<String> id, TableBucketPolicyState state, CustomResourceOptions options)
resources:  _:    type: aws:s3tables:TableBucketPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ResourcePolicy string
Amazon Web Services resource-based policy document in JSON format.
TableBucketArn string
ARN referencing the Table Bucket that owns this policy.
ResourcePolicy string
Amazon Web Services resource-based policy document in JSON format.
TableBucketArn string
ARN referencing the Table Bucket that owns this policy.
resourcePolicy String
Amazon Web Services resource-based policy document in JSON format.
tableBucketArn String
ARN referencing the Table Bucket that owns this policy.
resourcePolicy string
Amazon Web Services resource-based policy document in JSON format.
tableBucketArn string
ARN referencing the Table Bucket that owns this policy.
resource_policy str
Amazon Web Services resource-based policy document in JSON format.
table_bucket_arn str
ARN referencing the Table Bucket that owns this policy.
resourcePolicy String
Amazon Web Services resource-based policy document in JSON format.
tableBucketArn String
ARN referencing the Table Bucket that owns this policy.

Import

Using pulumi import, import S3 Tables Table Bucket Policy using the table_bucket_arn. For example:

$ pulumi import aws:s3tables/tableBucketPolicy:TableBucketPolicy example 'arn:aws:s3tables:us-west-2:123456789012:bucket/example-bucket;example-namespace'
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.