aws-cdk-lib.CfnHook

class CfnHook (construct)

LanguageType name
.NETAmazon.CDK.CfnHook
Gogithub.com/aws/aws-cdk-go/awscdk/v2#CfnHook
Javasoftware.amazon.awscdk.CfnHook
Pythonaws_cdk.CfnHook
TypeScript (source)aws-cdk-lib » CfnHook

Implements IConstruct, IDependable

Represents a CloudFormation resource.

Example

declare const cfnTemplate: cfn_inc.CfnInclude;
const hook: core.CfnHook = cfnTemplate.getHook('MyOutput');

// mutating the hook
declare const myRole: iam.Role;
const codeDeployHook = hook as core.CfnCodeDeployBlueGreenHook;
codeDeployHook.serviceRole = myRole.roleArn;

Initializer

new CfnHook(scope: Construct, id: string, props: CfnHookProps)

Parameters

  • scope Construct
  • id string
  • props CfnHookProps

Creates a new Hook object.

Construct Props

NameTypeDescription
typestringThe type of the hook (for example, "AWS::CodeDeploy::BlueGreen").
properties?{ [string]: any }The properties of the hook.

type

Type: string

The type of the hook (for example, "AWS::CodeDeploy::BlueGreen").


properties?

Type: { [string]: any } (optional, default: no properties)

The properties of the hook.

Properties

NameTypeDescription
creationStackstring[]
logicalIdstringThe logical ID for this CloudFormation stack element.
nodeNodeThe tree node.
stackStackThe stack in which this element is defined.
typestringThe type of the hook (for example, "AWS::CodeDeploy::BlueGreen").

creationStack

Type: string[]


logicalId

Type: string

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).


type

Type: string

The type of the hook (for example, "AWS::CodeDeploy::BlueGreen").

Methods

NameDescription
overrideLogicalId(newLogicalId)Overrides the auto-generated logical ID with a specific ID.
toString()Returns a string representation of this construct.
protected renderProperties(props?)

overrideLogicalId(newLogicalId)

public overrideLogicalId(newLogicalId: string): void

Parameters

  • newLogicalId string — The new logical ID to use for this stack element.

Overrides the auto-generated logical ID with a specific ID.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected renderProperties(props?)

protected renderProperties(props?: { [string]: any }): { [string]: any }

Parameters

  • props { [string]: any }

Returns

  • { [string]: any }