UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

132 lines (131 loc) 4.62 kB
import * as pulumi from "@pulumi/pulumi"; /** * Creates and manages Scaleway object storage bucket policy. * For more information, see [the documentation](https://www.scaleway.com/en/docs/storage/object/api-cli/using-bucket-policies/). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const bucket = new scaleway.ObjectBucket("bucket", {}); * const main = new scaleway.IamApplication("main", {description: "a description"}); * const policy = new scaleway.ObjectBucketPolicy("policy", { * bucket: bucket.name, * policy: pulumi.all([main.id, bucket.name, bucket.name]).apply(([id, bucketName, bucketName1]) => JSON.stringify({ * Version: "2023-04-17", * Id: "MyBucketPolicy", * Statement: [{ * Sid: "Delegate access", * Effect: "Allow", * Principal: { * SCW: `application_id:${id}`, * }, * Action: "s3:ListBucket", * Resource: [ * bucketName, * `${bucketName1}/*`, * ], * }], * })), * }); * ``` * * ## Import * * Buckets can be imported using the `{region}/{bucketName}` identifier, e.g. bash * * ```sh * $ pulumi import scaleway:index/objectBucketPolicy:ObjectBucketPolicy some_bucket fr-par/some-bucket * ``` */ export declare class ObjectBucketPolicy extends pulumi.CustomResource { /** * Get an existing ObjectBucketPolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ObjectBucketPolicyState, opts?: pulumi.CustomResourceOptions): ObjectBucketPolicy; /** * Returns true if the given object is an instance of ObjectBucketPolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ObjectBucketPolicy; /** * The name of the bucket. */ readonly bucket: pulumi.Output<string>; /** * The text of the policy. */ readonly policy: pulumi.Output<string>; /** * `projectId`) The ID of the project the bucket is associated with. * * > **Important:** The awsIamPolicyDocument data source may be used, so long as it specifies a principal. */ readonly projectId: pulumi.Output<string>; /** * The Scaleway region this bucket resides in. */ readonly region: pulumi.Output<string>; /** * Create a ObjectBucketPolicy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ObjectBucketPolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ObjectBucketPolicy resources. */ export interface ObjectBucketPolicyState { /** * The name of the bucket. */ bucket?: pulumi.Input<string>; /** * The text of the policy. */ policy?: pulumi.Input<string>; /** * `projectId`) The ID of the project the bucket is associated with. * * > **Important:** The awsIamPolicyDocument data source may be used, so long as it specifies a principal. */ projectId?: pulumi.Input<string>; /** * The Scaleway region this bucket resides in. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a ObjectBucketPolicy resource. */ export interface ObjectBucketPolicyArgs { /** * The name of the bucket. */ bucket: pulumi.Input<string>; /** * The text of the policy. */ policy: pulumi.Input<string>; /** * `projectId`) The ID of the project the bucket is associated with. * * > **Important:** The awsIamPolicyDocument data source may be used, so long as it specifies a principal. */ projectId?: pulumi.Input<string>; /** * The Scaleway region this bucket resides in. */ region?: pulumi.Input<string>; }