Skip to content
v2.278.0

ResourcePolicyProps Struct ​

Construction properties for a ResourcePolicy.

Example ​

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 secret: secretsmanager.Secret;
const resourcePolicyProps: secretsmanager.ResourcePolicyProps = {
  secret: secret,
};
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

# secret: secretsmanager.Secret

resource_policy_props = secretsmanager.ResourcePolicyProps(
    secret=secret
)
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.*;

Secret secret;

ResourcePolicyProps resourcePolicyProps = ResourcePolicyProps.builder()
        .secret(secret)
        .build();
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;

Secret secret;

var resourcePolicyProps = new ResourcePolicyProps {
    Secret = secret
};
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 secret Secret

resourcePolicyProps := &ResourcePolicyProps{
	Secret: secret,
}

Properties ​

secretISecretsecretISecretsecretISecretSecretISecretSecretISecret required #
The secret to attach a resource-based permissions policy.