Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse
scaleway.object.getBucketPolicy
Explore with Pulumi AI
The scaleway.object.BucketPolicy
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.object.getBucketPolicy({
bucket: "bucket.test.com",
});
import pulumi
import pulumi_scaleway as scaleway
main = scaleway.object.get_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/object"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := object.LookupBucketPolicy(ctx, &object.LookupBucketPolicyArgs{
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.Object.GetBucketPolicy.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.object.ObjectFunctions;
import com.pulumi.scaleway.object.inputs.GetBucketPolicyArgs;
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 = ObjectFunctions.getBucketPolicy(GetBucketPolicyArgs.builder()
.bucket("bucket.test.com")
.build());
}
}
variables:
main:
fn::invoke:
function: scaleway:object:getBucketPolicy
arguments:
bucket: bucket.test.com
Using getBucketPolicy
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 getBucketPolicy(args: GetBucketPolicyArgs, opts?: InvokeOptions): Promise<GetBucketPolicyResult>
function getBucketPolicyOutput(args: GetBucketPolicyOutputArgs, opts?: InvokeOptions): Output<GetBucketPolicyResult>
def get_bucket_policy(bucket: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBucketPolicyResult
def get_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[GetBucketPolicyResult]
func LookupBucketPolicy(ctx *Context, args *LookupBucketPolicyArgs, opts ...InvokeOption) (*LookupBucketPolicyResult, error)
func LookupBucketPolicyOutput(ctx *Context, args *LookupBucketPolicyOutputArgs, opts ...InvokeOption) LookupBucketPolicyResultOutput
> Note: This function is named LookupBucketPolicy
in the Go SDK.
public static class GetBucketPolicy
{
public static Task<GetBucketPolicyResult> InvokeAsync(GetBucketPolicyArgs args, InvokeOptions? opts = null)
public static Output<GetBucketPolicyResult> Invoke(GetBucketPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBucketPolicyResult> getBucketPolicy(GetBucketPolicyArgs args, InvokeOptions options)
public static Output<GetBucketPolicyResult> getBucketPolicy(GetBucketPolicyArgs args, InvokeOptions options)
fn::invoke:
function: scaleway:object/getBucketPolicy:getBucketPolicy
arguments:
# arguments dictionary
The following arguments are supported:
- bucket str
- The name of the bucket.
- project_
id str - region str
region
) The region in which the Object Storage exists.
getBucketPolicy Result
The following output properties are available:
- 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
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.