AwsSecretsManagerSecretPolicy
Creates an AWS Secrets Manager secret resource policy.
Remarks
This component wraps aws.secretsmanager.SecretPolicy and provides policy-template convenience. The policy template is rendered before resource creation.
Unlike the inline policy field on a secret, this manages the resource policy as its own lifecycle resource. Use this when you want separate drift detection or permissioning for the resource policy.
Naming:
- This value helper owns no component root or type token.
- Its
aws:secretsmanager/secretPolicy:SecretPolicychild receives[args.secretArn]and is named${env}-${projectHash}-${sanitiseNamePart(args.secretArn)}. Punctuation-onlyargs.secretArnvalues are rejected. args.secretArnis a semantic/external ARN forwarded unchanged to the provider; provider validation owns ARN constraints. The policy resource has no provider name.
Example
CODE
const secretPolicy = new AwsSecretsManagerSecretPolicy({
secretArn: 'arn:aws:secretsmanager:eu-west-1:000000000000:secret:db-credentials-abc123',
policy: {
path: './policies/db-credentials-policy.json',
},
});Constructors
new AwsSecretsManagerSecretPolicy(
args: AwsSecretsManagerSecretPolicyResourceArgs,
options?: ResourceOptions,
): AwsSecretsManagerSecretPolicy
Parameters
args(AwsSecretsManagerSecretPolicyResourceArgs) — Component inputs forwarded to the underlying secret policy resource.options(ResourceOptions, optional) — Optional settings controlling resource behaviour.
Returns
AwsSecretsManagerSecretPolicy
Properties
id: Output<string>
readonly
The provider-assigned ID for this resource.
secretPolicy: SecretPolicy
readonly
The underlying AWS Secrets Manager secret policy resource.