@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
161 lines • 6.97 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccessPoint = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage an S3 Access Point.
*
* > **NOTE on Access Points and Access Point Policies:** This provider provides both a standalone Access Point Policy resource and an Access Point resource with a resource policy defined in-line. You cannot use an Access Point with in-line resource policy in conjunction with an Access Point Policy resource. Doing so will cause a conflict of policies and will overwrite the access point's resource policy.
*
* > Advanced usage: To use a custom API endpoint for this resource, use the `s3control` endpoint provider configuration), not the `s3` endpoint provider configuration.
*
* > This resource can be used with s3 directory buckets. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-directory-buckets.html) for more information.
*
* ## Example Usage
*
* ### AWS Partition General Purpose Bucket
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3.Bucket("example", {bucket: "example"});
* const exampleAccessPoint = new aws.s3.AccessPoint("example", {
* bucket: example.id,
* name: "example",
* });
* ```
*
* ### S3 on Outposts Bucket
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3control.Bucket("example", {bucket: "example"});
* const exampleVpc = new aws.ec2.Vpc("example", {cidrBlock: "10.0.0.0/16"});
* const exampleAccessPoint = new aws.s3.AccessPoint("example", {
* bucket: example.arn,
* name: "example",
* vpcConfiguration: {
* vpcId: exampleVpc.id,
* },
* });
* ```
*
* ### AWS Partition Directory Bucket
*
* ```typescript
* 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: test.bucket,
* name: "example--zoneId--xa-s3",
* });
* ```
*
* ## Import
*
* Import using the ARN for Access Points associated with an S3 on Outposts Bucket:
*
* __Using `pulumi import` to import.__ For example:
*
* Import using the `account_id` and `name` separated by a colon (`:`) for Access Points associated with an AWS Partition S3 Bucket:
*
* ```sh
* $ pulumi import aws:s3/accessPoint:AccessPoint example 123456789012:example
* ```
* Import using the ARN for Access Points associated with an S3 on Outposts Bucket:
*
* ```sh
* $ pulumi import aws:s3/accessPoint:AccessPoint example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-1234567890123456/accesspoint/example
* ```
*/
class AccessPoint extends pulumi.CustomResource {
/**
* Get an existing AccessPoint resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new AccessPoint(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AccessPoint. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AccessPoint.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state?.accountId;
resourceInputs["alias"] = state?.alias;
resourceInputs["arn"] = state?.arn;
resourceInputs["bucket"] = state?.bucket;
resourceInputs["bucketAccountId"] = state?.bucketAccountId;
resourceInputs["domainName"] = state?.domainName;
resourceInputs["endpoints"] = state?.endpoints;
resourceInputs["hasPublicAccessPolicy"] = state?.hasPublicAccessPolicy;
resourceInputs["name"] = state?.name;
resourceInputs["networkOrigin"] = state?.networkOrigin;
resourceInputs["policy"] = state?.policy;
resourceInputs["publicAccessBlockConfiguration"] = state?.publicAccessBlockConfiguration;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcConfiguration"] = state?.vpcConfiguration;
}
else {
const args = argsOrState;
if (args?.bucket === undefined && !opts.urn) {
throw new Error("Missing required property 'bucket'");
}
resourceInputs["accountId"] = args?.accountId;
resourceInputs["bucket"] = args?.bucket;
resourceInputs["bucketAccountId"] = args?.bucketAccountId;
resourceInputs["name"] = args?.name;
resourceInputs["policy"] = args?.policy;
resourceInputs["publicAccessBlockConfiguration"] = args?.publicAccessBlockConfiguration;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcConfiguration"] = args?.vpcConfiguration;
resourceInputs["alias"] = undefined /*out*/;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["domainName"] = undefined /*out*/;
resourceInputs["endpoints"] = undefined /*out*/;
resourceInputs["hasPublicAccessPolicy"] = undefined /*out*/;
resourceInputs["networkOrigin"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AccessPoint.__pulumiType, name, resourceInputs, opts);
}
}
exports.AccessPoint = AccessPoint;
/** @internal */
AccessPoint.__pulumiType = 'aws:s3/accessPoint:AccessPoint';
//# sourceMappingURL=accessPoint.js.map