opentelekomcloud.S3Bucket
Explore with Pulumi AI
Provides a S3 bucket resource within OpenTelekomCloud.
Example Usage
Private Bucket w/ Tags
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const bucket = new opentelekomcloud.S3Bucket("bucket", {
acl: "private",
bucket: "my-tf-test-bucket",
tags: {
Environment: "Dev",
Name: "My bucket",
},
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
bucket = opentelekomcloud.S3Bucket("bucket",
acl="private",
bucket="my-tf-test-bucket",
tags={
"Environment": "Dev",
"Name": "My bucket",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opentelekomcloud.NewS3Bucket(ctx, "bucket", &opentelekomcloud.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-tf-test-bucket"),
Tags: pulumi.StringMap{
"Environment": pulumi.String("Dev"),
"Name": pulumi.String("My bucket"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var bucket = new Opentelekomcloud.S3Bucket("bucket", new()
{
Acl = "private",
Bucket = "my-tf-test-bucket",
Tags =
{
{ "Environment", "Dev" },
{ "Name", "My bucket" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.S3Bucket;
import com.pulumi.opentelekomcloud.S3BucketArgs;
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 bucket = new S3Bucket("bucket", S3BucketArgs.builder()
.acl("private")
.bucket("my-tf-test-bucket")
.tags(Map.ofEntries(
Map.entry("Environment", "Dev"),
Map.entry("Name", "My bucket")
))
.build());
}
}
resources:
bucket:
type: opentelekomcloud:S3Bucket
properties:
acl: private
bucket: my-tf-test-bucket
tags:
Environment: Dev
Name: My bucket
Static Website Hosting
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const bucket = new opentelekomcloud.S3Bucket("bucket", {
bucket: "s3-website-test.hashicorp.com",
acl: "public-read",
policy: fs.readFileSync("policy.json", "utf8"),
website: {
indexDocument: "index.html",
errorDocument: "error.html",
routingRules: `[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "documents/"
}
}]
`,
},
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
bucket = opentelekomcloud.S3Bucket("bucket",
bucket="s3-website-test.hashicorp.com",
acl="public-read",
policy=(lambda path: open(path).read())("policy.json"),
website={
"index_document": "index.html",
"error_document": "error.html",
"routing_rules": """[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "documents/"
}
}]
""",
})
package main
import (
"os"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opentelekomcloud.NewS3Bucket(ctx, "bucket", &opentelekomcloud.S3BucketArgs{
Bucket: pulumi.String("s3-website-test.hashicorp.com"),
Acl: pulumi.String("public-read"),
Policy: pulumi.String(readFileOrPanic("policy.json")),
Website: &opentelekomcloud.S3BucketWebsiteArgs{
IndexDocument: pulumi.String("index.html"),
ErrorDocument: pulumi.String("error.html"),
RoutingRules: pulumi.String(`[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "documents/"
}
}]
`),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var bucket = new Opentelekomcloud.S3Bucket("bucket", new()
{
Bucket = "s3-website-test.hashicorp.com",
Acl = "public-read",
Policy = File.ReadAllText("policy.json"),
Website = new Opentelekomcloud.Inputs.S3BucketWebsiteArgs
{
IndexDocument = "index.html",
ErrorDocument = "error.html",
RoutingRules = @"[{
""Condition"": {
""KeyPrefixEquals"": ""docs/""
},
""Redirect"": {
""ReplaceKeyPrefixWith"": ""documents/""
}
}]
",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.S3Bucket;
import com.pulumi.opentelekomcloud.S3BucketArgs;
import com.pulumi.opentelekomcloud.inputs.S3BucketWebsiteArgs;
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 bucket = new S3Bucket("bucket", S3BucketArgs.builder()
.bucket("s3-website-test.hashicorp.com")
.acl("public-read")
.policy(Files.readString(Paths.get("policy.json")))
.website(S3BucketWebsiteArgs.builder()
.indexDocument("index.html")
.errorDocument("error.html")
.routingRules("""
[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "documents/"
}
}]
""")
.build())
.build());
}
}
resources:
bucket:
type: opentelekomcloud:S3Bucket
properties:
bucket: s3-website-test.hashicorp.com
acl: public-read
policy:
fn::readFile: policy.json
website:
indexDocument: index.html
errorDocument: error.html
routingRules: |
[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": "documents/"
}
}]
Using CORS
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const bucket = new opentelekomcloud.S3Bucket("bucket", {
acl: "public-read",
bucket: "s3-website-test.hashicorp.com",
corsRules: [{
allowedHeaders: ["*"],
allowedMethods: [
"PUT",
"POST",
],
allowedOrigins: ["https://s3-website-test.hashicorp.com"],
exposeHeaders: ["ETag"],
maxAgeSeconds: 3000,
}],
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
bucket = opentelekomcloud.S3Bucket("bucket",
acl="public-read",
bucket="s3-website-test.hashicorp.com",
cors_rules=[{
"allowed_headers": ["*"],
"allowed_methods": [
"PUT",
"POST",
],
"allowed_origins": ["https://s3-website-test.hashicorp.com"],
"expose_headers": ["ETag"],
"max_age_seconds": 3000,
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opentelekomcloud.NewS3Bucket(ctx, "bucket", &opentelekomcloud.S3BucketArgs{
Acl: pulumi.String("public-read"),
Bucket: pulumi.String("s3-website-test.hashicorp.com"),
CorsRules: opentelekomcloud.S3BucketCorsRuleArray{
&opentelekomcloud.S3BucketCorsRuleArgs{
AllowedHeaders: pulumi.StringArray{
pulumi.String("*"),
},
AllowedMethods: pulumi.StringArray{
pulumi.String("PUT"),
pulumi.String("POST"),
},
AllowedOrigins: pulumi.StringArray{
pulumi.String("https://s3-website-test.hashicorp.com"),
},
ExposeHeaders: pulumi.StringArray{
pulumi.String("ETag"),
},
MaxAgeSeconds: pulumi.Float64(3000),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var bucket = new Opentelekomcloud.S3Bucket("bucket", new()
{
Acl = "public-read",
Bucket = "s3-website-test.hashicorp.com",
CorsRules = new[]
{
new Opentelekomcloud.Inputs.S3BucketCorsRuleArgs
{
AllowedHeaders = new[]
{
"*",
},
AllowedMethods = new[]
{
"PUT",
"POST",
},
AllowedOrigins = new[]
{
"https://s3-website-test.hashicorp.com",
},
ExposeHeaders = new[]
{
"ETag",
},
MaxAgeSeconds = 3000,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.S3Bucket;
import com.pulumi.opentelekomcloud.S3BucketArgs;
import com.pulumi.opentelekomcloud.inputs.S3BucketCorsRuleArgs;
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 bucket = new S3Bucket("bucket", S3BucketArgs.builder()
.acl("public-read")
.bucket("s3-website-test.hashicorp.com")
.corsRules(S3BucketCorsRuleArgs.builder()
.allowedHeaders("*")
.allowedMethods(
"PUT",
"POST")
.allowedOrigins("https://s3-website-test.hashicorp.com")
.exposeHeaders("ETag")
.maxAgeSeconds(3000)
.build())
.build());
}
}
resources:
bucket:
type: opentelekomcloud:S3Bucket
properties:
acl: public-read
bucket: s3-website-test.hashicorp.com
corsRules:
- allowedHeaders:
- '*'
allowedMethods:
- PUT
- POST
allowedOrigins:
- https://s3-website-test.hashicorp.com
exposeHeaders:
- ETag
maxAgeSeconds: 3000
Using versioning
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const bucket = new opentelekomcloud.S3Bucket("bucket", {
acl: "private",
bucket: "my-tf-test-bucket",
versioning: {
enabled: true,
},
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
bucket = opentelekomcloud.S3Bucket("bucket",
acl="private",
bucket="my-tf-test-bucket",
versioning={
"enabled": True,
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opentelekomcloud.NewS3Bucket(ctx, "bucket", &opentelekomcloud.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-tf-test-bucket"),
Versioning: &opentelekomcloud.S3BucketVersioningArgs{
Enabled: pulumi.Bool(true),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var bucket = new Opentelekomcloud.S3Bucket("bucket", new()
{
Acl = "private",
Bucket = "my-tf-test-bucket",
Versioning = new Opentelekomcloud.Inputs.S3BucketVersioningArgs
{
Enabled = true,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.S3Bucket;
import com.pulumi.opentelekomcloud.S3BucketArgs;
import com.pulumi.opentelekomcloud.inputs.S3BucketVersioningArgs;
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 bucket = new S3Bucket("bucket", S3BucketArgs.builder()
.acl("private")
.bucket("my-tf-test-bucket")
.versioning(S3BucketVersioningArgs.builder()
.enabled(true)
.build())
.build());
}
}
resources:
bucket:
type: opentelekomcloud:S3Bucket
properties:
acl: private
bucket: my-tf-test-bucket
versioning:
enabled: true
Enable Logging
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const logBucket = new opentelekomcloud.S3Bucket("logBucket", {
bucket: "my-tf-log-bucket",
acl: "log-delivery-write",
});
const s3Bucket = new opentelekomcloud.S3Bucket("s3Bucket", {
bucket: "my-tf-test-bucket",
acl: "private",
loggings: [{
targetBucket: logBucket.s3BucketId,
targetPrefix: "log/",
}],
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
log_bucket = opentelekomcloud.S3Bucket("logBucket",
bucket="my-tf-log-bucket",
acl="log-delivery-write")
s3_bucket = opentelekomcloud.S3Bucket("s3Bucket",
bucket="my-tf-test-bucket",
acl="private",
loggings=[{
"target_bucket": log_bucket.s3_bucket_id,
"target_prefix": "log/",
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
logBucket, err := opentelekomcloud.NewS3Bucket(ctx, "logBucket", &opentelekomcloud.S3BucketArgs{
Bucket: pulumi.String("my-tf-log-bucket"),
Acl: pulumi.String("log-delivery-write"),
})
if err != nil {
return err
}
_, err = opentelekomcloud.NewS3Bucket(ctx, "s3Bucket", &opentelekomcloud.S3BucketArgs{
Bucket: pulumi.String("my-tf-test-bucket"),
Acl: pulumi.String("private"),
Loggings: opentelekomcloud.S3BucketLoggingArray{
&opentelekomcloud.S3BucketLoggingArgs{
TargetBucket: logBucket.S3BucketId,
TargetPrefix: pulumi.String("log/"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var logBucket = new Opentelekomcloud.S3Bucket("logBucket", new()
{
Bucket = "my-tf-log-bucket",
Acl = "log-delivery-write",
});
var s3Bucket = new Opentelekomcloud.S3Bucket("s3Bucket", new()
{
Bucket = "my-tf-test-bucket",
Acl = "private",
Loggings = new[]
{
new Opentelekomcloud.Inputs.S3BucketLoggingArgs
{
TargetBucket = logBucket.S3BucketId,
TargetPrefix = "log/",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.S3Bucket;
import com.pulumi.opentelekomcloud.S3BucketArgs;
import com.pulumi.opentelekomcloud.inputs.S3BucketLoggingArgs;
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 logBucket = new S3Bucket("logBucket", S3BucketArgs.builder()
.bucket("my-tf-log-bucket")
.acl("log-delivery-write")
.build());
var s3Bucket = new S3Bucket("s3Bucket", S3BucketArgs.builder()
.bucket("my-tf-test-bucket")
.acl("private")
.loggings(S3BucketLoggingArgs.builder()
.targetBucket(logBucket.s3BucketId())
.targetPrefix("log/")
.build())
.build());
}
}
resources:
logBucket:
type: opentelekomcloud:S3Bucket
properties:
bucket: my-tf-log-bucket
acl: log-delivery-write
s3Bucket:
type: opentelekomcloud:S3Bucket
properties:
bucket: my-tf-test-bucket
acl: private
loggings:
- targetBucket: ${logBucket.s3BucketId}
targetPrefix: log/
Using object lifecycle
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const bucket = new opentelekomcloud.S3Bucket("bucket", {
acl: "private",
bucket: "my-bucket",
lifecycleRules: [
{
enabled: true,
expirations: [{
days: 90,
}],
id: "log",
prefix: "log/",
},
{
enabled: true,
expirations: [{
date: "2016-01-12",
}],
id: "tmp",
prefix: "tmp/",
},
],
});
const versioningBucket = new opentelekomcloud.S3Bucket("versioningBucket", {
acl: "private",
bucket: "my-versioning-bucket",
lifecycleRules: [{
enabled: true,
prefix: "config/",
}],
versioning: {
enabled: true,
},
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
bucket = opentelekomcloud.S3Bucket("bucket",
acl="private",
bucket="my-bucket",
lifecycle_rules=[
{
"enabled": True,
"expirations": [{
"days": 90,
}],
"id": "log",
"prefix": "log/",
},
{
"enabled": True,
"expirations": [{
"date": "2016-01-12",
}],
"id": "tmp",
"prefix": "tmp/",
},
])
versioning_bucket = opentelekomcloud.S3Bucket("versioningBucket",
acl="private",
bucket="my-versioning-bucket",
lifecycle_rules=[{
"enabled": True,
"prefix": "config/",
}],
versioning={
"enabled": True,
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opentelekomcloud.NewS3Bucket(ctx, "bucket", &opentelekomcloud.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-bucket"),
LifecycleRules: opentelekomcloud.S3BucketLifecycleRuleArray{
&opentelekomcloud.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(true),
Expirations: opentelekomcloud.S3BucketLifecycleRuleExpirationArray{
&opentelekomcloud.S3BucketLifecycleRuleExpirationArgs{
Days: pulumi.Float64(90),
},
},
Id: pulumi.String("log"),
Prefix: pulumi.String("log/"),
},
&opentelekomcloud.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(true),
Expirations: opentelekomcloud.S3BucketLifecycleRuleExpirationArray{
&opentelekomcloud.S3BucketLifecycleRuleExpirationArgs{
Date: pulumi.String("2016-01-12"),
},
},
Id: pulumi.String("tmp"),
Prefix: pulumi.String("tmp/"),
},
},
})
if err != nil {
return err
}
_, err = opentelekomcloud.NewS3Bucket(ctx, "versioningBucket", &opentelekomcloud.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-versioning-bucket"),
LifecycleRules: opentelekomcloud.S3BucketLifecycleRuleArray{
&opentelekomcloud.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(true),
Prefix: pulumi.String("config/"),
},
},
Versioning: &opentelekomcloud.S3BucketVersioningArgs{
Enabled: pulumi.Bool(true),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var bucket = new Opentelekomcloud.S3Bucket("bucket", new()
{
Acl = "private",
Bucket = "my-bucket",
LifecycleRules = new[]
{
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = true,
Expirations = new[]
{
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleExpirationArgs
{
Days = 90,
},
},
Id = "log",
Prefix = "log/",
},
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = true,
Expirations = new[]
{
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleExpirationArgs
{
Date = "2016-01-12",
},
},
Id = "tmp",
Prefix = "tmp/",
},
},
});
var versioningBucket = new Opentelekomcloud.S3Bucket("versioningBucket", new()
{
Acl = "private",
Bucket = "my-versioning-bucket",
LifecycleRules = new[]
{
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = true,
Prefix = "config/",
},
},
Versioning = new Opentelekomcloud.Inputs.S3BucketVersioningArgs
{
Enabled = true,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.S3Bucket;
import com.pulumi.opentelekomcloud.S3BucketArgs;
import com.pulumi.opentelekomcloud.inputs.S3BucketLifecycleRuleArgs;
import com.pulumi.opentelekomcloud.inputs.S3BucketVersioningArgs;
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 bucket = new S3Bucket("bucket", S3BucketArgs.builder()
.acl("private")
.bucket("my-bucket")
.lifecycleRules(
S3BucketLifecycleRuleArgs.builder()
.enabled(true)
.expirations(S3BucketLifecycleRuleExpirationArgs.builder()
.days(90)
.build())
.id("log")
.prefix("log/")
.build(),
S3BucketLifecycleRuleArgs.builder()
.enabled(true)
.expirations(S3BucketLifecycleRuleExpirationArgs.builder()
.date("2016-01-12")
.build())
.id("tmp")
.prefix("tmp/")
.build())
.build());
var versioningBucket = new S3Bucket("versioningBucket", S3BucketArgs.builder()
.acl("private")
.bucket("my-versioning-bucket")
.lifecycleRules(S3BucketLifecycleRuleArgs.builder()
.enabled(true)
.prefix("config/")
.build())
.versioning(S3BucketVersioningArgs.builder()
.enabled(true)
.build())
.build());
}
}
resources:
bucket:
type: opentelekomcloud:S3Bucket
properties:
acl: private
bucket: my-bucket
lifecycleRules:
- enabled: true
expirations:
- days: 90
id: log
prefix: log/
- enabled: true
expirations:
- date: 2016-01-12
id: tmp
prefix: tmp/
versioningBucket:
type: opentelekomcloud:S3Bucket
properties:
acl: private
bucket: my-versioning-bucket
lifecycleRules:
- enabled: true
prefix: config/
versioning:
enabled: true
Create S3Bucket Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new S3Bucket(name: string, args?: S3BucketArgs, opts?: CustomResourceOptions);
@overload
def S3Bucket(resource_name: str,
args: Optional[S3BucketArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def S3Bucket(resource_name: str,
opts: Optional[ResourceOptions] = None,
acl: Optional[str] = None,
arn: Optional[str] = None,
bucket: Optional[str] = None,
bucket_prefix: Optional[str] = None,
cors_rules: Optional[Sequence[S3BucketCorsRuleArgs]] = None,
force_destroy: Optional[bool] = None,
hosted_zone_id: Optional[str] = None,
lifecycle_rules: Optional[Sequence[S3BucketLifecycleRuleArgs]] = None,
loggings: Optional[Sequence[S3BucketLoggingArgs]] = None,
policy: Optional[str] = None,
region: Optional[str] = None,
s3_bucket_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
versioning: Optional[S3BucketVersioningArgs] = None,
website: Optional[S3BucketWebsiteArgs] = None,
website_domain: Optional[str] = None,
website_endpoint: Optional[str] = None)
func NewS3Bucket(ctx *Context, name string, args *S3BucketArgs, opts ...ResourceOption) (*S3Bucket, error)
public S3Bucket(string name, S3BucketArgs? args = null, CustomResourceOptions? opts = null)
public S3Bucket(String name, S3BucketArgs args)
public S3Bucket(String name, S3BucketArgs args, CustomResourceOptions options)
type: opentelekomcloud:S3Bucket
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 S3BucketArgs
- 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 S3BucketArgs
- 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 S3BucketArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args S3BucketArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args S3BucketArgs
- 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 s3bucketResource = new Opentelekomcloud.S3Bucket("s3bucketResource", new()
{
Acl = "string",
Arn = "string",
Bucket = "string",
BucketPrefix = "string",
CorsRules = new[]
{
new Opentelekomcloud.Inputs.S3BucketCorsRuleArgs
{
AllowedMethods = new[]
{
"string",
},
AllowedOrigins = new[]
{
"string",
},
AllowedHeaders = new[]
{
"string",
},
ExposeHeaders = new[]
{
"string",
},
MaxAgeSeconds = 0,
},
},
ForceDestroy = false,
HostedZoneId = "string",
LifecycleRules = new[]
{
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = false,
AbortIncompleteMultipartUploadDays = 0,
Expirations = new[]
{
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleExpirationArgs
{
Date = "string",
Days = 0,
ExpiredObjectDeleteMarker = false,
},
},
Id = "string",
NoncurrentVersionExpirations = new[]
{
new Opentelekomcloud.Inputs.S3BucketLifecycleRuleNoncurrentVersionExpirationArgs
{
Days = 0,
},
},
Prefix = "string",
},
},
Loggings = new[]
{
new Opentelekomcloud.Inputs.S3BucketLoggingArgs
{
TargetBucket = "string",
TargetPrefix = "string",
},
},
Policy = "string",
Region = "string",
S3BucketId = "string",
Tags =
{
{ "string", "string" },
},
Versioning = new Opentelekomcloud.Inputs.S3BucketVersioningArgs
{
Enabled = false,
MfaDelete = false,
},
Website = new Opentelekomcloud.Inputs.S3BucketWebsiteArgs
{
ErrorDocument = "string",
IndexDocument = "string",
RedirectAllRequestsTo = "string",
RoutingRules = "string",
},
WebsiteDomain = "string",
WebsiteEndpoint = "string",
});
example, err := opentelekomcloud.NewS3Bucket(ctx, "s3bucketResource", &opentelekomcloud.S3BucketArgs{
Acl: pulumi.String("string"),
Arn: pulumi.String("string"),
Bucket: pulumi.String("string"),
BucketPrefix: pulumi.String("string"),
CorsRules: opentelekomcloud.S3BucketCorsRuleArray{
&opentelekomcloud.S3BucketCorsRuleArgs{
AllowedMethods: pulumi.StringArray{
pulumi.String("string"),
},
AllowedOrigins: pulumi.StringArray{
pulumi.String("string"),
},
AllowedHeaders: pulumi.StringArray{
pulumi.String("string"),
},
ExposeHeaders: pulumi.StringArray{
pulumi.String("string"),
},
MaxAgeSeconds: pulumi.Float64(0),
},
},
ForceDestroy: pulumi.Bool(false),
HostedZoneId: pulumi.String("string"),
LifecycleRules: opentelekomcloud.S3BucketLifecycleRuleArray{
&opentelekomcloud.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(false),
AbortIncompleteMultipartUploadDays: pulumi.Float64(0),
Expirations: opentelekomcloud.S3BucketLifecycleRuleExpirationArray{
&opentelekomcloud.S3BucketLifecycleRuleExpirationArgs{
Date: pulumi.String("string"),
Days: pulumi.Float64(0),
ExpiredObjectDeleteMarker: pulumi.Bool(false),
},
},
Id: pulumi.String("string"),
NoncurrentVersionExpirations: opentelekomcloud.S3BucketLifecycleRuleNoncurrentVersionExpirationArray{
&opentelekomcloud.S3BucketLifecycleRuleNoncurrentVersionExpirationArgs{
Days: pulumi.Float64(0),
},
},
Prefix: pulumi.String("string"),
},
},
Loggings: opentelekomcloud.S3BucketLoggingArray{
&opentelekomcloud.S3BucketLoggingArgs{
TargetBucket: pulumi.String("string"),
TargetPrefix: pulumi.String("string"),
},
},
Policy: pulumi.String("string"),
Region: pulumi.String("string"),
S3BucketId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Versioning: &opentelekomcloud.S3BucketVersioningArgs{
Enabled: pulumi.Bool(false),
MfaDelete: pulumi.Bool(false),
},
Website: &opentelekomcloud.S3BucketWebsiteArgs{
ErrorDocument: pulumi.String("string"),
IndexDocument: pulumi.String("string"),
RedirectAllRequestsTo: pulumi.String("string"),
RoutingRules: pulumi.String("string"),
},
WebsiteDomain: pulumi.String("string"),
WebsiteEndpoint: pulumi.String("string"),
})
var s3bucketResource = new S3Bucket("s3bucketResource", S3BucketArgs.builder()
.acl("string")
.arn("string")
.bucket("string")
.bucketPrefix("string")
.corsRules(S3BucketCorsRuleArgs.builder()
.allowedMethods("string")
.allowedOrigins("string")
.allowedHeaders("string")
.exposeHeaders("string")
.maxAgeSeconds(0)
.build())
.forceDestroy(false)
.hostedZoneId("string")
.lifecycleRules(S3BucketLifecycleRuleArgs.builder()
.enabled(false)
.abortIncompleteMultipartUploadDays(0)
.expirations(S3BucketLifecycleRuleExpirationArgs.builder()
.date("string")
.days(0)
.expiredObjectDeleteMarker(false)
.build())
.id("string")
.noncurrentVersionExpirations(S3BucketLifecycleRuleNoncurrentVersionExpirationArgs.builder()
.days(0)
.build())
.prefix("string")
.build())
.loggings(S3BucketLoggingArgs.builder()
.targetBucket("string")
.targetPrefix("string")
.build())
.policy("string")
.region("string")
.s3BucketId("string")
.tags(Map.of("string", "string"))
.versioning(S3BucketVersioningArgs.builder()
.enabled(false)
.mfaDelete(false)
.build())
.website(S3BucketWebsiteArgs.builder()
.errorDocument("string")
.indexDocument("string")
.redirectAllRequestsTo("string")
.routingRules("string")
.build())
.websiteDomain("string")
.websiteEndpoint("string")
.build());
s3bucket_resource = opentelekomcloud.S3Bucket("s3bucketResource",
acl="string",
arn="string",
bucket="string",
bucket_prefix="string",
cors_rules=[{
"allowed_methods": ["string"],
"allowed_origins": ["string"],
"allowed_headers": ["string"],
"expose_headers": ["string"],
"max_age_seconds": 0,
}],
force_destroy=False,
hosted_zone_id="string",
lifecycle_rules=[{
"enabled": False,
"abort_incomplete_multipart_upload_days": 0,
"expirations": [{
"date": "string",
"days": 0,
"expired_object_delete_marker": False,
}],
"id": "string",
"noncurrent_version_expirations": [{
"days": 0,
}],
"prefix": "string",
}],
loggings=[{
"target_bucket": "string",
"target_prefix": "string",
}],
policy="string",
region="string",
s3_bucket_id="string",
tags={
"string": "string",
},
versioning={
"enabled": False,
"mfa_delete": False,
},
website={
"error_document": "string",
"index_document": "string",
"redirect_all_requests_to": "string",
"routing_rules": "string",
},
website_domain="string",
website_endpoint="string")
const s3bucketResource = new opentelekomcloud.S3Bucket("s3bucketResource", {
acl: "string",
arn: "string",
bucket: "string",
bucketPrefix: "string",
corsRules: [{
allowedMethods: ["string"],
allowedOrigins: ["string"],
allowedHeaders: ["string"],
exposeHeaders: ["string"],
maxAgeSeconds: 0,
}],
forceDestroy: false,
hostedZoneId: "string",
lifecycleRules: [{
enabled: false,
abortIncompleteMultipartUploadDays: 0,
expirations: [{
date: "string",
days: 0,
expiredObjectDeleteMarker: false,
}],
id: "string",
noncurrentVersionExpirations: [{
days: 0,
}],
prefix: "string",
}],
loggings: [{
targetBucket: "string",
targetPrefix: "string",
}],
policy: "string",
region: "string",
s3BucketId: "string",
tags: {
string: "string",
},
versioning: {
enabled: false,
mfaDelete: false,
},
website: {
errorDocument: "string",
indexDocument: "string",
redirectAllRequestsTo: "string",
routingRules: "string",
},
websiteDomain: "string",
websiteEndpoint: "string",
});
type: opentelekomcloud:S3Bucket
properties:
acl: string
arn: string
bucket: string
bucketPrefix: string
corsRules:
- allowedHeaders:
- string
allowedMethods:
- string
allowedOrigins:
- string
exposeHeaders:
- string
maxAgeSeconds: 0
forceDestroy: false
hostedZoneId: string
lifecycleRules:
- abortIncompleteMultipartUploadDays: 0
enabled: false
expirations:
- date: string
days: 0
expiredObjectDeleteMarker: false
id: string
noncurrentVersionExpirations:
- days: 0
prefix: string
loggings:
- targetBucket: string
targetPrefix: string
policy: string
region: string
s3BucketId: string
tags:
string: string
versioning:
enabled: false
mfaDelete: false
website:
errorDocument: string
indexDocument: string
redirectAllRequestsTo: string
routingRules: string
websiteDomain: string
websiteEndpoint: string
S3Bucket 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 S3Bucket resource accepts the following input properties:
- Acl string
- The canned ACL
to apply. Defaults to
private
. - Arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - Bucket string
- Bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - Cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- Force
Destroy bool - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- Hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- Lifecycle
Rules List<S3BucketLifecycle Rule> - A configuration of object lifecycle management
- Loggings
List<S3Bucket
Logging> - A settings of bucket logging (documented below).
- Policy string
- Region string
- S3Bucket
Id string - The name of the bucket.
- Dictionary<string, string>
- A mapping of tags to assign to the bucket.
- Versioning
S3Bucket
Versioning - A state of versioning (documented below)
- Website
S3Bucket
Website - A website object (documented below).
- Website
Domain string - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- Website
Endpoint string - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- Acl string
- The canned ACL
to apply. Defaults to
private
. - Arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - Bucket string
- Bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - Cors
Rules []S3BucketCors Rule Args - A rule of Cross-Origin Resource Sharing (documented below).
- Force
Destroy bool - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- Hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- Lifecycle
Rules []S3BucketLifecycle Rule Args - A configuration of object lifecycle management
- Loggings
[]S3Bucket
Logging Args - A settings of bucket logging (documented below).
- Policy string
- Region string
- S3Bucket
Id string - The name of the bucket.
- map[string]string
- A mapping of tags to assign to the bucket.
- Versioning
S3Bucket
Versioning Args - A state of versioning (documented below)
- Website
S3Bucket
Website Args - A website object (documented below).
- Website
Domain string - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- Website
Endpoint string - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl String
- The canned ACL
to apply. Defaults to
private
. - arn String
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket String
- bucket
Prefix String - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- force
Destroy Boolean - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted
Zone StringId - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle
Rules List<S3BucketLifecycle Rule> - A configuration of object lifecycle management
- loggings
List<S3Bucket
Logging> - A settings of bucket logging (documented below).
- policy String
- region String
- s3Bucket
Id String - The name of the bucket.
- Map<String,String>
- A mapping of tags to assign to the bucket.
- versioning
S3Bucket
Versioning - A state of versioning (documented below)
- website
S3Bucket
Website - A website object (documented below).
- website
Domain String - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website
Endpoint String - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl string
- The canned ACL
to apply. Defaults to
private
. - arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket string
- bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors
Rules S3BucketCors Rule[] - A rule of Cross-Origin Resource Sharing (documented below).
- force
Destroy boolean - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle
Rules S3BucketLifecycle Rule[] - A configuration of object lifecycle management
- loggings
S3Bucket
Logging[] - A settings of bucket logging (documented below).
- policy string
- region string
- s3Bucket
Id string - The name of the bucket.
- {[key: string]: string}
- A mapping of tags to assign to the bucket.
- versioning
S3Bucket
Versioning - A state of versioning (documented below)
- website
S3Bucket
Website - A website object (documented below).
- website
Domain string - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website
Endpoint string - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl str
- The canned ACL
to apply. Defaults to
private
. - arn str
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket str
- bucket_
prefix str - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors_
rules Sequence[S3BucketCors Rule Args] - A rule of Cross-Origin Resource Sharing (documented below).
- force_
destroy bool - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted_
zone_ strid - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle_
rules Sequence[S3BucketLifecycle Rule Args] - A configuration of object lifecycle management
- loggings
Sequence[S3Bucket
Logging Args] - A settings of bucket logging (documented below).
- policy str
- region str
- s3_
bucket_ strid - The name of the bucket.
- Mapping[str, str]
- A mapping of tags to assign to the bucket.
- versioning
S3Bucket
Versioning Args - A state of versioning (documented below)
- website
S3Bucket
Website Args - A website object (documented below).
- website_
domain str - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website_
endpoint str - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl String
- The canned ACL
to apply. Defaults to
private
. - arn String
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket String
- bucket
Prefix String - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors
Rules List<Property Map> - A rule of Cross-Origin Resource Sharing (documented below).
- force
Destroy Boolean - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted
Zone StringId - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle
Rules List<Property Map> - A configuration of object lifecycle management
- loggings List<Property Map>
- A settings of bucket logging (documented below).
- policy String
- region String
- s3Bucket
Id String - The name of the bucket.
- Map<String>
- A mapping of tags to assign to the bucket.
- versioning Property Map
- A state of versioning (documented below)
- website Property Map
- A website object (documented below).
- website
Domain String - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website
Endpoint String - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
Outputs
All input properties are implicitly available as output properties. Additionally, the S3Bucket resource produces the following output properties:
- Bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - Id string
- The provider-assigned unique ID for this managed resource.
- Bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - Id string
- The provider-assigned unique ID for this managed resource.
- bucket
Domain StringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - id String
- The provider-assigned unique ID for this managed resource.
- bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - id string
- The provider-assigned unique ID for this managed resource.
- bucket_
domain_ strname - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - id str
- The provider-assigned unique ID for this managed resource.
- bucket
Domain StringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - id String
- The provider-assigned unique ID for this managed resource.
Look up Existing S3Bucket Resource
Get an existing S3Bucket 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?: S3BucketState, opts?: CustomResourceOptions): S3Bucket
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
acl: Optional[str] = None,
arn: Optional[str] = None,
bucket: Optional[str] = None,
bucket_domain_name: Optional[str] = None,
bucket_prefix: Optional[str] = None,
cors_rules: Optional[Sequence[S3BucketCorsRuleArgs]] = None,
force_destroy: Optional[bool] = None,
hosted_zone_id: Optional[str] = None,
lifecycle_rules: Optional[Sequence[S3BucketLifecycleRuleArgs]] = None,
loggings: Optional[Sequence[S3BucketLoggingArgs]] = None,
policy: Optional[str] = None,
region: Optional[str] = None,
s3_bucket_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
versioning: Optional[S3BucketVersioningArgs] = None,
website: Optional[S3BucketWebsiteArgs] = None,
website_domain: Optional[str] = None,
website_endpoint: Optional[str] = None) -> S3Bucket
func GetS3Bucket(ctx *Context, name string, id IDInput, state *S3BucketState, opts ...ResourceOption) (*S3Bucket, error)
public static S3Bucket Get(string name, Input<string> id, S3BucketState? state, CustomResourceOptions? opts = null)
public static S3Bucket get(String name, Output<String> id, S3BucketState state, CustomResourceOptions options)
resources: _: type: opentelekomcloud:S3Bucket 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.
- Acl string
- The canned ACL
to apply. Defaults to
private
. - Arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - Bucket string
- Bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - Bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - Cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- Force
Destroy bool - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- Hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- Lifecycle
Rules List<S3BucketLifecycle Rule> - A configuration of object lifecycle management
- Loggings
List<S3Bucket
Logging> - A settings of bucket logging (documented below).
- Policy string
- Region string
- S3Bucket
Id string - The name of the bucket.
- Dictionary<string, string>
- A mapping of tags to assign to the bucket.
- Versioning
S3Bucket
Versioning - A state of versioning (documented below)
- Website
S3Bucket
Website - A website object (documented below).
- Website
Domain string - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- Website
Endpoint string - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- Acl string
- The canned ACL
to apply. Defaults to
private
. - Arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - Bucket string
- Bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - Bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - Cors
Rules []S3BucketCors Rule Args - A rule of Cross-Origin Resource Sharing (documented below).
- Force
Destroy bool - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- Hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- Lifecycle
Rules []S3BucketLifecycle Rule Args - A configuration of object lifecycle management
- Loggings
[]S3Bucket
Logging Args - A settings of bucket logging (documented below).
- Policy string
- Region string
- S3Bucket
Id string - The name of the bucket.
- map[string]string
- A mapping of tags to assign to the bucket.
- Versioning
S3Bucket
Versioning Args - A state of versioning (documented below)
- Website
S3Bucket
Website Args - A website object (documented below).
- Website
Domain string - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- Website
Endpoint string - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl String
- The canned ACL
to apply. Defaults to
private
. - arn String
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket String
- bucket
Domain StringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - bucket
Prefix String - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing (documented below).
- force
Destroy Boolean - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted
Zone StringId - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle
Rules List<S3BucketLifecycle Rule> - A configuration of object lifecycle management
- loggings
List<S3Bucket
Logging> - A settings of bucket logging (documented below).
- policy String
- region String
- s3Bucket
Id String - The name of the bucket.
- Map<String,String>
- A mapping of tags to assign to the bucket.
- versioning
S3Bucket
Versioning - A state of versioning (documented below)
- website
S3Bucket
Website - A website object (documented below).
- website
Domain String - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website
Endpoint String - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl string
- The canned ACL
to apply. Defaults to
private
. - arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket string
- bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors
Rules S3BucketCors Rule[] - A rule of Cross-Origin Resource Sharing (documented below).
- force
Destroy boolean - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle
Rules S3BucketLifecycle Rule[] - A configuration of object lifecycle management
- loggings
S3Bucket
Logging[] - A settings of bucket logging (documented below).
- policy string
- region string
- s3Bucket
Id string - The name of the bucket.
- {[key: string]: string}
- A mapping of tags to assign to the bucket.
- versioning
S3Bucket
Versioning - A state of versioning (documented below)
- website
S3Bucket
Website - A website object (documented below).
- website
Domain string - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website
Endpoint string - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl str
- The canned ACL
to apply. Defaults to
private
. - arn str
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket str
- bucket_
domain_ strname - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - bucket_
prefix str - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors_
rules Sequence[S3BucketCors Rule Args] - A rule of Cross-Origin Resource Sharing (documented below).
- force_
destroy bool - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted_
zone_ strid - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle_
rules Sequence[S3BucketLifecycle Rule Args] - A configuration of object lifecycle management
- loggings
Sequence[S3Bucket
Logging Args] - A settings of bucket logging (documented below).
- policy str
- region str
- s3_
bucket_ strid - The name of the bucket.
- Mapping[str, str]
- A mapping of tags to assign to the bucket.
- versioning
S3Bucket
Versioning Args - A state of versioning (documented below)
- website
S3Bucket
Website Args - A website object (documented below).
- website_
domain str - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website_
endpoint str - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
- acl String
- The canned ACL
to apply. Defaults to
private
. - arn String
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket String
- bucket
Domain StringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - bucket
Prefix String - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. - cors
Rules List<Property Map> - A rule of Cross-Origin Resource Sharing (documented below).
- force
Destroy Boolean - A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable.
- hosted
Zone StringId - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle
Rules List<Property Map> - A configuration of object lifecycle management
- loggings List<Property Map>
- A settings of bucket logging (documented below).
- policy String
- region String
- s3Bucket
Id String - The name of the bucket.
- Map<String>
- A mapping of tags to assign to the bucket.
- versioning Property Map
- A state of versioning (documented below)
- website Property Map
- A website object (documented below).
- website
Domain String - The domain of the website endpoint, if the bucket is configured with a website. If not, this will be an empty string. This is used to create Route 53 alias records.
- website
Endpoint String - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.
Supporting Types
S3BucketCorsRule, S3BucketCorsRuleArgs
- Allowed
Methods List<string> - Specifies which methods are allowed. Can be
GET
,PUT
,POST
,DELETE
orHEAD
. - Allowed
Origins List<string> - Specifies which origins are allowed.
- Allowed
Headers List<string> - Specifies which headers are allowed.
- Expose
Headers List<string> - Specifies expose header in the response.
- Max
Age doubleSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
- Allowed
Methods []string - Specifies which methods are allowed. Can be
GET
,PUT
,POST
,DELETE
orHEAD
. - Allowed
Origins []string - Specifies which origins are allowed.
- Allowed
Headers []string - Specifies which headers are allowed.
- Expose
Headers []string - Specifies expose header in the response.
- Max
Age float64Seconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed
Methods List<String> - Specifies which methods are allowed. Can be
GET
,PUT
,POST
,DELETE
orHEAD
. - allowed
Origins List<String> - Specifies which origins are allowed.
- allowed
Headers List<String> - Specifies which headers are allowed.
- expose
Headers List<String> - Specifies expose header in the response.
- max
Age DoubleSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed
Methods string[] - Specifies which methods are allowed. Can be
GET
,PUT
,POST
,DELETE
orHEAD
. - allowed
Origins string[] - Specifies which origins are allowed.
- allowed
Headers string[] - Specifies which headers are allowed.
- expose
Headers string[] - Specifies expose header in the response.
- max
Age numberSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed_
methods Sequence[str] - Specifies which methods are allowed. Can be
GET
,PUT
,POST
,DELETE
orHEAD
. - allowed_
origins Sequence[str] - Specifies which origins are allowed.
- allowed_
headers Sequence[str] - Specifies which headers are allowed.
- expose_
headers Sequence[str] - Specifies expose header in the response.
- max_
age_ floatseconds - Specifies time in seconds that browser can cache the response for a preflight request.
- allowed
Methods List<String> - Specifies which methods are allowed. Can be
GET
,PUT
,POST
,DELETE
orHEAD
. - allowed
Origins List<String> - Specifies which origins are allowed.
- allowed
Headers List<String> - Specifies which headers are allowed.
- expose
Headers List<String> - Specifies expose header in the response.
- max
Age NumberSeconds - Specifies time in seconds that browser can cache the response for a preflight request.
S3BucketLifecycleRule, S3BucketLifecycleRuleArgs
- Enabled bool
- Specifies lifecycle rule status.
- Abort
Incomplete doubleMultipart Upload Days - Specifies the number of days after initiating a multipart upload when the multipart upload must be completed.
- Expirations
List<S3Bucket
Lifecycle Rule Expiration> - Specifies a period in the object's expire (documented below).
- Id string
- Unique identifier for the rule.
- Noncurrent
Version List<S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration> Specifies when noncurrent object versions expire (documented below).
At least one of
expiration
,noncurrent_version_expiration
must be specified.- Prefix string
- Object key prefix identifying one or more objects to which the rule applies.
- Enabled bool
- Specifies lifecycle rule status.
- Abort
Incomplete float64Multipart Upload Days - Specifies the number of days after initiating a multipart upload when the multipart upload must be completed.
- Expirations
[]S3Bucket
Lifecycle Rule Expiration - Specifies a period in the object's expire (documented below).
- Id string
- Unique identifier for the rule.
- Noncurrent
Version []S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration Specifies when noncurrent object versions expire (documented below).
At least one of
expiration
,noncurrent_version_expiration
must be specified.- Prefix string
- Object key prefix identifying one or more objects to which the rule applies.
- enabled Boolean
- Specifies lifecycle rule status.
- abort
Incomplete DoubleMultipart Upload Days - Specifies the number of days after initiating a multipart upload when the multipart upload must be completed.
- expirations
List<S3Bucket
Lifecycle Rule Expiration> - Specifies a period in the object's expire (documented below).
- id String
- Unique identifier for the rule.
- noncurrent
Version List<S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration> Specifies when noncurrent object versions expire (documented below).
At least one of
expiration
,noncurrent_version_expiration
must be specified.- prefix String
- Object key prefix identifying one or more objects to which the rule applies.
- enabled boolean
- Specifies lifecycle rule status.
- abort
Incomplete numberMultipart Upload Days - Specifies the number of days after initiating a multipart upload when the multipart upload must be completed.
- expirations
S3Bucket
Lifecycle Rule Expiration[] - Specifies a period in the object's expire (documented below).
- id string
- Unique identifier for the rule.
- noncurrent
Version S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration[] Specifies when noncurrent object versions expire (documented below).
At least one of
expiration
,noncurrent_version_expiration
must be specified.- prefix string
- Object key prefix identifying one or more objects to which the rule applies.
- enabled bool
- Specifies lifecycle rule status.
- abort_
incomplete_ floatmultipart_ upload_ days - Specifies the number of days after initiating a multipart upload when the multipart upload must be completed.
- expirations
Sequence[S3Bucket
Lifecycle Rule Expiration] - Specifies a period in the object's expire (documented below).
- id str
- Unique identifier for the rule.
- noncurrent_
version_ Sequence[S3Bucketexpirations Lifecycle Rule Noncurrent Version Expiration] Specifies when noncurrent object versions expire (documented below).
At least one of
expiration
,noncurrent_version_expiration
must be specified.- prefix str
- Object key prefix identifying one or more objects to which the rule applies.
- enabled Boolean
- Specifies lifecycle rule status.
- abort
Incomplete NumberMultipart Upload Days - Specifies the number of days after initiating a multipart upload when the multipart upload must be completed.
- expirations List<Property Map>
- Specifies a period in the object's expire (documented below).
- id String
- Unique identifier for the rule.
- noncurrent
Version List<Property Map>Expirations Specifies when noncurrent object versions expire (documented below).
At least one of
expiration
,noncurrent_version_expiration
must be specified.- prefix String
- Object key prefix identifying one or more objects to which the rule applies.
S3BucketLifecycleRuleExpiration, S3BucketLifecycleRuleExpirationArgs
- Date string
- Specifies the date after which you want the corresponding action to take effect.
- Days double
- Specifies the number of days after object creation when the specific rule action takes effect.
- Expired
Object boolDelete Marker - On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Amazon S3 to delete expired object delete markers.
- Date string
- Specifies the date after which you want the corresponding action to take effect.
- Days float64
- Specifies the number of days after object creation when the specific rule action takes effect.
- Expired
Object boolDelete Marker - On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Amazon S3 to delete expired object delete markers.
- date String
- Specifies the date after which you want the corresponding action to take effect.
- days Double
- Specifies the number of days after object creation when the specific rule action takes effect.
- expired
Object BooleanDelete Marker - On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Amazon S3 to delete expired object delete markers.
- date string
- Specifies the date after which you want the corresponding action to take effect.
- days number
- Specifies the number of days after object creation when the specific rule action takes effect.
- expired
Object booleanDelete Marker - On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Amazon S3 to delete expired object delete markers.
- date str
- Specifies the date after which you want the corresponding action to take effect.
- days float
- Specifies the number of days after object creation when the specific rule action takes effect.
- expired_
object_ booldelete_ marker - On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Amazon S3 to delete expired object delete markers.
- date String
- Specifies the date after which you want the corresponding action to take effect.
- days Number
- Specifies the number of days after object creation when the specific rule action takes effect.
- expired
Object BooleanDelete Marker - On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Amazon S3 to delete expired object delete markers.
S3BucketLifecycleRuleNoncurrentVersionExpiration, S3BucketLifecycleRuleNoncurrentVersionExpirationArgs
- Days double
- Specifies the number of days an object is noncurrent object versions expire.
- Days float64
- Specifies the number of days an object is noncurrent object versions expire.
- days Double
- Specifies the number of days an object is noncurrent object versions expire.
- days number
- Specifies the number of days an object is noncurrent object versions expire.
- days float
- Specifies the number of days an object is noncurrent object versions expire.
- days Number
- Specifies the number of days an object is noncurrent object versions expire.
S3BucketLogging, S3BucketLoggingArgs
- Target
Bucket string - The name of the bucket that will receive the log objects.
- Target
Prefix string - To specify a key prefix for log objects.
- Target
Bucket string - The name of the bucket that will receive the log objects.
- Target
Prefix string - To specify a key prefix for log objects.
- target
Bucket String - The name of the bucket that will receive the log objects.
- target
Prefix String - To specify a key prefix for log objects.
- target
Bucket string - The name of the bucket that will receive the log objects.
- target
Prefix string - To specify a key prefix for log objects.
- target_
bucket str - The name of the bucket that will receive the log objects.
- target_
prefix str - To specify a key prefix for log objects.
- target
Bucket String - The name of the bucket that will receive the log objects.
- target
Prefix String - To specify a key prefix for log objects.
S3BucketVersioning, S3BucketVersioningArgs
- Enabled bool
- Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state.
You can, however, suspend versioning on that bucket. If omitted, during bucket creation it will be in
Disabled
state. - Mfa
Delete bool - Enable MFA delete for either
Change the versioning state of your bucket
orPermanently delete an object version
. Default isfalse
.
- Enabled bool
- Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state.
You can, however, suspend versioning on that bucket. If omitted, during bucket creation it will be in
Disabled
state. - Mfa
Delete bool - Enable MFA delete for either
Change the versioning state of your bucket
orPermanently delete an object version
. Default isfalse
.
- enabled Boolean
- Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state.
You can, however, suspend versioning on that bucket. If omitted, during bucket creation it will be in
Disabled
state. - mfa
Delete Boolean - Enable MFA delete for either
Change the versioning state of your bucket
orPermanently delete an object version
. Default isfalse
.
- enabled boolean
- Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state.
You can, however, suspend versioning on that bucket. If omitted, during bucket creation it will be in
Disabled
state. - mfa
Delete boolean - Enable MFA delete for either
Change the versioning state of your bucket
orPermanently delete an object version
. Default isfalse
.
- enabled bool
- Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state.
You can, however, suspend versioning on that bucket. If omitted, during bucket creation it will be in
Disabled
state. - mfa_
delete bool - Enable MFA delete for either
Change the versioning state of your bucket
orPermanently delete an object version
. Default isfalse
.
- enabled Boolean
- Enable versioning. Once you version-enable a bucket, it can never return to an unversioned state.
You can, however, suspend versioning on that bucket. If omitted, during bucket creation it will be in
Disabled
state. - mfa
Delete Boolean - Enable MFA delete for either
Change the versioning state of your bucket
orPermanently delete an object version
. Default isfalse
.
S3BucketWebsite, S3BucketWebsiteArgs
- Error
Document string - An absolute path to the document to return in case of a 4XX error.
- Index
Document string - Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders.
- Redirect
All stringRequests To - A hostname to redirect all website requests for this bucket to.
Hostname can optionally be prefixed with a protocol (
http://
orhttps://
) to use when redirecting requests. The default is the protocol that is used in the original request. - Routing
Rules string - A json array containing routing rules describing redirect behavior and when redirects are applied.
- Error
Document string - An absolute path to the document to return in case of a 4XX error.
- Index
Document string - Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders.
- Redirect
All stringRequests To - A hostname to redirect all website requests for this bucket to.
Hostname can optionally be prefixed with a protocol (
http://
orhttps://
) to use when redirecting requests. The default is the protocol that is used in the original request. - Routing
Rules string - A json array containing routing rules describing redirect behavior and when redirects are applied.
- error
Document String - An absolute path to the document to return in case of a 4XX error.
- index
Document String - Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders.
- redirect
All StringRequests To - A hostname to redirect all website requests for this bucket to.
Hostname can optionally be prefixed with a protocol (
http://
orhttps://
) to use when redirecting requests. The default is the protocol that is used in the original request. - routing
Rules String - A json array containing routing rules describing redirect behavior and when redirects are applied.
- error
Document string - An absolute path to the document to return in case of a 4XX error.
- index
Document string - Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders.
- redirect
All stringRequests To - A hostname to redirect all website requests for this bucket to.
Hostname can optionally be prefixed with a protocol (
http://
orhttps://
) to use when redirecting requests. The default is the protocol that is used in the original request. - routing
Rules string - A json array containing routing rules describing redirect behavior and when redirects are applied.
- error_
document str - An absolute path to the document to return in case of a 4XX error.
- index_
document str - Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders.
- redirect_
all_ strrequests_ to - A hostname to redirect all website requests for this bucket to.
Hostname can optionally be prefixed with a protocol (
http://
orhttps://
) to use when redirecting requests. The default is the protocol that is used in the original request. - routing_
rules str - A json array containing routing rules describing redirect behavior and when redirects are applied.
- error
Document String - An absolute path to the document to return in case of a 4XX error.
- index
Document String - Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders.
- redirect
All StringRequests To - A hostname to redirect all website requests for this bucket to.
Hostname can optionally be prefixed with a protocol (
http://
orhttps://
) to use when redirecting requests. The default is the protocol that is used in the original request. - routing
Rules String - A json array containing routing rules describing redirect behavior and when redirects are applied.
Import
S3 bucket can be imported using the bucket
, e.g.
$ pulumi import opentelekomcloud:index/s3Bucket:S3Bucket bucket bucket-name
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
- License
- Notes
- This Pulumi package is based on the
opentelekomcloud
Terraform Provider.