# CfnResourcePolicyProps

Properties for defining a `CfnResourcePolicy`.

Used as props by: [CfnResourcePolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.CfnResourcePolicy.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';

declare const resourcePolicy: any;
const cfnResourcePolicyProps: secretsmanager.CfnResourcePolicyProps = {
  resourcePolicy: resourcePolicy,
  secretId: 'secretId',

  // the properties below are optional
  blockPublicPolicy: false,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_secretsmanager as secretsmanager

# resource_policy: Any

cfn_resource_policy_props = secretsmanager.CfnResourcePolicyProps(
    resource_policy=resource_policy,
    secret_id="secretId",

    # the properties below are optional
    block_public_policy=False
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.secretsmanager.*;

Object resourcePolicy;

CfnResourcePolicyProps cfnResourcePolicyProps = CfnResourcePolicyProps.builder()
        .resourcePolicy(resourcePolicy)
        .secretId("secretId")

        // the properties below are optional
        .blockPublicPolicy(false)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SecretsManager;

var resourcePolicy;

var cfnResourcePolicyProps = new CfnResourcePolicyProps {
    ResourcePolicy = resourcePolicy,
    SecretId = "secretId",

    // the properties below are optional
    BlockPublicPolicy = false
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var resourcePolicy interface{}

cfnResourcePolicyProps := &CfnResourcePolicyProps{
	ResourcePolicy: resourcePolicy,
	SecretId: jsii.String("secretId"),

	// the properties below are optional
	BlockPublicPolicy: jsii.Boolean(false),
}
```

## Properties

- `blockPublicPolicy`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Specifies whether to block resource-based policies that allow broad access to the secret.

  By default, Secrets Manager blocks policies that allow broad access, for example those that use a wildcard for the principal.

- `resourcePolicy`: any (required) — A JSON-formatted string for an AWS resource-based policy.

  For example policies, see [Permissions policy examples](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html) .

- `secretId`: string | [ISecretRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_secretsmanager.ISecretRef.html) (required) — The ARN or name of the secret to attach the resource-based policy.

  For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.
