ResourcePolicyArgs

data class ResourcePolicyArgs(val policy: Output<String>? = null, val resourceArn: Output<String>? = null) : ConvertibleToJava<ResourcePolicyArgs>

Creates a new Amazon Redshift Serverless Resource Policy.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshiftserverless.ResourcePolicy;
import com.pulumi.aws.redshiftserverless.ResourcePolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
var example = new ResourcePolicy("example", ResourcePolicyArgs.builder()
.resourceArn(aws_redshiftserverless_snapshot.example().arn())
.policy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Effect", "Allow"),
jsonProperty("Principal", jsonObject(
jsonProperty("AWS", jsonArray("12345678901"))
)),
jsonProperty("Action", jsonArray("redshift-serverless:RestoreFromSnapshot")),
jsonProperty("Sid", "")
)))
)))
.build());
}
}

Import

Redshift Serverless Resource Policies can be imported using the resource_arn, e.g.,

$ pulumi import aws:redshiftserverless/resourcePolicy:ResourcePolicy example example

Constructors

Link copied to clipboard
constructor(policy: Output<String>? = null, resourceArn: Output<String>? = null)

Properties

Link copied to clipboard
val policy: Output<String>? = null

The policy to create or update. For example, the following policy grants a user authorization to restore a snapshot.

Link copied to clipboard
val resourceArn: Output<String>? = null

The Amazon Resource Name (ARN) of the account to create or update a resource policy for.

Functions

Link copied to clipboard
open override fun toJava(): ResourcePolicyArgs