1. Packages
  2. AWS
  3. API Docs
  4. macie
  5. S3BucketAssociation
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi
aws logo
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi

    NOTE: This resource interacts with Amazon Macie Classic. Macie Classic cannot be activated in new accounts. See the FAQ for more details.

    Associates an S3 resource with Amazon Macie for monitoring and data classification.

    NOTE: Before using Amazon Macie for the first time it must be enabled manually. Instructions are here.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Macie.S3BucketAssociation("example", new()
        {
            BucketName = "tf-macie-example",
            ClassificationType = new Aws.Macie.Inputs.S3BucketAssociationClassificationTypeArgs
            {
                OneTime = "FULL",
            },
            Prefix = "data",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/macie"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := macie.NewS3BucketAssociation(ctx, "example", &macie.S3BucketAssociationArgs{
    			BucketName: pulumi.String("tf-macie-example"),
    			ClassificationType: &macie.S3BucketAssociationClassificationTypeArgs{
    				OneTime: pulumi.String("FULL"),
    			},
    			Prefix: pulumi.String("data"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.macie.S3BucketAssociation;
    import com.pulumi.aws.macie.S3BucketAssociationArgs;
    import com.pulumi.aws.macie.inputs.S3BucketAssociationClassificationTypeArgs;
    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) {
            var example = new S3BucketAssociation("example", S3BucketAssociationArgs.builder()        
                .bucketName("tf-macie-example")
                .classificationType(S3BucketAssociationClassificationTypeArgs.builder()
                    .oneTime("FULL")
                    .build())
                .prefix("data")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.macie.S3BucketAssociation("example", {
        bucketName: "tf-macie-example",
        classificationType: {
            oneTime: "FULL",
        },
        prefix: "data",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.macie.S3BucketAssociation("example",
        bucket_name="tf-macie-example",
        classification_type=aws.macie.S3BucketAssociationClassificationTypeArgs(
            one_time="FULL",
        ),
        prefix="data")
    
    resources:
      example:
        type: aws:macie:S3BucketAssociation
        properties:
          bucketName: tf-macie-example
          classificationType:
            oneTime: FULL
          prefix: data
    

    Create S3BucketAssociation Resource

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

    Constructor syntax

    new S3BucketAssociation(name: string, args: S3BucketAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def S3BucketAssociation(resource_name: str,
                            args: S3BucketAssociationArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def S3BucketAssociation(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            bucket_name: Optional[str] = None,
                            classification_type: Optional[S3BucketAssociationClassificationTypeArgs] = None,
                            member_account_id: Optional[str] = None,
                            prefix: Optional[str] = None)
    func NewS3BucketAssociation(ctx *Context, name string, args S3BucketAssociationArgs, opts ...ResourceOption) (*S3BucketAssociation, error)
    public S3BucketAssociation(string name, S3BucketAssociationArgs args, CustomResourceOptions? opts = null)
    public S3BucketAssociation(String name, S3BucketAssociationArgs args)
    public S3BucketAssociation(String name, S3BucketAssociationArgs args, CustomResourceOptions options)
    
    type: aws:macie:S3BucketAssociation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args S3BucketAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args S3BucketAssociationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args S3BucketAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args S3BucketAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args S3BucketAssociationArgs
    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 s3bucketAssociationResource = new Aws.Macie.S3BucketAssociation("s3bucketAssociationResource", new()
    {
        BucketName = "string",
        ClassificationType = new Aws.Macie.Inputs.S3BucketAssociationClassificationTypeArgs
        {
            Continuous = "string",
            OneTime = "string",
        },
        MemberAccountId = "string",
        Prefix = "string",
    });
    
    example, err := macie.NewS3BucketAssociation(ctx, "s3bucketAssociationResource", &macie.S3BucketAssociationArgs{
    	BucketName: pulumi.String("string"),
    	ClassificationType: &macie.S3BucketAssociationClassificationTypeArgs{
    		Continuous: pulumi.String("string"),
    		OneTime:    pulumi.String("string"),
    	},
    	MemberAccountId: pulumi.String("string"),
    	Prefix:          pulumi.String("string"),
    })
    
    var s3bucketAssociationResource = new S3BucketAssociation("s3bucketAssociationResource", S3BucketAssociationArgs.builder()
        .bucketName("string")
        .classificationType(S3BucketAssociationClassificationTypeArgs.builder()
            .continuous("string")
            .oneTime("string")
            .build())
        .memberAccountId("string")
        .prefix("string")
        .build());
    
    s3bucket_association_resource = aws.macie.S3BucketAssociation("s3bucketAssociationResource",
        bucket_name="string",
        classification_type={
            "continuous": "string",
            "one_time": "string",
        },
        member_account_id="string",
        prefix="string")
    
    const s3bucketAssociationResource = new aws.macie.S3BucketAssociation("s3bucketAssociationResource", {
        bucketName: "string",
        classificationType: {
            continuous: "string",
            oneTime: "string",
        },
        memberAccountId: "string",
        prefix: "string",
    });
    
    type: aws:macie:S3BucketAssociation
    properties:
        bucketName: string
        classificationType:
            continuous: string
            oneTime: string
        memberAccountId: string
        prefix: string
    

    S3BucketAssociation 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 S3BucketAssociation resource accepts the following input properties:

    BucketName string
    The name of the S3 bucket that you want to associate with Amazon Macie.
    ClassificationType S3BucketAssociationClassificationType
    The configuration of how Amazon Macie classifies the S3 objects.
    MemberAccountId string
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    Prefix string
    Object key prefix identifying one or more S3 objects to which the association applies.
    BucketName string
    The name of the S3 bucket that you want to associate with Amazon Macie.
    ClassificationType S3BucketAssociationClassificationTypeArgs
    The configuration of how Amazon Macie classifies the S3 objects.
    MemberAccountId string
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    Prefix string
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucketName String
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classificationType S3BucketAssociationClassificationType
    The configuration of how Amazon Macie classifies the S3 objects.
    memberAccountId String
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix String
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucketName string
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classificationType S3BucketAssociationClassificationType
    The configuration of how Amazon Macie classifies the S3 objects.
    memberAccountId string
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix string
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucket_name str
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classification_type S3BucketAssociationClassificationTypeArgs
    The configuration of how Amazon Macie classifies the S3 objects.
    member_account_id str
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix str
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucketName String
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classificationType Property Map
    The configuration of how Amazon Macie classifies the S3 objects.
    memberAccountId String
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix String
    Object key prefix identifying one or more S3 objects to which the association applies.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the S3BucketAssociation 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 S3BucketAssociation Resource

    Get an existing S3BucketAssociation 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?: S3BucketAssociationState, opts?: CustomResourceOptions): S3BucketAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket_name: Optional[str] = None,
            classification_type: Optional[S3BucketAssociationClassificationTypeArgs] = None,
            member_account_id: Optional[str] = None,
            prefix: Optional[str] = None) -> S3BucketAssociation
    func GetS3BucketAssociation(ctx *Context, name string, id IDInput, state *S3BucketAssociationState, opts ...ResourceOption) (*S3BucketAssociation, error)
    public static S3BucketAssociation Get(string name, Input<string> id, S3BucketAssociationState? state, CustomResourceOptions? opts = null)
    public static S3BucketAssociation get(String name, Output<String> id, S3BucketAssociationState state, CustomResourceOptions options)
    resources:  _:    type: aws:macie:S3BucketAssociation    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    BucketName string
    The name of the S3 bucket that you want to associate with Amazon Macie.
    ClassificationType S3BucketAssociationClassificationType
    The configuration of how Amazon Macie classifies the S3 objects.
    MemberAccountId string
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    Prefix string
    Object key prefix identifying one or more S3 objects to which the association applies.
    BucketName string
    The name of the S3 bucket that you want to associate with Amazon Macie.
    ClassificationType S3BucketAssociationClassificationTypeArgs
    The configuration of how Amazon Macie classifies the S3 objects.
    MemberAccountId string
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    Prefix string
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucketName String
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classificationType S3BucketAssociationClassificationType
    The configuration of how Amazon Macie classifies the S3 objects.
    memberAccountId String
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix String
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucketName string
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classificationType S3BucketAssociationClassificationType
    The configuration of how Amazon Macie classifies the S3 objects.
    memberAccountId string
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix string
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucket_name str
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classification_type S3BucketAssociationClassificationTypeArgs
    The configuration of how Amazon Macie classifies the S3 objects.
    member_account_id str
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix str
    Object key prefix identifying one or more S3 objects to which the association applies.
    bucketName String
    The name of the S3 bucket that you want to associate with Amazon Macie.
    classificationType Property Map
    The configuration of how Amazon Macie classifies the S3 objects.
    memberAccountId String
    The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If member_account_id isn't specified, the action associates specified S3 resources with Macie for the current master account.
    prefix String
    Object key prefix identifying one or more S3 objects to which the association applies.

    Supporting Types

    S3BucketAssociationClassificationType, S3BucketAssociationClassificationTypeArgs

    Continuous string
    A string value indicating that Macie perform a one-time classification of all of the existing objects in the bucket. The only valid value is the default value, FULL.
    OneTime string
    A string value indicating whether or not Macie performs a one-time classification of all of the existing objects in the bucket. Valid values are NONE and FULL. Defaults to NONE indicating that Macie only classifies objects that are added after the association was created.
    Continuous string
    A string value indicating that Macie perform a one-time classification of all of the existing objects in the bucket. The only valid value is the default value, FULL.
    OneTime string
    A string value indicating whether or not Macie performs a one-time classification of all of the existing objects in the bucket. Valid values are NONE and FULL. Defaults to NONE indicating that Macie only classifies objects that are added after the association was created.
    continuous String
    A string value indicating that Macie perform a one-time classification of all of the existing objects in the bucket. The only valid value is the default value, FULL.
    oneTime String
    A string value indicating whether or not Macie performs a one-time classification of all of the existing objects in the bucket. Valid values are NONE and FULL. Defaults to NONE indicating that Macie only classifies objects that are added after the association was created.
    continuous string
    A string value indicating that Macie perform a one-time classification of all of the existing objects in the bucket. The only valid value is the default value, FULL.
    oneTime string
    A string value indicating whether or not Macie performs a one-time classification of all of the existing objects in the bucket. Valid values are NONE and FULL. Defaults to NONE indicating that Macie only classifies objects that are added after the association was created.
    continuous str
    A string value indicating that Macie perform a one-time classification of all of the existing objects in the bucket. The only valid value is the default value, FULL.
    one_time str
    A string value indicating whether or not Macie performs a one-time classification of all of the existing objects in the bucket. Valid values are NONE and FULL. Defaults to NONE indicating that Macie only classifies objects that are added after the association was created.
    continuous String
    A string value indicating that Macie perform a one-time classification of all of the existing objects in the bucket. The only valid value is the default value, FULL.
    oneTime String
    A string value indicating whether or not Macie performs a one-time classification of all of the existing objects in the bucket. Valid values are NONE and FULL. Defaults to NONE indicating that Macie only classifies objects that are added after the association was created.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v5.43.0 (Older version)
    published on Tuesday, Mar 10, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.