1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. oss
  5. AccountPublicAccessBlock
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

alicloud.oss.AccountPublicAccessBlock

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi

    Provides a OSS Account Public Access Block resource. Blocking public access at the account level.

    For information about OSS Account Public Access Block and how to use it, see What is Account Public Access Block.

    NOTE: Available since v1.224.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 _default = new alicloud.oss.AccountPublicAccessBlock("default", {blockPublicAccess: true});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.oss.AccountPublicAccessBlock("default", block_public_access=True)
    
    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
    		}
    		_, err := oss.NewAccountPublicAccessBlock(ctx, "default", &oss.AccountPublicAccessBlockArgs{
    			BlockPublicAccess: pulumi.Bool(true),
    		})
    		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 @default = new AliCloud.Oss.AccountPublicAccessBlock("default", new()
        {
            BlockPublicAccess = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.oss.AccountPublicAccessBlock;
    import com.pulumi.alicloud.oss.AccountPublicAccessBlockArgs;
    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 default_ = new AccountPublicAccessBlock("default", AccountPublicAccessBlockArgs.builder()
                .blockPublicAccess(true)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:oss:AccountPublicAccessBlock
        properties:
          blockPublicAccess: true
    

    Create AccountPublicAccessBlock Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AccountPublicAccessBlock(name: string, args: AccountPublicAccessBlockArgs, opts?: CustomResourceOptions);
    @overload
    def AccountPublicAccessBlock(resource_name: str,
                                 args: AccountPublicAccessBlockArgs,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccountPublicAccessBlock(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 block_public_access: Optional[bool] = None)
    func NewAccountPublicAccessBlock(ctx *Context, name string, args AccountPublicAccessBlockArgs, opts ...ResourceOption) (*AccountPublicAccessBlock, error)
    public AccountPublicAccessBlock(string name, AccountPublicAccessBlockArgs args, CustomResourceOptions? opts = null)
    public AccountPublicAccessBlock(String name, AccountPublicAccessBlockArgs args)
    public AccountPublicAccessBlock(String name, AccountPublicAccessBlockArgs args, CustomResourceOptions options)
    
    type: alicloud:oss:AccountPublicAccessBlock
    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 AccountPublicAccessBlockArgs
    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 AccountPublicAccessBlockArgs
    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 AccountPublicAccessBlockArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccountPublicAccessBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccountPublicAccessBlockArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var accountPublicAccessBlockResource = new AliCloud.Oss.AccountPublicAccessBlock("accountPublicAccessBlockResource", new()
    {
        BlockPublicAccess = false,
    });
    
    example, err := oss.NewAccountPublicAccessBlock(ctx, "accountPublicAccessBlockResource", &oss.AccountPublicAccessBlockArgs{
    	BlockPublicAccess: pulumi.Bool(false),
    })
    
    var accountPublicAccessBlockResource = new AccountPublicAccessBlock("accountPublicAccessBlockResource", AccountPublicAccessBlockArgs.builder()
        .blockPublicAccess(false)
        .build());
    
    account_public_access_block_resource = alicloud.oss.AccountPublicAccessBlock("accountPublicAccessBlockResource", block_public_access=False)
    
    const accountPublicAccessBlockResource = new alicloud.oss.AccountPublicAccessBlock("accountPublicAccessBlockResource", {blockPublicAccess: false});
    
    type: alicloud:oss:AccountPublicAccessBlock
    properties:
        blockPublicAccess: false
    

    AccountPublicAccessBlock Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The AccountPublicAccessBlock resource accepts the following input properties:

    BlockPublicAccess bool
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    BlockPublicAccess bool
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    blockPublicAccess Boolean
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    blockPublicAccess boolean
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    block_public_access bool
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    blockPublicAccess Boolean
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AccountPublicAccessBlock 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 AccountPublicAccessBlock Resource

    Get an existing AccountPublicAccessBlock 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?: AccountPublicAccessBlockState, opts?: CustomResourceOptions): AccountPublicAccessBlock
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            block_public_access: Optional[bool] = None) -> AccountPublicAccessBlock
    func GetAccountPublicAccessBlock(ctx *Context, name string, id IDInput, state *AccountPublicAccessBlockState, opts ...ResourceOption) (*AccountPublicAccessBlock, error)
    public static AccountPublicAccessBlock Get(string name, Input<string> id, AccountPublicAccessBlockState? state, CustomResourceOptions? opts = null)
    public static AccountPublicAccessBlock get(String name, Output<String> id, AccountPublicAccessBlockState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    BlockPublicAccess bool
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    BlockPublicAccess bool
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    blockPublicAccess Boolean
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    blockPublicAccess boolean
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    block_public_access bool
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.
    blockPublicAccess Boolean
    Whether or not AlibabaCloud OSS should block public bucket policies for buckets in this account is enabled.

    Import

    OSS Account Public Access Block can be imported using the id, e.g.

    $ pulumi import alicloud:oss/accountPublicAccessBlock:AccountPublicAccessBlock example
    

    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 alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.0 published on Saturday, Jun 15, 2024 by Pulumi