aws.s3control.DirectoryBucketAccessPointScope
Explore with Pulumi AI
Example Usage
S3 Access Point Scope for a directory bucket in an AWS Local Zone
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const available = aws.getAvailabilityZones({
state: "available",
});
const example = new aws.s3.DirectoryBucket("example", {
bucket: "example--zoneId--x-s3",
location: {
name: available.then(available => available.zoneIds?.[0]),
},
});
const exampleAccessPoint = new aws.s3.AccessPoint("example", {
bucket: example.id,
name: "example--zoneId--xa-s3",
});
const exampleDirectoryBucketAccessPointScope = new aws.s3control.DirectoryBucketAccessPointScope("example", {
name: "example--zoneId--xa-s3",
accountId: "123456789012",
scope: {
permissions: [
"GetObject",
"ListBucket",
],
prefixes: [
"myobject1.csv",
"myobject2*",
],
},
});
import pulumi
import pulumi_aws as aws
available = aws.get_availability_zones(state="available")
example = aws.s3.DirectoryBucket("example",
bucket="example--zoneId--x-s3",
location={
"name": available.zone_ids[0],
})
example_access_point = aws.s3.AccessPoint("example",
bucket=example.id,
name="example--zoneId--xa-s3")
example_directory_bucket_access_point_scope = aws.s3control.DirectoryBucketAccessPointScope("example",
name="example--zoneId--xa-s3",
account_id="123456789012",
scope={
"permissions": [
"GetObject",
"ListBucket",
],
"prefixes": [
"myobject1.csv",
"myobject2*",
],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3control"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{
State: pulumi.StringRef("available"),
}, nil)
if err != nil {
return err
}
example, err := s3.NewDirectoryBucket(ctx, "example", &s3.DirectoryBucketArgs{
Bucket: pulumi.String("example--zoneId--x-s3"),
Location: &s3.DirectoryBucketLocationArgs{
Name: pulumi.String(available.ZoneIds[0]),
},
})
if err != nil {
return err
}
_, err = s3.NewAccessPoint(ctx, "example", &s3.AccessPointArgs{
Bucket: example.ID(),
Name: pulumi.String("example--zoneId--xa-s3"),
})
if err != nil {
return err
}
_, err = s3control.NewDirectoryBucketAccessPointScope(ctx, "example", &s3control.DirectoryBucketAccessPointScopeArgs{
Name: pulumi.String("example--zoneId--xa-s3"),
AccountId: pulumi.String("123456789012"),
Scope: &s3control.DirectoryBucketAccessPointScopeScopeArgs{
Permissions: pulumi.StringArray{
pulumi.String("GetObject"),
pulumi.String("ListBucket"),
},
Prefixes: pulumi.StringArray{
pulumi.String("myobject1.csv"),
pulumi.String("myobject2*"),
},
},
})
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 available = Aws.GetAvailabilityZones.Invoke(new()
{
State = "available",
});
var example = new Aws.S3.DirectoryBucket("example", new()
{
Bucket = "example--zoneId--x-s3",
Location = new Aws.S3.Inputs.DirectoryBucketLocationArgs
{
Name = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.ZoneIds[0]),
},
});
var exampleAccessPoint = new Aws.S3.AccessPoint("example", new()
{
Bucket = example.Id,
Name = "example--zoneId--xa-s3",
});
var exampleDirectoryBucketAccessPointScope = new Aws.S3Control.DirectoryBucketAccessPointScope("example", new()
{
Name = "example--zoneId--xa-s3",
AccountId = "123456789012",
Scope = new Aws.S3Control.Inputs.DirectoryBucketAccessPointScopeScopeArgs
{
Permissions = new[]
{
"GetObject",
"ListBucket",
},
Prefixes = new[]
{
"myobject1.csv",
"myobject2*",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetAvailabilityZonesArgs;
import com.pulumi.aws.s3.DirectoryBucket;
import com.pulumi.aws.s3.DirectoryBucketArgs;
import com.pulumi.aws.s3.inputs.DirectoryBucketLocationArgs;
import com.pulumi.aws.s3.AccessPoint;
import com.pulumi.aws.s3.AccessPointArgs;
import com.pulumi.aws.s3control.DirectoryBucketAccessPointScope;
import com.pulumi.aws.s3control.DirectoryBucketAccessPointScopeArgs;
import com.pulumi.aws.s3control.inputs.DirectoryBucketAccessPointScopeScopeArgs;
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 available = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
.state("available")
.build());
var example = new DirectoryBucket("example", DirectoryBucketArgs.builder()
.bucket("example--zoneId--x-s3")
.location(DirectoryBucketLocationArgs.builder()
.name(available.zoneIds()[0])
.build())
.build());
var exampleAccessPoint = new AccessPoint("exampleAccessPoint", AccessPointArgs.builder()
.bucket(example.id())
.name("example--zoneId--xa-s3")
.build());
var exampleDirectoryBucketAccessPointScope = new DirectoryBucketAccessPointScope("exampleDirectoryBucketAccessPointScope", DirectoryBucketAccessPointScopeArgs.builder()
.name("example--zoneId--xa-s3")
.accountId("123456789012")
.scope(DirectoryBucketAccessPointScopeScopeArgs.builder()
.permissions(
"GetObject",
"ListBucket")
.prefixes(
"myobject1.csv",
"myobject2*")
.build())
.build());
}
}
resources:
example:
type: aws:s3:DirectoryBucket
properties:
bucket: example--zoneId--x-s3
location:
name: ${available.zoneIds[0]}
exampleAccessPoint:
type: aws:s3:AccessPoint
name: example
properties:
bucket: ${example.id}
name: example--zoneId--xa-s3
exampleDirectoryBucketAccessPointScope:
type: aws:s3control:DirectoryBucketAccessPointScope
name: example
properties:
name: example--zoneId--xa-s3
accountId: '123456789012'
scope:
permissions:
- GetObject
- ListBucket
prefixes:
- myobject1.csv
- myobject2*
variables:
available:
fn::invoke:
function: aws:getAvailabilityZones
arguments:
state: available
Create DirectoryBucketAccessPointScope Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DirectoryBucketAccessPointScope(name: string, args: DirectoryBucketAccessPointScopeArgs, opts?: CustomResourceOptions);
@overload
def DirectoryBucketAccessPointScope(resource_name: str,
args: DirectoryBucketAccessPointScopeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DirectoryBucketAccessPointScope(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
name: Optional[str] = None,
scope: Optional[DirectoryBucketAccessPointScopeScopeArgs] = None)
func NewDirectoryBucketAccessPointScope(ctx *Context, name string, args DirectoryBucketAccessPointScopeArgs, opts ...ResourceOption) (*DirectoryBucketAccessPointScope, error)
public DirectoryBucketAccessPointScope(string name, DirectoryBucketAccessPointScopeArgs args, CustomResourceOptions? opts = null)
public DirectoryBucketAccessPointScope(String name, DirectoryBucketAccessPointScopeArgs args)
public DirectoryBucketAccessPointScope(String name, DirectoryBucketAccessPointScopeArgs args, CustomResourceOptions options)
type: aws:s3control:DirectoryBucketAccessPointScope
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 DirectoryBucketAccessPointScopeArgs
- 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 DirectoryBucketAccessPointScopeArgs
- 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 DirectoryBucketAccessPointScopeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DirectoryBucketAccessPointScopeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DirectoryBucketAccessPointScopeArgs
- 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 directoryBucketAccessPointScopeResource = new Aws.S3Control.DirectoryBucketAccessPointScope("directoryBucketAccessPointScopeResource", new()
{
AccountId = "string",
Name = "string",
Scope = new Aws.S3Control.Inputs.DirectoryBucketAccessPointScopeScopeArgs
{
Permissions = new[]
{
"string",
},
Prefixes = new[]
{
"string",
},
},
});
example, err := s3control.NewDirectoryBucketAccessPointScope(ctx, "directoryBucketAccessPointScopeResource", &s3control.DirectoryBucketAccessPointScopeArgs{
AccountId: pulumi.String("string"),
Name: pulumi.String("string"),
Scope: &s3control.DirectoryBucketAccessPointScopeScopeArgs{
Permissions: pulumi.StringArray{
pulumi.String("string"),
},
Prefixes: pulumi.StringArray{
pulumi.String("string"),
},
},
})
var directoryBucketAccessPointScopeResource = new DirectoryBucketAccessPointScope("directoryBucketAccessPointScopeResource", DirectoryBucketAccessPointScopeArgs.builder()
.accountId("string")
.name("string")
.scope(DirectoryBucketAccessPointScopeScopeArgs.builder()
.permissions("string")
.prefixes("string")
.build())
.build());
directory_bucket_access_point_scope_resource = aws.s3control.DirectoryBucketAccessPointScope("directoryBucketAccessPointScopeResource",
account_id="string",
name="string",
scope={
"permissions": ["string"],
"prefixes": ["string"],
})
const directoryBucketAccessPointScopeResource = new aws.s3control.DirectoryBucketAccessPointScope("directoryBucketAccessPointScopeResource", {
accountId: "string",
name: "string",
scope: {
permissions: ["string"],
prefixes: ["string"],
},
});
type: aws:s3control:DirectoryBucketAccessPointScope
properties:
accountId: string
name: string
scope:
permissions:
- string
prefixes:
- string
DirectoryBucketAccessPointScope 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 DirectoryBucketAccessPointScope resource accepts the following input properties:
- Account
Id string - The AWS account ID that owns the specified access point.
- Name string
- The name of the access point that you want to apply the scope to.
- Scope
Directory
Bucket Access Point Scope Scope - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- Account
Id string - The AWS account ID that owns the specified access point.
- Name string
- The name of the access point that you want to apply the scope to.
- Scope
Directory
Bucket Access Point Scope Scope Args - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account
Id String - The AWS account ID that owns the specified access point.
- name String
- The name of the access point that you want to apply the scope to.
- scope
Directory
Bucket Access Point Scope Scope - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account
Id string - The AWS account ID that owns the specified access point.
- name string
- The name of the access point that you want to apply the scope to.
- scope
Directory
Bucket Access Point Scope Scope - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account_
id str - The AWS account ID that owns the specified access point.
- name str
- The name of the access point that you want to apply the scope to.
- scope
Directory
Bucket Access Point Scope Scope Args - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account
Id String - The AWS account ID that owns the specified access point.
- name String
- The name of the access point that you want to apply the scope to.
- scope Property Map
- . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
Outputs
All input properties are implicitly available as output properties. Additionally, the DirectoryBucketAccessPointScope 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 DirectoryBucketAccessPointScope Resource
Get an existing DirectoryBucketAccessPointScope 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?: DirectoryBucketAccessPointScopeState, opts?: CustomResourceOptions): DirectoryBucketAccessPointScope
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
name: Optional[str] = None,
scope: Optional[DirectoryBucketAccessPointScopeScopeArgs] = None) -> DirectoryBucketAccessPointScope
func GetDirectoryBucketAccessPointScope(ctx *Context, name string, id IDInput, state *DirectoryBucketAccessPointScopeState, opts ...ResourceOption) (*DirectoryBucketAccessPointScope, error)
public static DirectoryBucketAccessPointScope Get(string name, Input<string> id, DirectoryBucketAccessPointScopeState? state, CustomResourceOptions? opts = null)
public static DirectoryBucketAccessPointScope get(String name, Output<String> id, DirectoryBucketAccessPointScopeState state, CustomResourceOptions options)
resources: _: type: aws:s3control:DirectoryBucketAccessPointScope 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.
- Account
Id string - The AWS account ID that owns the specified access point.
- Name string
- The name of the access point that you want to apply the scope to.
- Scope
Directory
Bucket Access Point Scope Scope - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- Account
Id string - The AWS account ID that owns the specified access point.
- Name string
- The name of the access point that you want to apply the scope to.
- Scope
Directory
Bucket Access Point Scope Scope Args - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account
Id String - The AWS account ID that owns the specified access point.
- name String
- The name of the access point that you want to apply the scope to.
- scope
Directory
Bucket Access Point Scope Scope - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account
Id string - The AWS account ID that owns the specified access point.
- name string
- The name of the access point that you want to apply the scope to.
- scope
Directory
Bucket Access Point Scope Scope - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account_
id str - The AWS account ID that owns the specified access point.
- name str
- The name of the access point that you want to apply the scope to.
- scope
Directory
Bucket Access Point Scope Scope Args - . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
- account
Id String - The AWS account ID that owns the specified access point.
- name String
- The name of the access point that you want to apply the scope to.
- scope Property Map
- . Scope is used to restrict access to specific prefixes, API operations, or a combination of both. To remove the
scope
, set it to{permissions=[] prefixes=[]}
. The default scope is{permissions=[] prefixes=[]}
.
Supporting Types
DirectoryBucketAccessPointScopeScope, DirectoryBucketAccessPointScopeScopeArgs
- Permissions List<string>
- You can specify a list of API operations as permissions for the access point.
- Prefixes List<string>
- You can specify a list of prefixes, but the total length of characters of all prefixes must be less than 256 bytes.
- For more information on access point scope, see AWS Documentation.
- Permissions []string
- You can specify a list of API operations as permissions for the access point.
- Prefixes []string
- You can specify a list of prefixes, but the total length of characters of all prefixes must be less than 256 bytes.
- For more information on access point scope, see AWS Documentation.
- permissions List<String>
- You can specify a list of API operations as permissions for the access point.
- prefixes List<String>
- You can specify a list of prefixes, but the total length of characters of all prefixes must be less than 256 bytes.
- For more information on access point scope, see AWS Documentation.
- permissions string[]
- You can specify a list of API operations as permissions for the access point.
- prefixes string[]
- You can specify a list of prefixes, but the total length of characters of all prefixes must be less than 256 bytes.
- For more information on access point scope, see AWS Documentation.
- permissions Sequence[str]
- You can specify a list of API operations as permissions for the access point.
- prefixes Sequence[str]
- You can specify a list of prefixes, but the total length of characters of all prefixes must be less than 256 bytes.
- For more information on access point scope, see AWS Documentation.
- permissions List<String>
- You can specify a list of API operations as permissions for the access point.
- prefixes List<String>
- You can specify a list of prefixes, but the total length of characters of all prefixes must be less than 256 bytes.
- For more information on access point scope, see AWS Documentation.
Import
Using pulumi import
, import Access Point Scope using access point name and AWS account ID separated by a colon (,
). For example:
$ pulumi import aws:s3control/directoryBucketAccessPointScope:DirectoryBucketAccessPointScope example example--zoneid--xa-s3,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
aws
Terraform Provider.