@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
192 lines (191 loc) • 7.62 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Provides an Object bucket website configuration resource.
* For more information, see [Hosting Websites on Object bucket](https://www.scaleway.com/en/docs/storage/object/how-to/use-bucket-website/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const mainObjectBucket = new scaleway.ObjectBucket("mainObjectBucket", {acl: "public-read"});
* const mainObjectBucketWebsiteConfiguration = new scaleway.ObjectBucketWebsiteConfiguration("mainObjectBucketWebsiteConfiguration", {
* bucket: mainObjectBucket.name,
* indexDocument: {
* suffix: "index.html",
* },
* });
* ```
* ## Example with `policy`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const mainObjectBucket = new scaleway.ObjectBucket("mainObjectBucket", {acl: "public-read"});
* const mainObjectBucketPolicy = new scaleway.ObjectBucketPolicy("mainObjectBucketPolicy", {
* bucket: mainObjectBucket.name,
* policy: JSON.stringify({
* Version: "2012-10-17",
* Id: "MyPolicy",
* Statement: [{
* Sid: "GrantToEveryone",
* Effect: "Allow",
* Principal: "*",
* Action: ["s3:GetObject"],
* Resource: ["<bucket-name>/*"],
* }],
* }),
* });
* const mainObjectBucketWebsiteConfiguration = new scaleway.ObjectBucketWebsiteConfiguration("mainObjectBucketWebsiteConfiguration", {
* bucket: mainObjectBucket.name,
* indexDocument: {
* suffix: "index.html",
* },
* });
* ```
*
* ## indexDocument
*
* The `indexDocument` configuration block supports the following arguments:
*
* * `suffix` - (Required) A suffix that is appended to a request that is for a directory on the website endpoint.
*
* > **Important:** The suffix must not be empty and must not include a slash character. The routing is not supported.
*
* In addition to all above arguments, the following attribute is exported:
*
* * `id` - The region and bucket separated by a slash (/)
* * `websiteDomain` - The domain of the website endpoint. This is used to create DNS alias [records](https://www.scaleway.com/en/docs/network/domains-and-dns/how-to/manage-dns-records/).
* * `websiteEndpoint` - The website endpoint.
*
* > **Important:** Please check our concepts section to know more about the [endpoint](https://www.scaleway.com/en/docs/storage/object/concepts/#endpoint).
*
* ## errorDocument
*
* The errorDocument configuration block supports the following arguments:
*
* * `key` - (Required) The object key name to use when a 4XX class error occurs.
*
* ## Import
*
* Website configuration Bucket can be imported using the `{region}/{bucketName}` identifier, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/objectBucketWebsiteConfiguration:ObjectBucketWebsiteConfiguration some_bucket fr-par/some-bucket
* ```
*/
export declare class ObjectBucketWebsiteConfiguration extends pulumi.CustomResource {
/**
* Get an existing ObjectBucketWebsiteConfiguration 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: string, id: pulumi.Input<pulumi.ID>, state?: ObjectBucketWebsiteConfigurationState, opts?: pulumi.CustomResourceOptions): ObjectBucketWebsiteConfiguration;
/**
* Returns true if the given object is an instance of ObjectBucketWebsiteConfiguration. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is ObjectBucketWebsiteConfiguration;
/**
* (Required, Forces new resource) The name of the bucket.
*/
readonly bucket: pulumi.Output<string>;
/**
* (Optional) The name of the error document for the website detailed below.
*/
readonly errorDocument: pulumi.Output<outputs.ObjectBucketWebsiteConfigurationErrorDocument | undefined>;
/**
* (Required) The name of the index document for the website detailed below.
*/
readonly indexDocument: pulumi.Output<outputs.ObjectBucketWebsiteConfigurationIndexDocument>;
/**
* (Defaults to provider `projectId`) The ID of the project the bucket is associated with.
*/
readonly projectId: pulumi.Output<string>;
/**
* The region you want to attach the resource to
*/
readonly region: pulumi.Output<string>;
/**
* The website endpoint.
*/
readonly websiteDomain: pulumi.Output<string>;
/**
* The domain of the website endpoint.
*/
readonly websiteEndpoint: pulumi.Output<string>;
/**
* Create a ObjectBucketWebsiteConfiguration resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ObjectBucketWebsiteConfigurationArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ObjectBucketWebsiteConfiguration resources.
*/
export interface ObjectBucketWebsiteConfigurationState {
/**
* (Required, Forces new resource) The name of the bucket.
*/
bucket?: pulumi.Input<string>;
/**
* (Optional) The name of the error document for the website detailed below.
*/
errorDocument?: pulumi.Input<inputs.ObjectBucketWebsiteConfigurationErrorDocument>;
/**
* (Required) The name of the index document for the website detailed below.
*/
indexDocument?: pulumi.Input<inputs.ObjectBucketWebsiteConfigurationIndexDocument>;
/**
* (Defaults to provider `projectId`) The ID of the project the bucket is associated with.
*/
projectId?: pulumi.Input<string>;
/**
* The region you want to attach the resource to
*/
region?: pulumi.Input<string>;
/**
* The website endpoint.
*/
websiteDomain?: pulumi.Input<string>;
/**
* The domain of the website endpoint.
*/
websiteEndpoint?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ObjectBucketWebsiteConfiguration resource.
*/
export interface ObjectBucketWebsiteConfigurationArgs {
/**
* (Required, Forces new resource) The name of the bucket.
*/
bucket: pulumi.Input<string>;
/**
* (Optional) The name of the error document for the website detailed below.
*/
errorDocument?: pulumi.Input<inputs.ObjectBucketWebsiteConfigurationErrorDocument>;
/**
* (Required) The name of the index document for the website detailed below.
*/
indexDocument: pulumi.Input<inputs.ObjectBucketWebsiteConfigurationIndexDocument>;
/**
* (Defaults to provider `projectId`) The ID of the project the bucket is associated with.
*/
projectId?: pulumi.Input<string>;
/**
* The region you want to attach the resource to
*/
region?: pulumi.Input<string>;
}