AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

ResourcePolicy

Resource Policy for SecretsManager Secrets. Policies define the operations that are allowed on this resource. You almost never need to define this construct directly. All AWS resources that support resource policies have a method called `addToResourcePolicy()`, which will automatically create a new resource policy if one doesn't exist yet, otherwise it will add to the existing policy. Prefer to use `addToResourcePolicy()` instead.

Import

import { ResourcePolicy } from 'aws-cdk-lib/aws-secretsmanager';

Or use the module namespace:

import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
// secretsmanager.ResourcePolicy

Properties

Configuration passed to the constructor as ResourcePolicyProps.

secretRequired
ISecret

The secret to attach a resource-based permissions policy.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter