published on Wednesday, Apr 29, 2026 by pulumiverse
published on Wednesday, Apr 29, 2026 by pulumiverse
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 "@pulumiverse/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 = Pulumiverse.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 dictionaryThe following arguments are supported:
- Bucket string
- The name of the bucket.
- Project
Id string projectId) The ID of the project with which the bucket is associated.Important: The
projectIdattribute has a particular behavior with s3 products, because the s3 API is scoped by project. If you are using a project different from the default one, you have to specify theprojectIdfor every child resource of the bucket, like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.For more information on Object Storage and Scaleway Projects, refer to the dedicated documentation.
- Region string
region) The region in which the Object Storage exists.
- Bucket string
- The name of the bucket.
- Project
Id string projectId) The ID of the project with which the bucket is associated.Important: The
projectIdattribute has a particular behavior with s3 products, because the s3 API is scoped by project. If you are using a project different from the default one, you have to specify theprojectIdfor every child resource of the bucket, like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.For more information on Object Storage and Scaleway Projects, refer to the dedicated documentation.
- Region string
region) The region in which the Object Storage exists.
- bucket String
- The name of the bucket.
- project
Id String projectId) The ID of the project with which the bucket is associated.Important: The
projectIdattribute has a particular behavior with s3 products, because the s3 API is scoped by project. If you are using a project different from the default one, you have to specify theprojectIdfor every child resource of the bucket, like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.For more information on Object Storage and Scaleway Projects, refer to the dedicated documentation.
- region String
region) The region in which the Object Storage exists.
- bucket string
- The name of the bucket.
- project
Id string projectId) The ID of the project with which the bucket is associated.Important: The
projectIdattribute has a particular behavior with s3 products, because the s3 API is scoped by project. If you are using a project different from the default one, you have to specify theprojectIdfor every child resource of the bucket, like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.For more information on Object Storage and Scaleway Projects, refer to the dedicated documentation.
- region string
region) The region in which the Object Storage exists.
- bucket str
- The name of the bucket.
- project_
id str projectId) The ID of the project with which the bucket is associated.Important: The
projectIdattribute has a particular behavior with s3 products, because the s3 API is scoped by project. If you are using a project different from the default one, you have to specify theprojectIdfor every child resource of the bucket, like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.For more information on Object Storage and Scaleway Projects, refer to the dedicated documentation.
- region str
region) The region in which the Object Storage exists.
- bucket String
- The name of the bucket.
- project
Id String projectId) The ID of the project with which the bucket is associated.Important: The
projectIdattribute has a particular behavior with s3 products, because the s3 API is scoped by project. If you are using a project different from the default one, you have to specify theprojectIdfor every child resource of the bucket, like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.For more information on Object Storage and Scaleway Projects, refer to the dedicated documentation.
- region String
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
scalewayTerraform Provider.
published on Wednesday, Apr 29, 2026 by pulumiverse
