1. Registry
  2. Packages
  3. AWS
  4. API Docs
  5. dsql
  6. ClusterPolicy
Viewing docs for AWS v7.43.0
published on Thursday, Aug 20, 2026 by Pulumi
aws logo aws logo
Viewing docs for AWS v7.43.0
published on Thursday, Aug 20, 2026 by Pulumi

    Resource for managing an Amazon Aurora DSQL Cluster resource-based policy.

    Aurora DSQL resource-based policies can grant access to principals within the same AWS account as the cluster. Cross-account access is not currently supported by Aurora DSQL resource-based policies.

    Aurora DSQL resource-based policy changes are eventually consistent and typically take effect within one minute.

    Example Usage

    Block Public Internet Access

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.dsql.Cluster("example", {});
    const exampleClusterPolicy = new aws.dsql.ClusterPolicy("example", {
        identifier: example.identifier,
        policy: JSON.stringify({
            Version: "2012-10-17",
            Statement: [{
                Sid: "DenyAccessFromOutsideVPC",
                Effect: "Deny",
                Principal: {
                    AWS: "*",
                },
                Action: [
                    "dsql:DbConnect",
                    "dsql:DbConnectAdmin",
                ],
                Resource: "*",
                Condition: {
                    Null: {
                        "aws:SourceVpc": "true",
                    },
                },
            }],
        }),
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    example = aws.dsql.Cluster("example")
    example_cluster_policy = aws.dsql.ClusterPolicy("example",
        identifier=example.identifier,
        policy=json.dumps({
            "Version": "2012-10-17",
            "Statement": [{
                "Sid": "DenyAccessFromOutsideVPC",
                "Effect": "Deny",
                "Principal": {
                    "AWS": "*",
                },
                "Action": [
                    "dsql:DbConnect",
                    "dsql:DbConnectAdmin",
                ],
                "Resource": "*",
                "Condition": {
                    "Null": {
                        "aws:SourceVpc": "true",
                    },
                },
            }],
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/dsql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := dsql.NewCluster(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"Version": "2012-10-17",
    			"Statement": []map[string]interface{}{
    				map[string]interface{}{
    					"Sid":    "DenyAccessFromOutsideVPC",
    					"Effect": "Deny",
    					"Principal": map[string]string{
    						"AWS": "*",
    					},
    					"Action": []string{
    						"dsql:DbConnect",
    						"dsql:DbConnectAdmin",
    					},
    					"Resource": "*",
    					"Condition": map[string]map[string]string{
    						"Null": map[string]string{
    							"aws:SourceVpc": "true",
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = dsql.NewClusterPolicy(ctx, "example", &dsql.ClusterPolicyArgs{
    			Identifier: example.Identifier,
    			Policy:     pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Dsql.Cluster("example");
    
        var exampleClusterPolicy = new Aws.Dsql.ClusterPolicy("example", new()
        {
            Identifier = example.Identifier,
            Policy = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["Version"] = "2012-10-17",
                ["Statement"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["Sid"] = "DenyAccessFromOutsideVPC",
                        ["Effect"] = "Deny",
                        ["Principal"] = new Dictionary<string, object?>
                        {
                            ["AWS"] = "*",
                        },
                        ["Action"] = new[]
                        {
                            "dsql:DbConnect",
                            "dsql:DbConnectAdmin",
                        },
                        ["Resource"] = "*",
                        ["Condition"] = new Dictionary<string, object?>
                        {
                            ["Null"] = new Dictionary<string, object?>
                            {
                                ["aws:SourceVpc"] = "true",
                            },
                        },
                    },
                },
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.dsql.Cluster;
    import com.pulumi.aws.dsql.ClusterPolicy;
    import com.pulumi.aws.dsql.ClusterPolicyArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 Cluster("example");
    
            var exampleClusterPolicy = new ClusterPolicy("exampleClusterPolicy", ClusterPolicyArgs.builder()
                .identifier(example.identifier())
                .policy(serializeJson(
                    jsonObject(
                        jsonProperty("Version", "2012-10-17"),
                        jsonProperty("Statement", jsonArray(jsonObject(
                            jsonProperty("Sid", "DenyAccessFromOutsideVPC"),
                            jsonProperty("Effect", "Deny"),
                            jsonProperty("Principal", jsonObject(
                                jsonProperty("AWS", "*")
                            )),
                            jsonProperty("Action", jsonArray(
                                "dsql:DbConnect", 
                                "dsql:DbConnectAdmin"
                            )),
                            jsonProperty("Resource", "*"),
                            jsonProperty("Condition", jsonObject(
                                jsonProperty("Null", jsonObject(
                                    jsonProperty("aws:SourceVpc", "true")
                                ))
                            ))
                        )))
                    )))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:dsql:Cluster
      exampleClusterPolicy:
        type: aws:dsql:ClusterPolicy
        name: example
        properties:
          identifier: ${example.identifier}
          policy:
            fn::toJSON:
              Version: 2012-10-17
              Statement:
                - Sid: DenyAccessFromOutsideVPC
                  Effect: Deny
                  Principal:
                    AWS: '*'
                  Action:
                    - dsql:DbConnect
                    - dsql:DbConnectAdmin
                  Resource: '*'
                  Condition:
                    Null:
                      aws:SourceVpc: 'true'
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    resource "aws_dsql_cluster" "example" {
    }
    resource "aws_dsql_clusterpolicy" "example" {
      identifier = aws_dsql_cluster.example.identifier
      policy = jsonencode({
        "Version" = "2012-10-17"
        "Statement" = [{
          "Sid"    = "DenyAccessFromOutsideVPC"
          "Effect" = "Deny"
          "Principal" = {
            "AWS" = "*"
          }
          "Action"   = ["dsql:DbConnect", "dsql:DbConnectAdmin"]
          "Resource" = "*"
          "Condition" = {
            "Null" = {
              "aws:SourceVpc" = "true"
            }
          }
        }]
      })
    }
    

    This policy denies dsql:DbConnect and dsql:DbConnectAdmin requests from the public internet. It only checks whether the request came from a VPC. To limit access to a specific VPC, use aws:SourceVpc with StringNotEquals.

    The calling principal still requires an identity-based IAM policy that allows the required Aurora DSQL actions on the cluster.

    Restrict Access to a Specific VPC

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.dsql.Cluster("example", {});
    const exampleClusterPolicy = new aws.dsql.ClusterPolicy("example", {
        identifier: example.identifier,
        policy: pulumi.jsonStringify({
            Version: "2012-10-17",
            Statement: [{
                Sid: "DenyAccessFromOtherVPCs",
                Effect: "Deny",
                Principal: {
                    AWS: "*",
                },
                Action: [
                    "dsql:DbConnect",
                    "dsql:DbConnectAdmin",
                ],
                Resource: example.arn,
                Condition: {
                    StringNotEquals: {
                        "aws:SourceVpc": exampleAwsVpc.id,
                    },
                },
            }],
        }),
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    example = aws.dsql.Cluster("example")
    example_cluster_policy = aws.dsql.ClusterPolicy("example",
        identifier=example.identifier,
        policy=pulumi.Output.json_dumps({
            "Version": "2012-10-17",
            "Statement": [{
                "Sid": "DenyAccessFromOtherVPCs",
                "Effect": "Deny",
                "Principal": {
                    "AWS": "*",
                },
                "Action": [
                    "dsql:DbConnect",
                    "dsql:DbConnectAdmin",
                ],
                "Resource": example.arn,
                "Condition": {
                    "StringNotEquals": {
                        "aws:SourceVpc": example_aws_vpc["id"],
                    },
                },
            }],
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/dsql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := dsql.NewCluster(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		_, err = dsql.NewClusterPolicy(ctx, "example", &dsql.ClusterPolicyArgs{
    			Identifier: example.Identifier,
    			Policy: example.Arn.ApplyT(func(arn string) (pulumi.String, error) {
    				var _zero pulumi.String
    				tmpJSON0, err := json.Marshal(map[string]interface{}{
    					"Version": "2012-10-17",
    					"Statement": []map[string]interface{}{
    						map[string]interface{}{
    							"Sid":    "DenyAccessFromOtherVPCs",
    							"Effect": "Deny",
    							"Principal": map[string]string{
    								"AWS": "*",
    							},
    							"Action": []string{
    								"dsql:DbConnect",
    								"dsql:DbConnectAdmin",
    							},
    							"Resource": arn,
    							"Condition": map[string]map[string]interface{}{
    								"StringNotEquals": map[string]interface{}{
    									"aws:SourceVpc": exampleAwsVpc.Id,
    								},
    							},
    						},
    					},
    				})
    				if err != nil {
    					return _zero, err
    				}
    				json0 := string(tmpJSON0)
    				return pulumi.String(json0), nil
    			}).(pulumi.StringOutput),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Dsql.Cluster("example");
    
        var exampleClusterPolicy = new Aws.Dsql.ClusterPolicy("example", new()
        {
            Identifier = example.Identifier,
            Policy = Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["Version"] = "2012-10-17",
                ["Statement"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["Sid"] = "DenyAccessFromOtherVPCs",
                        ["Effect"] = "Deny",
                        ["Principal"] = new Dictionary<string, object?>
                        {
                            ["AWS"] = "*",
                        },
                        ["Action"] = new[]
                        {
                            "dsql:DbConnect",
                            "dsql:DbConnectAdmin",
                        },
                        ["Resource"] = example.Arn,
                        ["Condition"] = new Dictionary<string, object?>
                        {
                            ["StringNotEquals"] = new Dictionary<string, object?>
                            {
                                ["aws:SourceVpc"] = exampleAwsVpc.Id,
                            },
                        },
                    },
                },
            })),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.dsql.Cluster;
    import com.pulumi.aws.dsql.ClusterPolicy;
    import com.pulumi.aws.dsql.ClusterPolicyArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 Cluster("example");
    
            var exampleClusterPolicy = new ClusterPolicy("exampleClusterPolicy", ClusterPolicyArgs.builder()
                .identifier(example.identifier())
                .policy(example.arn().applyValue(_arn -> serializeJson(
                    jsonObject(
                        jsonProperty("Version", "2012-10-17"),
                        jsonProperty("Statement", jsonArray(jsonObject(
                            jsonProperty("Sid", "DenyAccessFromOtherVPCs"),
                            jsonProperty("Effect", "Deny"),
                            jsonProperty("Principal", jsonObject(
                                jsonProperty("AWS", "*")
                            )),
                            jsonProperty("Action", jsonArray(
                                "dsql:DbConnect", 
                                "dsql:DbConnectAdmin"
                            )),
                            jsonProperty("Resource", _arn),
                            jsonProperty("Condition", jsonObject(
                                jsonProperty("StringNotEquals", jsonObject(
                                    jsonProperty("aws:SourceVpc", exampleAwsVpc.id())
                                ))
                            ))
                        )))
                    ))))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:dsql:Cluster
      exampleClusterPolicy:
        type: aws:dsql:ClusterPolicy
        name: example
        properties:
          identifier: ${example.identifier}
          policy:
            fn::toJSON:
              Version: 2012-10-17
              Statement:
                - Sid: DenyAccessFromOtherVPCs
                  Effect: Deny
                  Principal:
                    AWS: '*'
                  Action:
                    - dsql:DbConnect
                    - dsql:DbConnectAdmin
                  Resource: ${example.arn}
                  Condition:
                    StringNotEquals:
                      aws:SourceVpc: ${exampleAwsVpc.id}
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    resource "aws_dsql_cluster" "example" {
    }
    resource "aws_dsql_clusterpolicy" "example" {
      identifier = aws_dsql_cluster.example.identifier
      policy = jsonencode({
        "Version" = "2012-10-17"
        "Statement" = [{
          "Sid"    = "DenyAccessFromOtherVPCs"
          "Effect" = "Deny"
          "Principal" = {
            "AWS" = "*"
          }
          "Action"   = ["dsql:DbConnect", "dsql:DbConnectAdmin"]
          "Resource" = aws_dsql_cluster.example.arn
          "Condition" = {
            "StringNotEquals" = {
              "aws:SourceVpc" = exampleAwsVpc.id
            }
          }
        }]
      })
    }
    

    Restrict Access to an AWS Organization

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.dsql.Cluster("example", {});
    const exampleClusterPolicy = new aws.dsql.ClusterPolicy("example", {
        identifier: example.identifier,
        policy: pulumi.jsonStringify({
            Version: "2012-10-17",
            Statement: [{
                Sid: "DenyAccessFromOutsideOrganization",
                Effect: "Deny",
                Principal: {
                    AWS: "*",
                },
                Action: [
                    "dsql:DbConnect",
                    "dsql:DbConnectAdmin",
                ],
                Resource: example.arn,
                Condition: {
                    StringNotEquals: {
                        "aws:PrincipalOrgID": "o-exampleorgid",
                    },
                },
            }],
        }),
    });
    
    import pulumi
    import json
    import pulumi_aws as aws
    
    example = aws.dsql.Cluster("example")
    example_cluster_policy = aws.dsql.ClusterPolicy("example",
        identifier=example.identifier,
        policy=pulumi.Output.json_dumps({
            "Version": "2012-10-17",
            "Statement": [{
                "Sid": "DenyAccessFromOutsideOrganization",
                "Effect": "Deny",
                "Principal": {
                    "AWS": "*",
                },
                "Action": [
                    "dsql:DbConnect",
                    "dsql:DbConnectAdmin",
                ],
                "Resource": example.arn,
                "Condition": {
                    "StringNotEquals": {
                        "aws:PrincipalOrgID": "o-exampleorgid",
                    },
                },
            }],
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/dsql"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := dsql.NewCluster(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		_, err = dsql.NewClusterPolicy(ctx, "example", &dsql.ClusterPolicyArgs{
    			Identifier: example.Identifier,
    			Policy: example.Arn.ApplyT(func(arn string) (pulumi.String, error) {
    				var _zero pulumi.String
    				tmpJSON0, err := json.Marshal(map[string]interface{}{
    					"Version": "2012-10-17",
    					"Statement": []map[string]interface{}{
    						map[string]interface{}{
    							"Sid":    "DenyAccessFromOutsideOrganization",
    							"Effect": "Deny",
    							"Principal": map[string]string{
    								"AWS": "*",
    							},
    							"Action": []string{
    								"dsql:DbConnect",
    								"dsql:DbConnectAdmin",
    							},
    							"Resource": arn,
    							"Condition": map[string]map[string]string{
    								"StringNotEquals": map[string]string{
    									"aws:PrincipalOrgID": "o-exampleorgid",
    								},
    							},
    						},
    					},
    				})
    				if err != nil {
    					return _zero, err
    				}
    				json0 := string(tmpJSON0)
    				return pulumi.String(json0), nil
    			}).(pulumi.StringOutput),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Dsql.Cluster("example");
    
        var exampleClusterPolicy = new Aws.Dsql.ClusterPolicy("example", new()
        {
            Identifier = example.Identifier,
            Policy = Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
            {
                ["Version"] = "2012-10-17",
                ["Statement"] = new[]
                {
                    new Dictionary<string, object?>
                    {
                        ["Sid"] = "DenyAccessFromOutsideOrganization",
                        ["Effect"] = "Deny",
                        ["Principal"] = new Dictionary<string, object?>
                        {
                            ["AWS"] = "*",
                        },
                        ["Action"] = new[]
                        {
                            "dsql:DbConnect",
                            "dsql:DbConnectAdmin",
                        },
                        ["Resource"] = example.Arn,
                        ["Condition"] = new Dictionary<string, object?>
                        {
                            ["StringNotEquals"] = new Dictionary<string, object?>
                            {
                                ["aws:PrincipalOrgID"] = "o-exampleorgid",
                            },
                        },
                    },
                },
            })),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.dsql.Cluster;
    import com.pulumi.aws.dsql.ClusterPolicy;
    import com.pulumi.aws.dsql.ClusterPolicyArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 Cluster("example");
    
            var exampleClusterPolicy = new ClusterPolicy("exampleClusterPolicy", ClusterPolicyArgs.builder()
                .identifier(example.identifier())
                .policy(example.arn().applyValue(_arn -> serializeJson(
                    jsonObject(
                        jsonProperty("Version", "2012-10-17"),
                        jsonProperty("Statement", jsonArray(jsonObject(
                            jsonProperty("Sid", "DenyAccessFromOutsideOrganization"),
                            jsonProperty("Effect", "Deny"),
                            jsonProperty("Principal", jsonObject(
                                jsonProperty("AWS", "*")
                            )),
                            jsonProperty("Action", jsonArray(
                                "dsql:DbConnect", 
                                "dsql:DbConnectAdmin"
                            )),
                            jsonProperty("Resource", _arn),
                            jsonProperty("Condition", jsonObject(
                                jsonProperty("StringNotEquals", jsonObject(
                                    jsonProperty("aws:PrincipalOrgID", "o-exampleorgid")
                                ))
                            ))
                        )))
                    ))))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:dsql:Cluster
      exampleClusterPolicy:
        type: aws:dsql:ClusterPolicy
        name: example
        properties:
          identifier: ${example.identifier}
          policy:
            fn::toJSON:
              Version: 2012-10-17
              Statement:
                - Sid: DenyAccessFromOutsideOrganization
                  Effect: Deny
                  Principal:
                    AWS: '*'
                  Action:
                    - dsql:DbConnect
                    - dsql:DbConnectAdmin
                  Resource: ${example.arn}
                  Condition:
                    StringNotEquals:
                      aws:PrincipalOrgID: o-exampleorgid
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    resource "aws_dsql_cluster" "example" {
    }
    resource "aws_dsql_clusterpolicy" "example" {
      identifier = aws_dsql_cluster.example.identifier
      policy = jsonencode({
        "Version" = "2012-10-17"
        "Statement" = [{
          "Sid"    = "DenyAccessFromOutsideOrganization"
          "Effect" = "Deny"
          "Principal" = {
            "AWS" = "*"
          }
          "Action"   = ["dsql:DbConnect", "dsql:DbConnectAdmin"]
          "Resource" = aws_dsql_cluster.example.arn
          "Condition" = {
            "StringNotEquals" = {
              "aws:PrincipalOrgID" = "o-exampleorgid"
            }
          }
        }]
      })
    }
    

    For more examples, including specific organizational units and multi-Region cluster policies, see the Aurora DSQL resource-based policy examples.

    Create ClusterPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClusterPolicy(name: string, args: ClusterPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ClusterPolicy(resource_name: str,
                      args: ClusterPolicyArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClusterPolicy(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      identifier: Optional[str] = None,
                      policy: Optional[str] = None,
                      bypass_policy_lockout_safety_check: Optional[bool] = None,
                      region: Optional[str] = None,
                      timeouts: Optional[ClusterPolicyTimeoutsArgs] = None)
    func NewClusterPolicy(ctx *Context, name string, args ClusterPolicyArgs, opts ...ResourceOption) (*ClusterPolicy, error)
    public ClusterPolicy(string name, ClusterPolicyArgs args, CustomResourceOptions? opts = null)
    public ClusterPolicy(String name, ClusterPolicyArgs args)
    public ClusterPolicy(String name, ClusterPolicyArgs args, CustomResourceOptions options)
    
    type: aws:dsql:ClusterPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "aws_dsql_cluster_policy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ClusterPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ClusterPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ClusterPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var clusterPolicyResource = new Aws.Dsql.ClusterPolicy("clusterPolicyResource", new()
    {
        Identifier = "string",
        Policy = "string",
        BypassPolicyLockoutSafetyCheck = false,
        Region = "string",
        Timeouts = new Aws.Dsql.Inputs.ClusterPolicyTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := dsql.NewClusterPolicy(ctx, "clusterPolicyResource", &dsql.ClusterPolicyArgs{
    	Identifier:                     pulumi.String("string"),
    	Policy:                         pulumi.String("string"),
    	BypassPolicyLockoutSafetyCheck: pulumi.Bool(false),
    	Region:                         pulumi.String("string"),
    	Timeouts: &dsql.ClusterPolicyTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    resource "aws_dsql_cluster_policy" "clusterPolicyResource" {
      lifecycle {
        create_before_destroy = true
      }
      identifier                         = "string"
      policy                             = "string"
      bypass_policy_lockout_safety_check = false
      region                             = "string"
      timeouts = {
        create = "string"
        delete = "string"
        update = "string"
      }
    }
    
    var clusterPolicyResource = new com.pulumi.aws.dsql.ClusterPolicy("clusterPolicyResource", com.pulumi.aws.dsql.ClusterPolicyArgs.builder()
        .identifier("string")
        .policy("string")
        .bypassPolicyLockoutSafetyCheck(false)
        .region("string")
        .timeouts(ClusterPolicyTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    cluster_policy_resource = aws.dsql.ClusterPolicy("clusterPolicyResource",
        identifier="string",
        policy="string",
        bypass_policy_lockout_safety_check=False,
        region="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const clusterPolicyResource = new aws.dsql.ClusterPolicy("clusterPolicyResource", {
        identifier: "string",
        policy: "string",
        bypassPolicyLockoutSafetyCheck: false,
        region: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: aws:dsql:ClusterPolicy
    properties:
        bypassPolicyLockoutSafetyCheck: false
        identifier: string
        policy: string
        region: string
        timeouts:
            create: string
            delete: string
            update: string
    

    ClusterPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ClusterPolicy resource accepts the following input properties:

    Identifier string
    Identifier of the Aurora DSQL Cluster.
    Policy string
    Resource-based policy document as JSON.
    BypassPolicyLockoutSafetyCheck bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Timeouts ClusterPolicyTimeouts
    Identifier string
    Identifier of the Aurora DSQL Cluster.
    Policy string
    Resource-based policy document as JSON.
    BypassPolicyLockoutSafetyCheck bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Timeouts ClusterPolicyTimeoutsArgs
    identifier string
    Identifier of the Aurora DSQL Cluster.
    policy string
    Resource-based policy document as JSON.
    bypass_policy_lockout_safety_check bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts object
    identifier String
    Identifier of the Aurora DSQL Cluster.
    policy String
    Resource-based policy document as JSON.
    bypassPolicyLockoutSafetyCheck Boolean
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts ClusterPolicyTimeouts
    identifier string
    Identifier of the Aurora DSQL Cluster.
    policy string
    Resource-based policy document as JSON.
    bypassPolicyLockoutSafetyCheck boolean
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts ClusterPolicyTimeouts
    identifier str
    Identifier of the Aurora DSQL Cluster.
    policy str
    Resource-based policy document as JSON.
    bypass_policy_lockout_safety_check bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts ClusterPolicyTimeoutsArgs
    identifier String
    Identifier of the Aurora DSQL Cluster.
    policy String
    Resource-based policy document as JSON.
    bypassPolicyLockoutSafetyCheck Boolean
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClusterPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyVersion string
    Version of the policy document.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyVersion string
    Version of the policy document.
    id string
    The provider-assigned unique ID for this managed resource.
    policy_version string
    Version of the policy document.
    id String
    The provider-assigned unique ID for this managed resource.
    policyVersion String
    Version of the policy document.
    id string
    The provider-assigned unique ID for this managed resource.
    policyVersion string
    Version of the policy document.
    id str
    The provider-assigned unique ID for this managed resource.
    policy_version str
    Version of the policy document.
    id String
    The provider-assigned unique ID for this managed resource.
    policyVersion String
    Version of the policy document.

    Look up Existing ClusterPolicy Resource

    Get an existing ClusterPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ClusterPolicyState, opts?: CustomResourceOptions): ClusterPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bypass_policy_lockout_safety_check: Optional[bool] = None,
            identifier: Optional[str] = None,
            policy: Optional[str] = None,
            policy_version: Optional[str] = None,
            region: Optional[str] = None,
            timeouts: Optional[ClusterPolicyTimeoutsArgs] = None) -> ClusterPolicy
    func GetClusterPolicy(ctx *Context, name string, id IDInput, state *ClusterPolicyState, opts ...ResourceOption) (*ClusterPolicy, error)
    public static ClusterPolicy Get(string name, Input<string> id, ClusterPolicyState? state, CustomResourceOptions? opts = null)
    public static ClusterPolicy get(String name, Output<String> id, ClusterPolicyState state, CustomResourceOptions options)
    resources:  _:    type: aws:dsql:ClusterPolicy    get:      id: ${id}
    import {
      to = aws_dsql_cluster_policy.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BypassPolicyLockoutSafetyCheck bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    Identifier string
    Identifier of the Aurora DSQL Cluster.
    Policy string
    Resource-based policy document as JSON.
    PolicyVersion string
    Version of the policy document.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Timeouts ClusterPolicyTimeouts
    BypassPolicyLockoutSafetyCheck bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    Identifier string
    Identifier of the Aurora DSQL Cluster.
    Policy string
    Resource-based policy document as JSON.
    PolicyVersion string
    Version of the policy document.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Timeouts ClusterPolicyTimeoutsArgs
    bypass_policy_lockout_safety_check bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    identifier string
    Identifier of the Aurora DSQL Cluster.
    policy string
    Resource-based policy document as JSON.
    policy_version string
    Version of the policy document.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts object
    bypassPolicyLockoutSafetyCheck Boolean
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    identifier String
    Identifier of the Aurora DSQL Cluster.
    policy String
    Resource-based policy document as JSON.
    policyVersion String
    Version of the policy document.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts ClusterPolicyTimeouts
    bypassPolicyLockoutSafetyCheck boolean
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    identifier string
    Identifier of the Aurora DSQL Cluster.
    policy string
    Resource-based policy document as JSON.
    policyVersion string
    Version of the policy document.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts ClusterPolicyTimeouts
    bypass_policy_lockout_safety_check bool
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    identifier str
    Identifier of the Aurora DSQL Cluster.
    policy str
    Resource-based policy document as JSON.
    policy_version str
    Version of the policy document.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts ClusterPolicyTimeoutsArgs
    bypassPolicyLockoutSafetyCheck Boolean
    Whether to bypass the policy lockout safety check. Setting this value to true increases the risk that the cluster becomes unmanageable. Defaults to false.
    identifier String
    Identifier of the Aurora DSQL Cluster.
    policy String
    Resource-based policy document as JSON.
    policyVersion String
    Version of the policy document.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    timeouts Property Map

    Supporting Types

    ClusterPolicyTimeouts, ClusterPolicyTimeoutsArgs

    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Import

    Identity Schema

    Required

    • identifier (String) Identifier of the Aurora DSQL Cluster.

    Optional

    • accountId (String) AWS Account where this resource is managed.
    • region (String) Region where this resource is managed.

    Using pulumi import, import Aurora DSQL Cluster Policies using the cluster identifier. For example:

    $ pulumi import aws:dsql/clusterPolicy:ClusterPolicy example abcde1f234ghijklmnop5qr6st
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo aws logo
    Viewing docs for AWS v7.43.0
    published on Thursday, Aug 20, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial