1. Packages
  2. Scaleway
  3. API Docs
  4. getObjectBucketPolicy
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.getObjectBucketPolicy

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    The scaleway.ObjectBucketPolicy data source is used to retrieve information about the bucket policy of an Object Storage bucket.

    Refer to the Object Storage documentation for more information.

    Retrieve the bucket policy of a bucket

    The following command allows you to retrieve a bucket policy by its bucket.

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    
    const main = scaleway.getObjectBucketPolicy({
        bucket: "bucket.test.com",
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    main = scaleway.get_object_bucket_policy(bucket="bucket.test.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := scaleway.LookupObjectBucketPolicy(ctx, &scaleway.LookupObjectBucketPolicyArgs{
    			Bucket: "bucket.test.com",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var main = Scaleway.GetObjectBucketPolicy.Invoke(new()
        {
            Bucket = "bucket.test.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.inputs.GetObjectBucketPolicyArgs;
    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 main = ScalewayFunctions.getObjectBucketPolicy(GetObjectBucketPolicyArgs.builder()
                .bucket("bucket.test.com")
                .build());
    
        }
    }
    
    variables:
      main:
        fn::invoke:
          Function: scaleway:getObjectBucketPolicy
          Arguments:
            bucket: bucket.test.com
    

    Using getObjectBucketPolicy

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getObjectBucketPolicy(args: GetObjectBucketPolicyArgs, opts?: InvokeOptions): Promise<GetObjectBucketPolicyResult>
    function getObjectBucketPolicyOutput(args: GetObjectBucketPolicyOutputArgs, opts?: InvokeOptions): Output<GetObjectBucketPolicyResult>
    def get_object_bucket_policy(bucket: Optional[str] = None,
                                 project_id: Optional[str] = None,
                                 region: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetObjectBucketPolicyResult
    def get_object_bucket_policy_output(bucket: Optional[pulumi.Input[str]] = None,
                                 project_id: Optional[pulumi.Input[str]] = None,
                                 region: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetObjectBucketPolicyResult]
    func LookupObjectBucketPolicy(ctx *Context, args *LookupObjectBucketPolicyArgs, opts ...InvokeOption) (*LookupObjectBucketPolicyResult, error)
    func LookupObjectBucketPolicyOutput(ctx *Context, args *LookupObjectBucketPolicyOutputArgs, opts ...InvokeOption) LookupObjectBucketPolicyResultOutput

    > Note: This function is named LookupObjectBucketPolicy in the Go SDK.

    public static class GetObjectBucketPolicy 
    {
        public static Task<GetObjectBucketPolicyResult> InvokeAsync(GetObjectBucketPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetObjectBucketPolicyResult> Invoke(GetObjectBucketPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetObjectBucketPolicyResult> getObjectBucketPolicy(GetObjectBucketPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: scaleway:index/getObjectBucketPolicy:getObjectBucketPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bucket string
    The name of the bucket.
    ProjectId string
    Region string
    region) The region in which the Object Storage exists.
    Bucket string
    The name of the bucket.
    ProjectId string
    Region string
    region) The region in which the Object Storage exists.
    bucket String
    The name of the bucket.
    projectId String
    region String
    region) The region in which the Object Storage exists.
    bucket string
    The name of the bucket.
    projectId string
    region string
    region) The region in which the Object Storage exists.
    bucket str
    The name of the bucket.
    project_id str
    region str
    region) The region in which the Object Storage exists.
    bucket String
    The name of the bucket.
    projectId String
    region String
    region) The region in which the Object Storage exists.

    getObjectBucketPolicy Result

    The following output properties are available:

    Bucket string
    Id string
    The provider-assigned unique ID for this managed resource.
    Policy string
    The content of the bucket policy in JSON format.
    ProjectId string
    Region string
    Bucket string
    Id string
    The provider-assigned unique ID for this managed resource.
    Policy string
    The content of the bucket policy in JSON format.
    ProjectId string
    Region string
    bucket String
    id String
    The provider-assigned unique ID for this managed resource.
    policy String
    The content of the bucket policy in JSON format.
    projectId String
    region String
    bucket string
    id string
    The provider-assigned unique ID for this managed resource.
    policy string
    The content of the bucket policy in JSON format.
    projectId string
    region string
    bucket str
    id str
    The provider-assigned unique ID for this managed resource.
    policy str
    The content of the bucket policy in JSON format.
    project_id str
    region str
    bucket String
    id String
    The provider-assigned unique ID for this managed resource.
    policy String
    The content of the bucket policy in JSON format.
    projectId String
    region String

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse