Provides a OSS Bucket Overwrite Config resource.
Bucket Overwrite Configuration.
For information about OSS Bucket Overwrite Config and how to use it, see What is Bucket Overwrite Config.
NOTE: Available since v1.271.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const defaultrdrM3m = new alicloud.oss.Bucket("defaultrdrM3m", {storageClass: "Standard"});
const _default = new alicloud.oss.BucketOverwriteConfig("default", {
bucket: defaultrdrM3m.id,
rules: [
{
id: "rule1",
action: "forbid",
prefix: "rule1-prefix/",
suffix: "rule1-suffix/",
principals: {
principals: [
"a",
"b",
"c",
],
},
},
{
id: "rule2",
action: "forbid",
prefix: "rule2-prefix/",
suffix: "rule2-suffix/",
principals: {
principals: [
"d",
"e",
"f",
],
},
},
{
id: "rule3",
action: "forbid",
prefix: "rule3-prefix/",
suffix: "rule3-suffix/",
principals: {
principals: [
"1",
"2",
"3",
],
},
},
],
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
defaultrdr_m3m = alicloud.oss.Bucket("defaultrdrM3m", storage_class="Standard")
default = alicloud.oss.BucketOverwriteConfig("default",
bucket=defaultrdr_m3m.id,
rules=[
{
"id": "rule1",
"action": "forbid",
"prefix": "rule1-prefix/",
"suffix": "rule1-suffix/",
"principals": {
"principals": [
"a",
"b",
"c",
],
},
},
{
"id": "rule2",
"action": "forbid",
"prefix": "rule2-prefix/",
"suffix": "rule2-suffix/",
"principals": {
"principals": [
"d",
"e",
"f",
],
},
},
{
"id": "rule3",
"action": "forbid",
"prefix": "rule3-prefix/",
"suffix": "rule3-suffix/",
"principals": {
"principals": [
"1",
"2",
"3",
],
},
},
])
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oss"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
defaultrdrM3m, err := oss.NewBucket(ctx, "defaultrdrM3m", &oss.BucketArgs{
StorageClass: pulumi.String("Standard"),
})
if err != nil {
return err
}
_, err = oss.NewBucketOverwriteConfig(ctx, "default", &oss.BucketOverwriteConfigArgs{
Bucket: defaultrdrM3m.ID(),
Rules: oss.BucketOverwriteConfigRuleArray{
&oss.BucketOverwriteConfigRuleArgs{
Id: pulumi.String("rule1"),
Action: pulumi.String("forbid"),
Prefix: pulumi.String("rule1-prefix/"),
Suffix: pulumi.String("rule1-suffix/"),
Principals: &oss.BucketOverwriteConfigRulePrincipalsArgs{
Principals: pulumi.StringArray{
pulumi.String("a"),
pulumi.String("b"),
pulumi.String("c"),
},
},
},
&oss.BucketOverwriteConfigRuleArgs{
Id: pulumi.String("rule2"),
Action: pulumi.String("forbid"),
Prefix: pulumi.String("rule2-prefix/"),
Suffix: pulumi.String("rule2-suffix/"),
Principals: &oss.BucketOverwriteConfigRulePrincipalsArgs{
Principals: pulumi.StringArray{
pulumi.String("d"),
pulumi.String("e"),
pulumi.String("f"),
},
},
},
&oss.BucketOverwriteConfigRuleArgs{
Id: pulumi.String("rule3"),
Action: pulumi.String("forbid"),
Prefix: pulumi.String("rule3-prefix/"),
Suffix: pulumi.String("rule3-suffix/"),
Principals: &oss.BucketOverwriteConfigRulePrincipalsArgs{
Principals: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("2"),
pulumi.String("3"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var defaultrdrM3m = new AliCloud.Oss.Bucket("defaultrdrM3m", new()
{
StorageClass = "Standard",
});
var @default = new AliCloud.Oss.BucketOverwriteConfig("default", new()
{
Bucket = defaultrdrM3m.Id,
Rules = new[]
{
new AliCloud.Oss.Inputs.BucketOverwriteConfigRuleArgs
{
Id = "rule1",
Action = "forbid",
Prefix = "rule1-prefix/",
Suffix = "rule1-suffix/",
Principals = new AliCloud.Oss.Inputs.BucketOverwriteConfigRulePrincipalsArgs
{
Principals = new[]
{
"a",
"b",
"c",
},
},
},
new AliCloud.Oss.Inputs.BucketOverwriteConfigRuleArgs
{
Id = "rule2",
Action = "forbid",
Prefix = "rule2-prefix/",
Suffix = "rule2-suffix/",
Principals = new AliCloud.Oss.Inputs.BucketOverwriteConfigRulePrincipalsArgs
{
Principals = new[]
{
"d",
"e",
"f",
},
},
},
new AliCloud.Oss.Inputs.BucketOverwriteConfigRuleArgs
{
Id = "rule3",
Action = "forbid",
Prefix = "rule3-prefix/",
Suffix = "rule3-suffix/",
Principals = new AliCloud.Oss.Inputs.BucketOverwriteConfigRulePrincipalsArgs
{
Principals = new[]
{
"1",
"2",
"3",
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.oss.Bucket;
import com.pulumi.alicloud.oss.BucketArgs;
import com.pulumi.alicloud.oss.BucketOverwriteConfig;
import com.pulumi.alicloud.oss.BucketOverwriteConfigArgs;
import com.pulumi.alicloud.oss.inputs.BucketOverwriteConfigRuleArgs;
import com.pulumi.alicloud.oss.inputs.BucketOverwriteConfigRulePrincipalsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var defaultrdrM3m = new Bucket("defaultrdrM3m", BucketArgs.builder()
.storageClass("Standard")
.build());
var default_ = new BucketOverwriteConfig("default", BucketOverwriteConfigArgs.builder()
.bucket(defaultrdrM3m.id())
.rules(
BucketOverwriteConfigRuleArgs.builder()
.id("rule1")
.action("forbid")
.prefix("rule1-prefix/")
.suffix("rule1-suffix/")
.principals(BucketOverwriteConfigRulePrincipalsArgs.builder()
.principals(
"a",
"b",
"c")
.build())
.build(),
BucketOverwriteConfigRuleArgs.builder()
.id("rule2")
.action("forbid")
.prefix("rule2-prefix/")
.suffix("rule2-suffix/")
.principals(BucketOverwriteConfigRulePrincipalsArgs.builder()
.principals(
"d",
"e",
"f")
.build())
.build(),
BucketOverwriteConfigRuleArgs.builder()
.id("rule3")
.action("forbid")
.prefix("rule3-prefix/")
.suffix("rule3-suffix/")
.principals(BucketOverwriteConfigRulePrincipalsArgs.builder()
.principals(
"1",
"2",
"3")
.build())
.build())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultrdrM3m:
type: alicloud:oss:Bucket
properties:
storageClass: Standard
default:
type: alicloud:oss:BucketOverwriteConfig
properties:
bucket: ${defaultrdrM3m.id}
rules:
- id: rule1
action: forbid
prefix: rule1-prefix/
suffix: rule1-suffix/
principals:
principals:
- a
- b
- c
- id: rule2
action: forbid
prefix: rule2-prefix/
suffix: rule2-suffix/
principals:
principals:
- d
- e
- f
- id: rule3
action: forbid
prefix: rule3-prefix/
suffix: rule3-suffix/
principals:
principals:
- '1'
- '2'
- '3'
📚 Need more examples? VIEW MORE EXAMPLES
Create BucketOverwriteConfig Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BucketOverwriteConfig(name: string, args: BucketOverwriteConfigArgs, opts?: CustomResourceOptions);@overload
def BucketOverwriteConfig(resource_name: str,
args: BucketOverwriteConfigArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BucketOverwriteConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
rules: Optional[Sequence[BucketOverwriteConfigRuleArgs]] = None)func NewBucketOverwriteConfig(ctx *Context, name string, args BucketOverwriteConfigArgs, opts ...ResourceOption) (*BucketOverwriteConfig, error)public BucketOverwriteConfig(string name, BucketOverwriteConfigArgs args, CustomResourceOptions? opts = null)
public BucketOverwriteConfig(String name, BucketOverwriteConfigArgs args)
public BucketOverwriteConfig(String name, BucketOverwriteConfigArgs args, CustomResourceOptions options)
type: alicloud:oss:BucketOverwriteConfig
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 BucketOverwriteConfigArgs
- 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 BucketOverwriteConfigArgs
- 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 BucketOverwriteConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketOverwriteConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BucketOverwriteConfigArgs
- 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 bucketOverwriteConfigResource = new AliCloud.Oss.BucketOverwriteConfig("bucketOverwriteConfigResource", new()
{
Bucket = "string",
Rules = new[]
{
new AliCloud.Oss.Inputs.BucketOverwriteConfigRuleArgs
{
Action = "string",
Id = "string",
Prefix = "string",
Principals = new AliCloud.Oss.Inputs.BucketOverwriteConfigRulePrincipalsArgs
{
Principals = new[]
{
"string",
},
},
Suffix = "string",
},
},
});
example, err := oss.NewBucketOverwriteConfig(ctx, "bucketOverwriteConfigResource", &oss.BucketOverwriteConfigArgs{
Bucket: pulumi.String("string"),
Rules: oss.BucketOverwriteConfigRuleArray{
&oss.BucketOverwriteConfigRuleArgs{
Action: pulumi.String("string"),
Id: pulumi.String("string"),
Prefix: pulumi.String("string"),
Principals: &oss.BucketOverwriteConfigRulePrincipalsArgs{
Principals: pulumi.StringArray{
pulumi.String("string"),
},
},
Suffix: pulumi.String("string"),
},
},
})
var bucketOverwriteConfigResource = new BucketOverwriteConfig("bucketOverwriteConfigResource", BucketOverwriteConfigArgs.builder()
.bucket("string")
.rules(BucketOverwriteConfigRuleArgs.builder()
.action("string")
.id("string")
.prefix("string")
.principals(BucketOverwriteConfigRulePrincipalsArgs.builder()
.principals("string")
.build())
.suffix("string")
.build())
.build());
bucket_overwrite_config_resource = alicloud.oss.BucketOverwriteConfig("bucketOverwriteConfigResource",
bucket="string",
rules=[{
"action": "string",
"id": "string",
"prefix": "string",
"principals": {
"principals": ["string"],
},
"suffix": "string",
}])
const bucketOverwriteConfigResource = new alicloud.oss.BucketOverwriteConfig("bucketOverwriteConfigResource", {
bucket: "string",
rules: [{
action: "string",
id: "string",
prefix: "string",
principals: {
principals: ["string"],
},
suffix: "string",
}],
});
type: alicloud:oss:BucketOverwriteConfig
properties:
bucket: string
rules:
- action: string
id: string
prefix: string
principals:
principals:
- string
suffix: string
BucketOverwriteConfig 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 BucketOverwriteConfig resource accepts the following input properties:
- Bucket string
- The name of the bucket
- Rules
List<Pulumi.
Ali Cloud. Oss. Inputs. Bucket Overwrite Config Rule> - Forbid overwrite rule See
rulebelow.
- Bucket string
- The name of the bucket
- Rules
[]Bucket
Overwrite Config Rule Args - Forbid overwrite rule See
rulebelow.
- bucket String
- The name of the bucket
- rules
List<Bucket
Overwrite Config Rule> - Forbid overwrite rule See
rulebelow.
- bucket string
- The name of the bucket
- rules
Bucket
Overwrite Config Rule[] - Forbid overwrite rule See
rulebelow.
- bucket str
- The name of the bucket
- rules
Sequence[Bucket
Overwrite Config Rule Args] - Forbid overwrite rule See
rulebelow.
- bucket String
- The name of the bucket
- rules List<Property Map>
- Forbid overwrite rule See
rulebelow.
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketOverwriteConfig resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing BucketOverwriteConfig Resource
Get an existing BucketOverwriteConfig 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?: BucketOverwriteConfigState, opts?: CustomResourceOptions): BucketOverwriteConfig@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
rules: Optional[Sequence[BucketOverwriteConfigRuleArgs]] = None) -> BucketOverwriteConfigfunc GetBucketOverwriteConfig(ctx *Context, name string, id IDInput, state *BucketOverwriteConfigState, opts ...ResourceOption) (*BucketOverwriteConfig, error)public static BucketOverwriteConfig Get(string name, Input<string> id, BucketOverwriteConfigState? state, CustomResourceOptions? opts = null)public static BucketOverwriteConfig get(String name, Output<String> id, BucketOverwriteConfigState state, CustomResourceOptions options)resources: _: type: alicloud:oss:BucketOverwriteConfig 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.
- Bucket string
- The name of the bucket
- Rules
List<Pulumi.
Ali Cloud. Oss. Inputs. Bucket Overwrite Config Rule> - Forbid overwrite rule See
rulebelow.
- Bucket string
- The name of the bucket
- Rules
[]Bucket
Overwrite Config Rule Args - Forbid overwrite rule See
rulebelow.
- bucket String
- The name of the bucket
- rules
List<Bucket
Overwrite Config Rule> - Forbid overwrite rule See
rulebelow.
- bucket string
- The name of the bucket
- rules
Bucket
Overwrite Config Rule[] - Forbid overwrite rule See
rulebelow.
- bucket str
- The name of the bucket
- rules
Sequence[Bucket
Overwrite Config Rule Args] - Forbid overwrite rule See
rulebelow.
- bucket String
- The name of the bucket
- rules List<Property Map>
- Forbid overwrite rule See
rulebelow.
Supporting Types
BucketOverwriteConfigRule, BucketOverwriteConfigRuleArgs
- Action string
- The operation type. Currently, only "forbid" is supported.
- Id string
- Rule ID
- Prefix string
- The prefix of the Object name, which is used to filter objects to be processed.
- Principals
Pulumi.
Ali Cloud. Oss. Inputs. Bucket Overwrite Config Rule Principals - A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions. See
principalsbelow. - Suffix string
- The suffix of the Object name, which is used to filter objects to be processed.
- Action string
- The operation type. Currently, only "forbid" is supported.
- Id string
- Rule ID
- Prefix string
- The prefix of the Object name, which is used to filter objects to be processed.
- Principals
Bucket
Overwrite Config Rule Principals - A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions. See
principalsbelow. - Suffix string
- The suffix of the Object name, which is used to filter objects to be processed.
- action String
- The operation type. Currently, only "forbid" is supported.
- id String
- Rule ID
- prefix String
- The prefix of the Object name, which is used to filter objects to be processed.
- principals
Bucket
Overwrite Config Rule Principals - A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions. See
principalsbelow. - suffix String
- The suffix of the Object name, which is used to filter objects to be processed.
- action string
- The operation type. Currently, only "forbid" is supported.
- id string
- Rule ID
- prefix string
- The prefix of the Object name, which is used to filter objects to be processed.
- principals
Bucket
Overwrite Config Rule Principals - A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions. See
principalsbelow. - suffix string
- The suffix of the Object name, which is used to filter objects to be processed.
- action str
- The operation type. Currently, only "forbid" is supported.
- id str
- Rule ID
- prefix str
- The prefix of the Object name, which is used to filter objects to be processed.
- principals
Bucket
Overwrite Config Rule Principals - A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions. See
principalsbelow. - suffix str
- The suffix of the Object name, which is used to filter objects to be processed.
- action String
- The operation type. Currently, only "forbid" is supported.
- id String
- Rule ID
- prefix String
- The prefix of the Object name, which is used to filter objects to be processed.
- principals Property Map
- A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions. See
principalsbelow. - suffix String
- The suffix of the Object name, which is used to filter objects to be processed.
BucketOverwriteConfigRulePrincipals, BucketOverwriteConfigRulePrincipalsArgs
- Principals List<string>
- Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty.
- Principals []string
- Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty.
- principals List<String>
- Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty.
- principals string[]
- Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty.
- principals Sequence[str]
- Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty.
- principals List<String>
- Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty.
Import
OSS Bucket Overwrite Config can be imported using the id, e.g.
$ pulumi import alicloud:oss/bucketOverwriteConfig:BucketOverwriteConfig example <bucket>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
