Manages ABAC (Attribute Based Access Control) for an AWS S3 (Simple Storage) Bucket. See the AWS documentation on enabling ABAC for general purpose buckets for additional information.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.Bucket("example", {bucket: "bucket-name"});
const exampleBucketAbac = new aws.s3.BucketAbac("example", {
bucket: example.bucket,
abacStatus: {
status: "Enabled",
},
});
import pulumi
import pulumi_aws as aws
example = aws.s3.Bucket("example", bucket="bucket-name")
example_bucket_abac = aws.s3.BucketAbac("example",
bucket=example.bucket,
abac_status={
"status": "Enabled",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
Bucket: pulumi.String("bucket-name"),
})
if err != nil {
return err
}
_, err = s3.NewBucketAbac(ctx, "example", &s3.BucketAbacArgs{
Bucket: example.Bucket,
AbacStatus: &s3.BucketAbacAbacStatusArgs{
Status: pulumi.String("Enabled"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.S3.Bucket("example", new()
{
BucketName = "bucket-name",
});
var exampleBucketAbac = new Aws.S3.BucketAbac("example", new()
{
Bucket = example.BucketName,
AbacStatus = new Aws.S3.Inputs.BucketAbacAbacStatusArgs
{
Status = "Enabled",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.s3.BucketArgs;
import com.pulumi.aws.s3.BucketAbac;
import com.pulumi.aws.s3.BucketAbacArgs;
import com.pulumi.aws.s3.inputs.BucketAbacAbacStatusArgs;
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 Bucket("example", BucketArgs.builder()
.bucket("bucket-name")
.build());
var exampleBucketAbac = new BucketAbac("exampleBucketAbac", BucketAbacArgs.builder()
.bucket(example.bucket())
.abacStatus(BucketAbacAbacStatusArgs.builder()
.status("Enabled")
.build())
.build());
}
}
resources:
example:
type: aws:s3:Bucket
properties:
bucket: bucket-name
exampleBucketAbac:
type: aws:s3:BucketAbac
name: example
properties:
bucket: ${example.bucket}
abacStatus:
status: Enabled
Create BucketAbac Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BucketAbac(name: string, args: BucketAbacArgs, opts?: CustomResourceOptions);@overload
def BucketAbac(resource_name: str,
args: BucketAbacArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BucketAbac(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
abac_status: Optional[BucketAbacAbacStatusArgs] = None,
expected_bucket_owner: Optional[str] = None,
region: Optional[str] = None)func NewBucketAbac(ctx *Context, name string, args BucketAbacArgs, opts ...ResourceOption) (*BucketAbac, error)public BucketAbac(string name, BucketAbacArgs args, CustomResourceOptions? opts = null)
public BucketAbac(String name, BucketAbacArgs args)
public BucketAbac(String name, BucketAbacArgs args, CustomResourceOptions options)
type: aws:s3:BucketAbac
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 BucketAbacArgs
- 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 BucketAbacArgs
- 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 BucketAbacArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketAbacArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BucketAbacArgs
- 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 bucketAbacResource = new Aws.S3.BucketAbac("bucketAbacResource", new()
{
Bucket = "string",
AbacStatus = new Aws.S3.Inputs.BucketAbacAbacStatusArgs
{
Status = "string",
},
ExpectedBucketOwner = "string",
Region = "string",
});
example, err := s3.NewBucketAbac(ctx, "bucketAbacResource", &s3.BucketAbacArgs{
Bucket: pulumi.String("string"),
AbacStatus: &s3.BucketAbacAbacStatusArgs{
Status: pulumi.String("string"),
},
ExpectedBucketOwner: pulumi.String("string"),
Region: pulumi.String("string"),
})
var bucketAbacResource = new BucketAbac("bucketAbacResource", BucketAbacArgs.builder()
.bucket("string")
.abacStatus(BucketAbacAbacStatusArgs.builder()
.status("string")
.build())
.expectedBucketOwner("string")
.region("string")
.build());
bucket_abac_resource = aws.s3.BucketAbac("bucketAbacResource",
bucket="string",
abac_status={
"status": "string",
},
expected_bucket_owner="string",
region="string")
const bucketAbacResource = new aws.s3.BucketAbac("bucketAbacResource", {
bucket: "string",
abacStatus: {
status: "string",
},
expectedBucketOwner: "string",
region: "string",
});
type: aws:s3:BucketAbac
properties:
abacStatus:
status: string
bucket: string
expectedBucketOwner: string
region: string
BucketAbac 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 BucketAbac resource accepts the following input properties:
- Bucket string
- General purpose bucket that you want to create the metadata configuration for.
- Abac
Status BucketAbac Abac Status ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Bucket string
- General purpose bucket that you want to create the metadata configuration for.
- Abac
Status BucketAbac Abac Status Args ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- General purpose bucket that you want to create the metadata configuration for.
- abac
Status BucketAbac Abac Status ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket string
- General purpose bucket that you want to create the metadata configuration for.
- abac
Status BucketAbac Abac Status ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- expected
Bucket stringOwner - Account ID of the expected bucket owner.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket str
- General purpose bucket that you want to create the metadata configuration for.
- abac_
status BucketAbac Abac Status Args ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- expected_
bucket_ strowner - Account ID of the expected bucket owner.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- bucket String
- General purpose bucket that you want to create the metadata configuration for.
- abac
Status Property Map ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketAbac 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 BucketAbac Resource
Get an existing BucketAbac 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?: BucketAbacState, opts?: CustomResourceOptions): BucketAbac@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
abac_status: Optional[BucketAbacAbacStatusArgs] = None,
bucket: Optional[str] = None,
expected_bucket_owner: Optional[str] = None,
region: Optional[str] = None) -> BucketAbacfunc GetBucketAbac(ctx *Context, name string, id IDInput, state *BucketAbacState, opts ...ResourceOption) (*BucketAbac, error)public static BucketAbac Get(string name, Input<string> id, BucketAbacState? state, CustomResourceOptions? opts = null)public static BucketAbac get(String name, Output<String> id, BucketAbacState state, CustomResourceOptions options)resources: _: type: aws:s3:BucketAbac 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.
- Abac
Status BucketAbac Abac Status ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- Bucket string
- General purpose bucket that you want to create the metadata configuration for.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Abac
Status BucketAbac Abac Status Args ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- Bucket string
- General purpose bucket that you want to create the metadata configuration for.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- abac
Status BucketAbac Abac Status ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- bucket String
- General purpose bucket that you want to create the metadata configuration for.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- abac
Status BucketAbac Abac Status ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- bucket string
- General purpose bucket that you want to create the metadata configuration for.
- expected
Bucket stringOwner - Account ID of the expected bucket owner.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- abac_
status BucketAbac Abac Status Args ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- bucket str
- General purpose bucket that you want to create the metadata configuration for.
- expected_
bucket_ strowner - Account ID of the expected bucket owner.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- abac
Status Property Map ABAC status configuration. See
abac_statusBlock for details.The following arguments are optional:
- bucket String
- General purpose bucket that you want to create the metadata configuration for.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Supporting Types
BucketAbacAbacStatus, BucketAbacAbacStatusArgs
- Status string
- ABAC status of the general purpose bucket.
Valid values are
EnabledandDisabled. By default, ABAC is disabled for all Amazon S3 general purpose buckets.
- Status string
- ABAC status of the general purpose bucket.
Valid values are
EnabledandDisabled. By default, ABAC is disabled for all Amazon S3 general purpose buckets.
- status String
- ABAC status of the general purpose bucket.
Valid values are
EnabledandDisabled. By default, ABAC is disabled for all Amazon S3 general purpose buckets.
- status string
- ABAC status of the general purpose bucket.
Valid values are
EnabledandDisabled. By default, ABAC is disabled for all Amazon S3 general purpose buckets.
- status str
- ABAC status of the general purpose bucket.
Valid values are
EnabledandDisabled. By default, ABAC is disabled for all Amazon S3 general purpose buckets.
- status String
- ABAC status of the general purpose bucket.
Valid values are
EnabledandDisabled. By default, ABAC is disabled for all Amazon S3 general purpose buckets.
Import
If the owner (account ID) of the source bucket differs from the account used to configure the Terraform AWS Provider, import using the bucket and expected_bucket_owner separated by a comma (,):
Using pulumi import, import S3 (Simple Storage) Bucket ABAC using the bucket or bucket and expected_bucket_owner separated by a comma (,). For example:
If the owner (account ID) of the source bucket is the same account used to configure the Terraform AWS Provider, import using the bucket:
$ pulumi import aws:s3/bucketAbac:BucketAbac example bucket-name
If the owner (account ID) of the source bucket differs from the account used to configure the Terraform AWS Provider, import using the bucket and expected_bucket_owner separated by a comma (,):
$ pulumi import aws:s3/bucketAbac:BucketAbac example bucket-name,123456789012
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
awsTerraform Provider.
