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)}, where identity is the shared args.secret.name or semantic/external args.secretPolicy.secretArn. Punctuation-only identities are rejected.
  • aws:secretsmanager/secret:Secret and aws:secretsmanager/secretVersion:SecretVersion children created by AwsSecretsManagerSecret use [args.name]; their final logical name is ${env}-${projectHash}-${sanitiseNamePart(args.name)}.
  • aws:secretsmanager/secretPolicy:SecretPolicy children created by AwsSecretsManagerSecretPolicy use [args.secretArn]; their final logical name is ${env}-${projectHash}-${sanitiseNamePart(args.secretArn)}. Punctuation-only args.secretArn values are rejected.
  • The secret AWS name uses the stackAndPurpose style ${env}-${projectHash}-${args.secret.name}. The component validates args.secret.name as a camelCase purpose; the 512-character provider limit needs no local cap. Secret policy secretArn is a semantic/external provider input forwarded unchanged; provider validation owns its ARN constraints. Secret version and policy resources set no AWS name.

Example

CODE
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 from args.secret.name or args.secretPolicy.secretArn.
  • options (ComponentResourceOptions, optional) — Optional settings controlling resource behaviour.

Returns

AwsSecretsManager

Hierarchy

  • ComponentResource
  • AwsSecretsManager

Properties

secret: AwsSecretsManagerSecret

readonly

Optional Secrets Manager secret capability created by this component.

secretPolicy: AwsSecretsManagerSecretPolicy

readonly

Optional Secrets Manager secret policy capability created by this component.

urn: Output<string>

readonly

Inherited from urn

The stable logical URN used to distinctly address a resource, both before and after deployments.

Methods

getData(): Promise<any>

protectedasync

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>

protectedasync

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

protected

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>

static

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>