CfnResourcePolicyProps Struct
Properties for defining a CfnResourcePolicy.
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 resourcePolicy: any;
const cfnResourcePolicyProps: secretsmanager.CfnResourcePolicyProps = {
resourcePolicy: resourcePolicy,
secretId: 'secretId',
// the properties below are optional
blockPublicPolicy: false,
};
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
// 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();
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
};
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
blockPublicPolicyoptionalboolean | IResolvableblock_public_policyoptionaltyping.Union[bool, IResolvable]blockPublicPolicyoptionalBooleanBlockPublicPolicyoptionalboolBlockPublicPolicyoptionalinterface{}#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.
resourcePolicyanyresource_policyAnyresourcePolicyObjectResourcePolicyobjectResourcePolicyinterface{}required#A JSON-formatted string for an AWS resource-based policy.
For example policies, see Permissions policy examples .
secretIdstring | ISecretRefsecret_idtyping.Union[str, ISecretRef]secretIdStringSecretIdstringSecretIdinterface{}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.