AwsSecretsManager
Service-level AWS Secrets Manager component.
Remarks
This is the primary component resource for the package. It can orchestrate creation of Secrets Manager secret and secret policy capabilities through a single component boundary.
Naming:
- Root type token:
${namespace}:aws:AwsSecretsManager; capability literal:sm. The root is${env}-${projectHash}-sm-${sanitiseNamePart(identity)}, whereidentityis the sharedargs.secret.nameor semantic/externalargs.secretPolicy.secretArn. Punctuation-only identities are rejected. aws:secretsmanager/secret:Secretandaws:secretsmanager/secretVersion:SecretVersionchildren created byAwsSecretsManagerSecretuse[args.name]; their final logical name is${env}-${projectHash}-${sanitiseNamePart(args.name)}.aws:secretsmanager/secretPolicy:SecretPolicychildren created byAwsSecretsManagerSecretPolicyuse[args.secretArn]; their final logical name is${env}-${projectHash}-${sanitiseNamePart(args.secretArn)}. Punctuation-onlyargs.secretArnvalues are rejected.- The secret AWS
nameuses thestackAndPurposestyle${env}-${projectHash}-${args.secret.name}. The component validatesargs.secret.nameas a camelCase purpose; the 512-character provider limit needs no local cap. Secret policysecretArnis a semantic/external provider input forwarded unchanged; provider validation owns its ARN constraints. Secret version and policy resources set no AWS name.
Example
const dbSecret = new AwsSecretsManager({
secret: {
description: 'Database credentials for the application',
name: 'dbCredentials',
kmsKey: { identifier: 'alias/application-secrets' },
},
});
const dbSecretPolicy = new AwsSecretsManager({
secretPolicy: {
secretArn: 'arn:aws:secretsmanager:eu-west-1:000000000000:secret:db-credentials',
policy: {
path: './policies/db-credentials-policy.json',
},
},
});Constructors
new AwsSecretsManager(
args: AwsSecretsManagerArgs,
options?: ComponentResourceOptions,
): AwsSecretsManager
Parameters
args(AwsSecretsManagerArgs) — Service-level Secrets Manager capability inputs.The component logical name is derived fromargs.secret.nameorargs.secretPolicy.secretArn.options(ComponentResourceOptions, optional) — Optional settings controlling resource behaviour.
Returns
AwsSecretsManager
Hierarchy
ComponentResourceAwsSecretsManager
Properties
secret: AwsSecretsManagerSecret
Optional Secrets Manager secret capability created by this component.
secretPolicy: AwsSecretsManagerSecretPolicy
Optional Secrets Manager secret policy capability created by this component.
urn: Output<string>
Inherited from urn
The stable logical URN used to distinctly address a resource, both before and after deployments.
Methods
getData(): Promise<any>
Inherited from getData
Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.
Returns
Promise<any>
getProvider(moduleMember: string): ProviderResource | undefined
Inherited from getProvider
Returns the provider for the given module member, if one exists.
Parameters
moduleMember(string)
Returns
ProviderResource | undefined
initialize(
args: Inputs,
opts?: ComponentResourceOptions,
name?: string,
type?: string,
): Promise<any>
Inherited from initialize
Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.
Parameters
args(Inputs)opts(ComponentResourceOptions, optional)name(string, optional)type(string, optional)
Returns
Promise<any>
registerOutputs(
outputs?: Inputs | Promise<Inputs> | Output<Inputs>,
): void
Inherited from registerOutputs
Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.
Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.
Parameters
outputs(Inputs | Promise<Inputs> | Output<Inputs>, optional)
Returns
void
Static Methods
isInstance(obj: any): obj is ComponentResource<any>
Inherited from isInstance
Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
Parameters
obj(any)
Returns
obj is ComponentResource<any>