flexibleengine.S3Bucket
Explore with Pulumi AI
Provides a S3 bucket resource.
Example Usage
Private Bucket w/ Tags
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const s3Bucket = new flexibleengine.S3Bucket("s3Bucket", {
acl: "private",
bucket: "my-tf-test-bucket",
});
import pulumi
import pulumi_flexibleengine as flexibleengine
s3_bucket = flexibleengine.S3Bucket("s3Bucket",
acl="private",
bucket="my-tf-test-bucket")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := flexibleengine.NewS3Bucket(ctx, "s3Bucket", &flexibleengine.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-tf-test-bucket"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var s3Bucket = new Flexibleengine.S3Bucket("s3Bucket", new()
{
Acl = "private",
Bucket = "my-tf-test-bucket",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.S3Bucket;
import com.pulumi.flexibleengine.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 s3Bucket = new S3Bucket("s3Bucket", S3BucketArgs.builder()
.acl("private")
.bucket("my-tf-test-bucket")
.build());
}
}
resources:
s3Bucket:
type: flexibleengine:S3Bucket
properties:
acl: private
bucket: my-tf-test-bucket
Static Website Hosting
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
import * as fs from "fs";
const s3Bucket = new flexibleengine.S3Bucket("s3Bucket", {
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_flexibleengine as flexibleengine
s3_bucket = flexibleengine.S3Bucket("s3Bucket",
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/flexibleengine/flexibleengine"
"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 := flexibleengine.NewS3Bucket(ctx, "s3Bucket", &flexibleengine.S3BucketArgs{
Bucket: pulumi.String("s3-website-test.hashicorp.com"),
Acl: pulumi.String("public-read"),
Policy: pulumi.String(readFileOrPanic("policy.json")),
Website: &flexibleengine.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 Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var s3Bucket = new Flexibleengine.S3Bucket("s3Bucket", new()
{
Bucket = "s3-website-test.hashicorp.com",
Acl = "public-read",
Policy = File.ReadAllText("policy.json"),
Website = new Flexibleengine.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.flexibleengine.S3Bucket;
import com.pulumi.flexibleengine.S3BucketArgs;
import com.pulumi.flexibleengine.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 s3Bucket = new S3Bucket("s3Bucket", 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:
s3Bucket:
type: flexibleengine: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 flexibleengine from "@pulumi/flexibleengine";
const s3Bucket = new flexibleengine.S3Bucket("s3Bucket", {
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_flexibleengine as flexibleengine
s3_bucket = flexibleengine.S3Bucket("s3Bucket",
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/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := flexibleengine.NewS3Bucket(ctx, "s3Bucket", &flexibleengine.S3BucketArgs{
Acl: pulumi.String("public-read"),
Bucket: pulumi.String("s3-website-test.hashicorp.com"),
CorsRules: flexibleengine.S3BucketCorsRuleArray{
&flexibleengine.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 Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var s3Bucket = new Flexibleengine.S3Bucket("s3Bucket", new()
{
Acl = "public-read",
Bucket = "s3-website-test.hashicorp.com",
CorsRules = new[]
{
new Flexibleengine.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.flexibleengine.S3Bucket;
import com.pulumi.flexibleengine.S3BucketArgs;
import com.pulumi.flexibleengine.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 s3Bucket = new S3Bucket("s3Bucket", 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:
s3Bucket:
type: flexibleengine: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 flexibleengine from "@pulumi/flexibleengine";
const s3Bucket = new flexibleengine.S3Bucket("s3Bucket", {
acl: "private",
bucket: "my-tf-test-bucket",
versioning: {
enabled: true,
},
});
import pulumi
import pulumi_flexibleengine as flexibleengine
s3_bucket = flexibleengine.S3Bucket("s3Bucket",
acl="private",
bucket="my-tf-test-bucket",
versioning={
"enabled": True,
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := flexibleengine.NewS3Bucket(ctx, "s3Bucket", &flexibleengine.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-tf-test-bucket"),
Versioning: &flexibleengine.S3BucketVersioningArgs{
Enabled: pulumi.Bool(true),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var s3Bucket = new Flexibleengine.S3Bucket("s3Bucket", new()
{
Acl = "private",
Bucket = "my-tf-test-bucket",
Versioning = new Flexibleengine.Inputs.S3BucketVersioningArgs
{
Enabled = true,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.S3Bucket;
import com.pulumi.flexibleengine.S3BucketArgs;
import com.pulumi.flexibleengine.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 s3Bucket = new S3Bucket("s3Bucket", S3BucketArgs.builder()
.acl("private")
.bucket("my-tf-test-bucket")
.versioning(S3BucketVersioningArgs.builder()
.enabled(true)
.build())
.build());
}
}
resources:
s3Bucket:
type: flexibleengine:S3Bucket
properties:
acl: private
bucket: my-tf-test-bucket
versioning:
enabled: true
Enable Logging
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const logBucket = new flexibleengine.S3Bucket("logBucket", {
bucket: "my-tf-log-bucket",
acl: "log-delivery-write",
});
const s3Bucket = new flexibleengine.S3Bucket("s3Bucket", {
bucket: "my-tf-test-bucket",
acl: "private",
loggings: [{
targetBucket: logBucket.s3BucketId,
targetPrefix: "log/",
}],
});
import pulumi
import pulumi_flexibleengine as flexibleengine
log_bucket = flexibleengine.S3Bucket("logBucket",
bucket="my-tf-log-bucket",
acl="log-delivery-write")
s3_bucket = flexibleengine.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/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
logBucket, err := flexibleengine.NewS3Bucket(ctx, "logBucket", &flexibleengine.S3BucketArgs{
Bucket: pulumi.String("my-tf-log-bucket"),
Acl: pulumi.String("log-delivery-write"),
})
if err != nil {
return err
}
_, err = flexibleengine.NewS3Bucket(ctx, "s3Bucket", &flexibleengine.S3BucketArgs{
Bucket: pulumi.String("my-tf-test-bucket"),
Acl: pulumi.String("private"),
Loggings: flexibleengine.S3BucketLoggingArray{
&flexibleengine.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 Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var logBucket = new Flexibleengine.S3Bucket("logBucket", new()
{
Bucket = "my-tf-log-bucket",
Acl = "log-delivery-write",
});
var s3Bucket = new Flexibleengine.S3Bucket("s3Bucket", new()
{
Bucket = "my-tf-test-bucket",
Acl = "private",
Loggings = new[]
{
new Flexibleengine.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.flexibleengine.S3Bucket;
import com.pulumi.flexibleengine.S3BucketArgs;
import com.pulumi.flexibleengine.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: flexibleengine:S3Bucket
properties:
bucket: my-tf-log-bucket
acl: log-delivery-write
s3Bucket:
type: flexibleengine: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 flexibleengine from "@pulumi/flexibleengine";
const bucket = new flexibleengine.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 flexibleengine.S3Bucket("versioningBucket", {
acl: "private",
bucket: "my-versioning-bucket",
lifecycleRules: [{
enabled: true,
prefix: "config/",
}],
versioning: {
enabled: true,
},
});
import pulumi
import pulumi_flexibleengine as flexibleengine
bucket = flexibleengine.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 = flexibleengine.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/flexibleengine/flexibleengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := flexibleengine.NewS3Bucket(ctx, "bucket", &flexibleengine.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-bucket"),
LifecycleRules: flexibleengine.S3BucketLifecycleRuleArray{
&flexibleengine.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(true),
Expirations: flexibleengine.S3BucketLifecycleRuleExpirationArray{
&flexibleengine.S3BucketLifecycleRuleExpirationArgs{
Days: pulumi.Float64(90),
},
},
Id: pulumi.String("log"),
Prefix: pulumi.String("log/"),
},
&flexibleengine.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(true),
Expirations: flexibleengine.S3BucketLifecycleRuleExpirationArray{
&flexibleengine.S3BucketLifecycleRuleExpirationArgs{
Date: pulumi.String("2016-01-12"),
},
},
Id: pulumi.String("tmp"),
Prefix: pulumi.String("tmp/"),
},
},
})
if err != nil {
return err
}
_, err = flexibleengine.NewS3Bucket(ctx, "versioningBucket", &flexibleengine.S3BucketArgs{
Acl: pulumi.String("private"),
Bucket: pulumi.String("my-versioning-bucket"),
LifecycleRules: flexibleengine.S3BucketLifecycleRuleArray{
&flexibleengine.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(true),
Prefix: pulumi.String("config/"),
},
},
Versioning: &flexibleengine.S3BucketVersioningArgs{
Enabled: pulumi.Bool(true),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var bucket = new Flexibleengine.S3Bucket("bucket", new()
{
Acl = "private",
Bucket = "my-bucket",
LifecycleRules = new[]
{
new Flexibleengine.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = true,
Expirations = new[]
{
new Flexibleengine.Inputs.S3BucketLifecycleRuleExpirationArgs
{
Days = 90,
},
},
Id = "log",
Prefix = "log/",
},
new Flexibleengine.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = true,
Expirations = new[]
{
new Flexibleengine.Inputs.S3BucketLifecycleRuleExpirationArgs
{
Date = "2016-01-12",
},
},
Id = "tmp",
Prefix = "tmp/",
},
},
});
var versioningBucket = new Flexibleengine.S3Bucket("versioningBucket", new()
{
Acl = "private",
Bucket = "my-versioning-bucket",
LifecycleRules = new[]
{
new Flexibleengine.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = true,
Prefix = "config/",
},
},
Versioning = new Flexibleengine.Inputs.S3BucketVersioningArgs
{
Enabled = true,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.S3Bucket;
import com.pulumi.flexibleengine.S3BucketArgs;
import com.pulumi.flexibleengine.inputs.S3BucketLifecycleRuleArgs;
import com.pulumi.flexibleengine.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: flexibleengine: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: flexibleengine: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,
bucket: Optional[str] = None,
bucket_prefix: Optional[str] = None,
cors_rules: Optional[Sequence[S3BucketCorsRuleArgs]] = None,
force_destroy: Optional[bool] = 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,
versioning: Optional[S3BucketVersioningArgs] = None,
website: Optional[S3BucketWebsiteArgs] = 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: flexibleengine: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 Flexibleengine.S3Bucket("s3bucketResource", new()
{
Acl = "string",
Bucket = "string",
BucketPrefix = "string",
CorsRules = new[]
{
new Flexibleengine.Inputs.S3BucketCorsRuleArgs
{
AllowedMethods = new[]
{
"string",
},
AllowedOrigins = new[]
{
"string",
},
AllowedHeaders = new[]
{
"string",
},
ExposeHeaders = new[]
{
"string",
},
MaxAgeSeconds = 0,
},
},
ForceDestroy = false,
LifecycleRules = new[]
{
new Flexibleengine.Inputs.S3BucketLifecycleRuleArgs
{
Enabled = false,
AbortIncompleteMultipartUploadDays = 0,
Expirations = new[]
{
new Flexibleengine.Inputs.S3BucketLifecycleRuleExpirationArgs
{
Date = "string",
Days = 0,
ExpiredObjectDeleteMarker = false,
},
},
Id = "string",
NoncurrentVersionExpirations = new[]
{
new Flexibleengine.Inputs.S3BucketLifecycleRuleNoncurrentVersionExpirationArgs
{
Days = 0,
},
},
Prefix = "string",
},
},
Loggings = new[]
{
new Flexibleengine.Inputs.S3BucketLoggingArgs
{
TargetBucket = "string",
TargetPrefix = "string",
},
},
Policy = "string",
Region = "string",
S3BucketId = "string",
Versioning = new Flexibleengine.Inputs.S3BucketVersioningArgs
{
Enabled = false,
MfaDelete = false,
},
Website = new Flexibleengine.Inputs.S3BucketWebsiteArgs
{
ErrorDocument = "string",
IndexDocument = "string",
RedirectAllRequestsTo = "string",
RoutingRules = "string",
},
});
example, err := flexibleengine.NewS3Bucket(ctx, "s3bucketResource", &flexibleengine.S3BucketArgs{
Acl: pulumi.String("string"),
Bucket: pulumi.String("string"),
BucketPrefix: pulumi.String("string"),
CorsRules: flexibleengine.S3BucketCorsRuleArray{
&flexibleengine.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),
LifecycleRules: flexibleengine.S3BucketLifecycleRuleArray{
&flexibleengine.S3BucketLifecycleRuleArgs{
Enabled: pulumi.Bool(false),
AbortIncompleteMultipartUploadDays: pulumi.Float64(0),
Expirations: flexibleengine.S3BucketLifecycleRuleExpirationArray{
&flexibleengine.S3BucketLifecycleRuleExpirationArgs{
Date: pulumi.String("string"),
Days: pulumi.Float64(0),
ExpiredObjectDeleteMarker: pulumi.Bool(false),
},
},
Id: pulumi.String("string"),
NoncurrentVersionExpirations: flexibleengine.S3BucketLifecycleRuleNoncurrentVersionExpirationArray{
&flexibleengine.S3BucketLifecycleRuleNoncurrentVersionExpirationArgs{
Days: pulumi.Float64(0),
},
},
Prefix: pulumi.String("string"),
},
},
Loggings: flexibleengine.S3BucketLoggingArray{
&flexibleengine.S3BucketLoggingArgs{
TargetBucket: pulumi.String("string"),
TargetPrefix: pulumi.String("string"),
},
},
Policy: pulumi.String("string"),
Region: pulumi.String("string"),
S3BucketId: pulumi.String("string"),
Versioning: &flexibleengine.S3BucketVersioningArgs{
Enabled: pulumi.Bool(false),
MfaDelete: pulumi.Bool(false),
},
Website: &flexibleengine.S3BucketWebsiteArgs{
ErrorDocument: pulumi.String("string"),
IndexDocument: pulumi.String("string"),
RedirectAllRequestsTo: pulumi.String("string"),
RoutingRules: pulumi.String("string"),
},
})
var s3bucketResource = new S3Bucket("s3bucketResource", S3BucketArgs.builder()
.acl("string")
.bucket("string")
.bucketPrefix("string")
.corsRules(S3BucketCorsRuleArgs.builder()
.allowedMethods("string")
.allowedOrigins("string")
.allowedHeaders("string")
.exposeHeaders("string")
.maxAgeSeconds(0)
.build())
.forceDestroy(false)
.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")
.versioning(S3BucketVersioningArgs.builder()
.enabled(false)
.mfaDelete(false)
.build())
.website(S3BucketWebsiteArgs.builder()
.errorDocument("string")
.indexDocument("string")
.redirectAllRequestsTo("string")
.routingRules("string")
.build())
.build());
s3bucket_resource = flexibleengine.S3Bucket("s3bucketResource",
acl="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,
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",
versioning={
"enabled": False,
"mfa_delete": False,
},
website={
"error_document": "string",
"index_document": "string",
"redirect_all_requests_to": "string",
"routing_rules": "string",
})
const s3bucketResource = new flexibleengine.S3Bucket("s3bucketResource", {
acl: "string",
bucket: "string",
bucketPrefix: "string",
corsRules: [{
allowedMethods: ["string"],
allowedOrigins: ["string"],
allowedHeaders: ["string"],
exposeHeaders: ["string"],
maxAgeSeconds: 0,
}],
forceDestroy: false,
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",
versioning: {
enabled: false,
mfaDelete: false,
},
website: {
errorDocument: "string",
indexDocument: "string",
redirectAllRequestsTo: "string",
routingRules: "string",
},
});
type: flexibleengine:S3Bucket
properties:
acl: string
bucket: string
bucketPrefix: string
corsRules:
- allowedHeaders:
- string
allowedMethods:
- string
allowedOrigins:
- string
exposeHeaders:
- string
maxAgeSeconds: 0
forceDestroy: false
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
versioning:
enabled: false
mfaDelete: false
website:
errorDocument: string
indexDocument: string
redirectAllRequestsTo: string
routingRules: 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.
- Bucket string
- Bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. Changing this will create a new resource. - Cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- Lifecycle
Rules List<S3BucketLifecycle Rule> A configuration of object lifecycle management The lifecycle_rule object structure is documented below.
The
website
object supports:- Loggings
List<S3Bucket
Logging> - A settings of bucket logging. The logging object structure is documented below.
- Policy string
- Region string
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- S3Bucket
Id string - Unique identifier for the rule.
- Versioning
S3Bucket
Versioning - A state of versioning. The versioning object structure is documented below.
- Website
S3Bucket
Website - A website object. The website object structure is documented below.
- Acl string
- The canned ACL to apply. Defaults to private.
- Bucket string
- Bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. Changing this will create a new resource. - Cors
Rules []S3BucketCors Rule Args - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- Lifecycle
Rules []S3BucketLifecycle Rule Args A configuration of object lifecycle management The lifecycle_rule object structure is documented below.
The
website
object supports:- Loggings
[]S3Bucket
Logging Args - A settings of bucket logging. The logging object structure is documented below.
- Policy string
- Region string
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- S3Bucket
Id string - Unique identifier for the rule.
- Versioning
S3Bucket
Versioning Args - A state of versioning. The versioning object structure is documented below.
- Website
S3Bucket
Website Args - A website object. The website object structure is documented below.
- acl String
- The canned ACL to apply. Defaults to private.
- bucket String
- bucket
Prefix String - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. Changing this will create a new resource. - cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- lifecycle
Rules List<S3BucketLifecycle Rule> A configuration of object lifecycle management The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings
List<S3Bucket
Logging> - A settings of bucket logging. The logging object structure is documented below.
- policy String
- region String
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3Bucket
Id String - Unique identifier for the rule.
- versioning
S3Bucket
Versioning - A state of versioning. The versioning object structure is documented below.
- website
S3Bucket
Website - A website object. The website object structure is documented below.
- acl string
- The canned ACL to apply. Defaults to private.
- bucket string
- bucket
Prefix string - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. Changing this will create a new resource. - cors
Rules S3BucketCors Rule[] - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- lifecycle
Rules S3BucketLifecycle Rule[] A configuration of object lifecycle management The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings
S3Bucket
Logging[] - A settings of bucket logging. The logging object structure is documented below.
- policy string
- region string
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3Bucket
Id string - Unique identifier for the rule.
- versioning
S3Bucket
Versioning - A state of versioning. The versioning object structure is documented below.
- website
S3Bucket
Website - A website object. The website object structure is documented below.
- acl str
- The canned ACL to apply. Defaults to private.
- bucket str
- bucket_
prefix str - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. Changing this will create a new resource. - cors_
rules Sequence[S3BucketCors Rule Args] - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- lifecycle_
rules Sequence[S3BucketLifecycle Rule Args] A configuration of object lifecycle management The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings
Sequence[S3Bucket
Logging Args] - A settings of bucket logging. The logging object structure is documented below.
- policy str
- region str
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3_
bucket_ strid - Unique identifier for the rule.
- versioning
S3Bucket
Versioning Args - A state of versioning. The versioning object structure is documented below.
- website
S3Bucket
Website Args - A website object. The website object structure is documented below.
- acl String
- The canned ACL to apply. Defaults to private.
- bucket String
- bucket
Prefix String - Creates a unique bucket name beginning with the specified prefix.
Conflicts with
bucket
. Changing this will create a new resource. - cors
Rules List<Property Map> - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- lifecycle
Rules List<Property Map> A configuration of object lifecycle management The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings List<Property Map>
- A settings of bucket logging. The logging object structure is documented below.
- policy String
- region String
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3Bucket
Id String - Unique identifier for the rule.
- versioning Property Map
- A state of versioning. The versioning object structure is documented below.
- website Property Map
- A website object. The website object structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the S3Bucket resource produces the following output properties:
- Arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - Bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - Hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- Id string
- The provider-assigned unique ID for this managed resource.
- 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.
- Arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - Bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - Hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- Id string
- The provider-assigned unique ID for this managed resource.
- 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.
- arn String
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket
Domain StringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - hosted
Zone StringId - The Route 53 Hosted Zone ID for this bucket's region.
- id String
- The provider-assigned unique ID for this managed resource.
- 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.
- arn string
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket
Domain stringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- id string
- The provider-assigned unique ID for this managed resource.
- 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.
- arn str
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket_
domain_ strname - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - hosted_
zone_ strid - The Route 53 Hosted Zone ID for this bucket's region.
- id str
- The provider-assigned unique ID for this managed resource.
- 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.
- arn String
- The ARN of the bucket. Will be of format
arn:aws:s3:::bucketname
. - bucket
Domain StringName - The bucket domain name. Will be of format
bucketname.s3.amazonaws.com
. - hosted
Zone StringId - The Route 53 Hosted Zone ID for this bucket's region.
- id String
- The provider-assigned unique ID for this managed resource.
- 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.
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,
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: flexibleengine: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
. Changing this will create a new resource. - Cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- 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 The lifecycle_rule object structure is documented below.
The
website
object supports:- Loggings
List<S3Bucket
Logging> - A settings of bucket logging. The logging object structure is documented below.
- Policy string
- Region string
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- S3Bucket
Id string - Unique identifier for the rule.
- Versioning
S3Bucket
Versioning - A state of versioning. The versioning object structure is documented below.
- Website
S3Bucket
Website - A website object. The website object structure is 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
. Changing this will create a new resource. - Cors
Rules []S3BucketCors Rule Args - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- 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 The lifecycle_rule object structure is documented below.
The
website
object supports:- Loggings
[]S3Bucket
Logging Args - A settings of bucket logging. The logging object structure is documented below.
- Policy string
- Region string
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- S3Bucket
Id string - Unique identifier for the rule.
- Versioning
S3Bucket
Versioning Args - A state of versioning. The versioning object structure is documented below.
- Website
S3Bucket
Website Args - A website object. The website object structure is 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
. Changing this will create a new resource. - cors
Rules List<S3BucketCors Rule> - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- 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 The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings
List<S3Bucket
Logging> - A settings of bucket logging. The logging object structure is documented below.
- policy String
- region String
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3Bucket
Id String - Unique identifier for the rule.
- versioning
S3Bucket
Versioning - A state of versioning. The versioning object structure is documented below.
- website
S3Bucket
Website - A website object. The website object structure is 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
. Changing this will create a new resource. - cors
Rules S3BucketCors Rule[] - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- hosted
Zone stringId - The Route 53 Hosted Zone ID for this bucket's region.
- lifecycle
Rules S3BucketLifecycle Rule[] A configuration of object lifecycle management The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings
S3Bucket
Logging[] - A settings of bucket logging. The logging object structure is documented below.
- policy string
- region string
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3Bucket
Id string - Unique identifier for the rule.
- versioning
S3Bucket
Versioning - A state of versioning. The versioning object structure is documented below.
- website
S3Bucket
Website - A website object. The website object structure is 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
. Changing this will create a new resource. - cors_
rules Sequence[S3BucketCors Rule Args] - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- 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 The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings
Sequence[S3Bucket
Logging Args] - A settings of bucket logging. The logging object structure is documented below.
- policy str
- region str
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3_
bucket_ strid - Unique identifier for the rule.
- versioning
S3Bucket
Versioning Args - A state of versioning. The versioning object structure is documented below.
- website
S3Bucket
Website Args - A website object. The website object structure is 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
. Changing this will create a new resource. - cors
Rules List<Property Map> - A rule of Cross-Origin Resource Sharing. The cors_rule object structure is 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. Default to false.
- 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 The lifecycle_rule object structure is documented below.
The
website
object supports:- loggings List<Property Map>
- A settings of bucket logging. The logging object structure is documented below.
- policy String
- region String
- Specifies the region in which to create the s3 bucket resource. If omitted, the provider-level region will be used. Changing this will create a new s3 bucket resource.
- s3Bucket
Id String - Unique identifier for the rule.
- versioning Property Map
- A state of versioning. The versioning object structure is documented below.
- website Property Map
- A website object. The website object structure is 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.
The
versioning
object supports:
- 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.
The
versioning
object supports:
- 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.
The
versioning
object supports:
- 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.
The
versioning
object supports:
- 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.
The
versioning
object supports:
- 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.
The
versioning
object supports:
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. The expiration object structure is documented below.
- Id string
- Unique identifier for the rule.
- Noncurrent
Version List<S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration> Specifies when noncurrent object versions expire. The noncurrent_version_expiration object structure is documented below.
At least one of
expiration
,noncurrent_version_expiration
must be specified.The
expiration
object supports:- 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. The expiration object structure is documented below.
- Id string
- Unique identifier for the rule.
- Noncurrent
Version []S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration Specifies when noncurrent object versions expire. The noncurrent_version_expiration object structure is documented below.
At least one of
expiration
,noncurrent_version_expiration
must be specified.The
expiration
object supports:- 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. The expiration object structure is documented below.
- id String
- Unique identifier for the rule.
- noncurrent
Version List<S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration> Specifies when noncurrent object versions expire. The noncurrent_version_expiration object structure is documented below.
At least one of
expiration
,noncurrent_version_expiration
must be specified.The
expiration
object supports:- 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. The expiration object structure is documented below.
- id string
- Unique identifier for the rule.
- noncurrent
Version S3BucketExpirations Lifecycle Rule Noncurrent Version Expiration[] Specifies when noncurrent object versions expire. The noncurrent_version_expiration object structure is documented below.
At least one of
expiration
,noncurrent_version_expiration
must be specified.The
expiration
object supports:- 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. The expiration object structure is documented below.
- id str
- Unique identifier for the rule.
- noncurrent_
version_ Sequence[S3Bucketexpirations Lifecycle Rule Noncurrent Version Expiration] Specifies when noncurrent object versions expire. The noncurrent_version_expiration object structure is documented below.
At least one of
expiration
,noncurrent_version_expiration
must be specified.The
expiration
object supports:- 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. The expiration object structure is documented below.
- id String
- Unique identifier for the rule.
- noncurrent
Version List<Property Map>Expirations Specifies when noncurrent object versions expire. The noncurrent_version_expiration object structure is documented below.
At least one of
expiration
,noncurrent_version_expiration
must be specified.The
expiration
object supports:- 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 an object is noncurrent object versions expire.
- 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.
The
noncurrent_version_expiration
object supports:
- Date string
- Specifies the date after which you want the corresponding action to take effect.
- Days float64
- Specifies the number of days an object is noncurrent object versions expire.
- 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.
The
noncurrent_version_expiration
object supports:
- date String
- Specifies the date after which you want the corresponding action to take effect.
- days Double
- Specifies the number of days an object is noncurrent object versions expire.
- 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.
The
noncurrent_version_expiration
object supports:
- date string
- Specifies the date after which you want the corresponding action to take effect.
- days number
- Specifies the number of days an object is noncurrent object versions expire.
- 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.
The
noncurrent_version_expiration
object supports:
- date str
- Specifies the date after which you want the corresponding action to take effect.
- days float
- Specifies the number of days an object is noncurrent object versions expire.
- 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.
The
noncurrent_version_expiration
object supports:
- date String
- Specifies the date after which you want the corresponding action to take effect.
- days Number
- Specifies the number of days an object is noncurrent object versions expire.
- 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.
The
noncurrent_version_expiration
object supports:
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.
The
lifecycle_rule
object supports:
- 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.
The
lifecycle_rule
object supports:
- 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.
The
lifecycle_rule
object supports:
- 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.
The
lifecycle_rule
object supports:
- 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.
The
lifecycle_rule
object supports:
- 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.
The
lifecycle_rule
object supports:
S3BucketVersioning, S3BucketVersioningArgs
- enabled bool
- Specifies lifecycle rule status.
- mfa_
delete bool Enable MFA delete for either change the versioning state of your bucket or permanently delete an object version. Default is
false
.The
logging
object supports:
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. It is Optional if using
redirect_all_requests_to
. - 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.
The
cors_rule
object supports:
- 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. It is Optional if using
redirect_all_requests_to
. - 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.
The
cors_rule
object supports:
- 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. It is Optional if using
redirect_all_requests_to
. - 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.
The
cors_rule
object supports:
- 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. It is Optional if using
redirect_all_requests_to
. - 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.
The
cors_rule
object supports:
- 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. It is Optional if using
redirect_all_requests_to
. - 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.
The
cors_rule
object supports:
- 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. It is Optional if using
redirect_all_requests_to
. - 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.
The
cors_rule
object supports:
Import
S3 bucket can be imported using the bucket
, e.g.
$ pulumi import flexibleengine:index/s3Bucket:S3Bucket bucket bucket-name
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
- License
- Notes
- This Pulumi package is based on the
flexibleengine
Terraform Provider.