@cdklabs/cdk-ssm-documents 0.0.18 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/.jsii +841 -79
  2. package/API.md +1932 -426
  3. package/README.md +5 -1
  4. package/changelog.md +3 -3
  5. package/lib/construct/synth-utils.js +1 -1
  6. package/lib/document/automation-document.js +1 -1
  7. package/lib/document/command-document.js +1 -1
  8. package/lib/document/document-builder.js +2 -2
  9. package/lib/document/ssm-document.js +1 -1
  10. package/lib/domain/choice.js +1 -1
  11. package/lib/domain/data-type.js +1 -1
  12. package/lib/domain/enum/install-action.js +2 -2
  13. package/lib/domain/enum/install-uninstall-repair.js +2 -2
  14. package/lib/domain/enum/installation-type.js +2 -2
  15. package/lib/domain/enum/package-name.js +2 -2
  16. package/lib/domain/input.js +1 -1
  17. package/lib/domain/operation.js +1 -1
  18. package/lib/domain/platform.js +1 -1
  19. package/lib/domain/precondition.js +1 -1
  20. package/lib/index.d.ts +2 -0
  21. package/lib/index.js +3 -1
  22. package/lib/interface/approve-hook.js +2 -2
  23. package/lib/interface/auth-method.js +3 -3
  24. package/lib/interface/aws-invoker.js +2 -2
  25. package/lib/interface/downloadable-content.js +8 -8
  26. package/lib/interface/environment.js +3 -3
  27. package/lib/interface/execute-automation-hook/api-execute-automation-hook.js +1 -1
  28. package/lib/interface/observer.js +1 -1
  29. package/lib/interface/on-failure.d.ts +75 -0
  30. package/lib/interface/on-failure.js +141 -0
  31. package/lib/interface/pause-hook.js +2 -2
  32. package/lib/interface/run-command-hook/api-run-command-hook.js +1 -1
  33. package/lib/interface/run-document-location.js +2 -2
  34. package/lib/interface/sleep-hook.js +2 -2
  35. package/lib/interface/step-ref.d.ts +21 -0
  36. package/lib/interface/step-ref.js +40 -0
  37. package/lib/interface/variables/boolean-variable.js +2 -2
  38. package/lib/interface/variables/map-list-variable.js +2 -2
  39. package/lib/interface/variables/number-variable.js +2 -2
  40. package/lib/interface/variables/secure-string-variable.js +4 -4
  41. package/lib/interface/variables/string-list-variable.js +2 -2
  42. package/lib/interface/variables/string-map-variable.js +2 -2
  43. package/lib/interface/variables/string-variable.js +4 -4
  44. package/lib/interface/variables/variable.js +2 -2
  45. package/lib/interface/webhook.js +1 -1
  46. package/lib/parent-steps/automation/approve-step.js +1 -1
  47. package/lib/parent-steps/automation/assert-aws-resource-step.js +1 -1
  48. package/lib/parent-steps/automation/aws-api-step.js +1 -1
  49. package/lib/parent-steps/automation/branch-step.js +1 -1
  50. package/lib/parent-steps/automation/change-instance-state-step.js +3 -3
  51. package/lib/parent-steps/automation/copy-image-step.js +1 -1
  52. package/lib/parent-steps/automation/create-image-step.js +1 -1
  53. package/lib/parent-steps/automation/create-stack-step.js +3 -3
  54. package/lib/parent-steps/automation/create-tags-step.js +3 -3
  55. package/lib/parent-steps/automation/delete-image-step.js +1 -1
  56. package/lib/parent-steps/automation/delete-stack-step.js +1 -1
  57. package/lib/parent-steps/automation/execute-automation-step.js +1 -1
  58. package/lib/parent-steps/automation/execute-script-step.js +1 -1
  59. package/lib/parent-steps/automation/execute-state-machine-step.js +1 -1
  60. package/lib/parent-steps/automation/invoke-lambda-function-step.js +1 -1
  61. package/lib/parent-steps/automation/invoke-webhook-step.js +1 -1
  62. package/lib/parent-steps/automation/pause-step.js +1 -1
  63. package/lib/parent-steps/automation/run-command-step.js +3 -3
  64. package/lib/parent-steps/automation/run-instance-step.js +1 -1
  65. package/lib/parent-steps/automation/sleep-step.js +1 -1
  66. package/lib/parent-steps/automation/wait-for-resource-step.js +1 -1
  67. package/lib/parent-steps/automation-step.d.ts +33 -24
  68. package/lib/parent-steps/automation-step.js +16 -11
  69. package/lib/parent-steps/command/applications-step.js +1 -1
  70. package/lib/parent-steps/command/configure-docker-step.js +1 -1
  71. package/lib/parent-steps/command/configure-package-step.js +1 -1
  72. package/lib/parent-steps/command/domain-join-step.js +1 -1
  73. package/lib/parent-steps/command/download-content-step.js +1 -1
  74. package/lib/parent-steps/command/ps-module-step.js +1 -1
  75. package/lib/parent-steps/command/run-docker-action-step.js +1 -1
  76. package/lib/parent-steps/command/run-document-step.js +1 -1
  77. package/lib/parent-steps/command/run-powershell-script-step.js +1 -1
  78. package/lib/parent-steps/command/run-shell-script-step.js +1 -1
  79. package/lib/parent-steps/command/software-inventory-step.js +1 -1
  80. package/lib/parent-steps/command/update-agent-step.js +1 -1
  81. package/lib/parent-steps/command/update-ssm-agent-step.js +1 -1
  82. package/lib/parent-steps/command-step.js +1 -1
  83. package/lib/parent-steps/step.js +1 -1
  84. package/lib/patterns/automation/composite-step.js +2 -2
  85. package/lib/patterns/automation/reboot-instance-and-wait.js +1 -1
  86. package/lib/patterns/automation/string-step.js +1 -1
  87. package/lib/patterns/document/string-document.js +1 -1
  88. package/lib/patterns/document/timed-document.js +1 -1
  89. package/lib/samples/hello-world.js +1 -1
  90. package/lib/simulation/automation/approve-simulation.js +1 -1
  91. package/lib/simulation/automation/assert-aws-resource-simulation.js +1 -1
  92. package/lib/simulation/automation/automation-simulation-base.js +1 -1
  93. package/lib/simulation/automation/aws-api-simulation.js +1 -1
  94. package/lib/simulation/automation/branch-simulation.js +1 -1
  95. package/lib/simulation/automation/change-instance-state-simulation.js +1 -1
  96. package/lib/simulation/automation/copy-image-simulation.js +1 -1
  97. package/lib/simulation/automation/create-image-simulation.js +1 -1
  98. package/lib/simulation/automation/create-stack-simulation.js +1 -1
  99. package/lib/simulation/automation/create-tags-simulation.js +1 -1
  100. package/lib/simulation/automation/delete-image-simulation.js +1 -1
  101. package/lib/simulation/automation/delete-stack-simulation.js +1 -1
  102. package/lib/simulation/automation/execute-script-simulation.js +1 -1
  103. package/lib/simulation/automation/execute-state-machine-simulation.js +1 -1
  104. package/lib/simulation/automation/invoke-lambda-function-simulation.js +1 -1
  105. package/lib/simulation/automation/invoke-webhook-simulation.js +1 -1
  106. package/lib/simulation/automation/pause-simulation.js +1 -1
  107. package/lib/simulation/automation/run-command-simulation.js +1 -1
  108. package/lib/simulation/automation/run-instance-simulation.js +1 -1
  109. package/lib/simulation/automation/sleep-simulation.js +1 -1
  110. package/lib/simulation/automation/wait-for-resource-simulation.js +1 -1
  111. package/lib/simulation/automation-step-simulation.js +18 -8
  112. package/lib/simulation/command/command-simulation-base.js +1 -1
  113. package/lib/simulation/command/ps-module-simulation.js +1 -1
  114. package/lib/simulation/command/run-powershell-script-simulation.js +1 -1
  115. package/lib/simulation/command/run-shell-script-simulation.js +1 -1
  116. package/lib/simulation/command-step-simulation.js +1 -1
  117. package/lib/simulation/document/automation-simulation.js +3 -3
  118. package/lib/simulation/document/command-simulation.js +1 -1
  119. package/lib/simulation/simulation.js +1 -1
  120. package/package.json +1 -1
  121. package/releasetag.txt +1 -1
  122. package/version.txt +1 -1
package/.jsii CHANGED
@@ -2798,7 +2798,7 @@
2798
2798
  },
2799
2799
  "name": "@cdklabs/cdk-ssm-documents",
2800
2800
  "readme": {
2801
- "markdown": "# SSM Document CDK\nThis library provides a code-based utility for implementing SSM Documents. The SSM Document objects can be used to print YAML/JSON documents and to mimic document processing locally.\n\nThis library abstracts SSM Documents at a high level, with each step as well as the document itself being objects. The properties needed to build these objects correlate to the settings that apply to them, making them simple to make.\nThis library can be used to test your document locally before deploying it to SSM.\n\nSince the library is written in JSII, it can be exported to other languages that support JSII (Java, Python).\n\nThis is what you'd use if you wanted to:\n1. The ability to test without deploying resources or executing an actual SSM on AWS.\n2. Reusability of steps between documents by reusing existing items\n3. Create logical higher-level groupings of reusable groups of steps (\"Patterns\")\n4. Simple to use interface for writing documents\n5. Import existing documents from a file (or string) and mimic them locally to test them.\n\n## Usage\n\n### Document Creation\n\nTypescript usage (Execute AWS API Step)...\nThe below creates the AutomationDocument in an AWS CDK stack.\n```ts\nimport { AutomationDocument } from './automation-document';\n\nexport class HelloWorld extends Stack {\n constructor(app: Construct, id: string) {\n super(app, id);\n\n // Create AutomationDocument\n const myDoc = new AutomationDocument(this, \"MyDoc\", {\n documentFormat: DocumentFormat.JSON,\n documentName: \"MyDoc\",\n docInputs: [Input.ofTypeString('MyInput', { defaultValue: 'a' })],\n });\n\n // Define your steps...\n myDoc.addStep(new PauseStep(this, \"MyPauseStep\", { name: \"MyPauseStep\" }));\n\n myDoc.addStep(new ExecuteScriptStep(this, \"MyExecuteStep\", {\n name: \"step1\",\n handlerName: \"my_func\",\n language: ScriptLanguage.PYTHON,\n fullPathToCode: resolve(\"test/test_file.py\"),\n // OR .inlineCode(\"def my_func(args, context):\\n return {'MyReturn': args['MyInput'] + '-suffix'}\\n\")\n outputs: [{\n outputType: DataTypeEnum.STRING,\n name: \"MyFuncOut\",\n selector: \"$.Payload.MyReturn\"\n }],\n inputs: [\"MyInput\"]\n }));\n }\n}\n```\n\n### Document JSON/YAML Export as YAML/JSON\n\nYou can deploy the above document using CDK.\nTo print the above document object as a JSON (or YAML), do the following:\n\n```ts\nconst myDocJson = myDoc.print(); // Print YAML by setting the documentFormat to YAML\n```\n\n\n### Document Simulation\n\nTo run the document object in simulation mode, use the below. Simulation mode does NOT hit the SSM API, rather it mimics the execution that will happen in an SSM execution. The run happens locally and allows you to mock the calls to external services (AWS APIs for example) or to invoke those services using your local credentials.\n\n```ts\nimport { Simulation } from './simulation';\n\nconst myDocJson = Simulation.ofAutomation(myDoc, {}).simulate({ MyInput: \"FooBar\" });\n```\n\n### Command Documents\n\nBelow is an example of how to use the library to create Command documents.\nSimulation for command documents is not yet supported for all command plugins.\nYou can use a Docker image/container as a playground for testing the Command document execution for the supported plugins.\n\nIn this example there is a complete CDK stack. Notice that the `CommandDocument` is saved as a field so that it can be tested from the test code.\n```typescript\nexport class HelloCdkStack extends Stack {\n readonly myCommandDoc: CommandDocument;\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n this.myCommandDoc = new CommandDocument(this, \"MyCommandDoc\", {\n docInputs: [Input.ofTypeString('FirstCommand', { defaultValue: 'a' })],\n })\n const runScriptStep = new RunShellScriptStep(this, \"MyShellScript\", {\n runCommand: [\n StringVariable.of(\"FirstCommand\"),\n HardCodedString.of(\"mkdir asdf\"),\n ],\n });\n this.myCommandDoc.addStep(runScriptStep);\n }\n}\n```\n\nBelow is an example of how you would run a simulation against the above `CommandDocument`.\n\nCurrently, `bash` must be available in the container or the executions against the docker will not succeed.\n\n```typescript\ntest('Test command doc', () => {\n const app = new cdk.App();\n const stack = new HelloCdk.HelloCdkStack(app, 'MyTestStack');\n // 1. $ docker pull amazonlinux\n // 2. $ docker run -di amazonlinux\n const simulation = Simulation.ofCommand(stack.myCommandDoc, {\n simulationPlatform: Platform.LINUX,\n environment: DockerEnvironment.fromContainer('MY_CONTAINER_ID')\n });\n simulation.simulate({FirstCommand: 'mkdir foobar'})\n // 3. The document should run the first command (create 'foobar') and create file 'asdf'\n // 4. $ docker exec -it <container name> bash\n // 5. Ensure that 'asdf' and 'foobar' were written to /tmp\n});\n```\n\n## Patterns (High-Level Constructs)\n\nIn typical CDK style, you can assemble often used groups of steps into higher level Constructs.\n\nConsider if you typically create AutomationDocuments that start with logging the time and end with logging the total time taken. You can create a high-level Automation Document and extend that when you implement an Automation.\n\nSee the `TimedDocument` class to see such implementation.\n\nOr consider the case of multiple steps that are always run together such as rebooting and instance and waiting for it to be active.\n\nThe below example is copied from the `RebootInstanceAndWait` class:\n\n```ts\nexport class RebootInstanceAndWait extends CompositeAutomationStep {\n\n readonly reboot: AwsApiStep;\n readonly describe: WaitForResourceStep;\n\n constructor(scope: Construct, id: string, instanceId: IStringVariable) {\n super(scope, id);\n this.reboot = new AwsApiStep(this, 'RebootInstances', {\n service: 'ec2',\n pascalCaseApi: 'RebootInstances',\n apiParams: { InstanceIds: [instanceId] },\n outputs: [],\n });\n this.describe = new WaitForResourceStep(this, 'DescribeInstances', {\n service: 'ec2',\n pascalCaseApi: 'DescribeInstances',\n apiParams: { InstanceIds: [instanceId] },\n selector: '$.Reservations[0].Instances[0].State.Name',\n desiredValues: ['running'],\n });\n }\n\n addToDocument(doc: AutomationDocumentBuilder): void {\n doc.addStep(this.reboot);\n doc.addStep(this.describe);\n }\n}\n\n```\n\nNow, you can use `RebootInstanceAndWait` as a step in a document and the child steps will be included.\n\n## Existing Documents\n\nDo you have an existing document that you want to convert to code and/or test locally using the simulation?\n\n### Import Existing Document\n\nHere is an example of how you can import an existing document and then simulate it locally with mocked AWS resources:\n\n```ts\n// Initialize Mocks\nconst sleeper = new MockSleep();\nconst awsInvoker = new MockAwsInvoker();\nawsInvoker.whenThen(\n // when invoked with...\n {awsApi: 'listBuckets', awsParams: {}, service: 'S3'},\n // then response with...\n {Owner: {ID: \"BUCKET_ID\"}})\n\n// ======> Create document from file <=======\nconst stack: Stack = new Stack();\nconst myAutomationDoc = StringDocument.fromFile(stack, \"MyAutomationDoc\", 'test/myAutomation.json', {\n // ======================\n});\n\n// Execute simulation\nconst simOutput = Simulation.ofAutomation(myAutomationDoc, {\n sleepHook: sleeper,\n awsInvoker: awsInvoker\n}).simulate({});\n\n// Assert simulation result\nassert.deepEqual(awsInvoker.previousInvocations, [\n { awsApi: 'listBuckets', awsParams: {}, service: 'S3' }]);\nassert.deepEqual(sleeper.sleepMilliInvocations, [3000]);\nassert.deepEqual(simOutput.outputs['simulationSteps'], ['MySleep', 'GetBucketId']);\n```\n\n### Import Existing Steps\n\nYou can also grab a string step (or steps) and import them as CDK step constructs.\nThis can be used to convert existing documents into CDK with each step defined separately.\nDoing so will allow you do modify steps and reuse them in other documents.\n\nHere's a simple example of a sleep step copy and pasted from its original yaml:\n\n```ts\nStringStep.fromYaml(this, `\n name: sleep\n action: aws:sleep\n inputs:\n Duration: PT0M\n`, {});\n```\n\nThe above will return the CDK construct SleepStep.\n\n## What is Planned?\n\nThis library currently contains AutomationDocument steps.\n\nAlso planned is the ability to run Command documents.\n\nStay tuned!\n\n## Related Projects\n\n- https://github.com/udondan/cdk-ssm-document\n\n## Security\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\nThis project is licensed under the Apache-2.0 License.\n\n"
2801
+ "markdown": "# SSM Document CDK\nThis library provides a code-based utility for implementing SSM Documents. The SSM Document objects can be used to print YAML/JSON documents and to mimic document processing locally.\n\nThis library abstracts SSM Documents at a high level, with each step as well as the document itself being objects. The properties needed to build these objects correlate to the settings that apply to them, making them simple to make.\nThis library can be used to test your document locally before deploying it to SSM.\n\nSince the library is written in JSII, it can be exported to other languages that support JSII (Java, Python).\n\nThis is what you'd use if you wanted to:\n1. The ability to test without deploying resources or executing an actual SSM on AWS.\n2. Reusability of steps between documents by reusing existing items\n3. Create logical higher-level groupings of reusable groups of steps (\"Patterns\")\n4. Simple to use interface for writing documents\n5. Import existing documents from a file (or string) and mimic them locally to test them.\n\n## Usage\n\n### Document Creation\n\nTypescript usage (Execute AWS API Step)...\nThe below creates the AutomationDocument in an AWS CDK stack.\n```ts\nimport { AutomationDocument } from './automation-document';\n\nexport class HelloWorld extends Stack {\n constructor(app: Construct, id: string) {\n super(app, id);\n\n // Create AutomationDocument\n const myDoc = new AutomationDocument(this, \"MyDoc\", {\n documentFormat: DocumentFormat.JSON,\n documentName: \"MyDoc\",\n docInputs: [Input.ofTypeString('MyInput', { defaultValue: 'a' })],\n });\n\n // Define your steps...\n myDoc.addStep(new PauseStep(this, \"MyPauseStep\", {\n name: \"MyPauseStep\",\n explicitNextStep: StepRef.fromName(\"step1\") // Optional (will default to next added step)\n }));\n\n myDoc.addStep(new ExecuteScriptStep(this, \"MyExecuteStep\", {\n name: \"step1\",\n handlerName: \"my_func\",\n language: ScriptLanguage.PYTHON,\n fullPathToCode: resolve(\"test/test_file.py\"),\n // OR .inlineCode(\"def my_func(args, context):\\n return {'MyReturn': args['MyInput'] + '-suffix'}\\n\")\n outputs: [{\n outputType: DataTypeEnum.STRING,\n name: \"MyFuncOut\",\n selector: \"$.Payload.MyReturn\"\n }],\n onFailure: OnFailure.abort(),\n inputs: [\"MyInput\"]\n }));\n }\n}\n```\n\n### Document JSON/YAML Export as YAML/JSON\n\nYou can deploy the above document using CDK.\nTo print the above document object as a JSON (or YAML), do the following:\n\n```ts\nconst myDocJson = myDoc.print(); // Print YAML by setting the documentFormat to YAML\n```\n\n\n### Document Simulation\n\nTo run the document object in simulation mode, use the below. Simulation mode does NOT hit the SSM API, rather it mimics the execution that will happen in an SSM execution. The run happens locally and allows you to mock the calls to external services (AWS APIs for example) or to invoke those services using your local credentials.\n\n```ts\nimport { Simulation } from './simulation';\n\nconst myDocJson = Simulation.ofAutomation(myDoc, {}).simulate({ MyInput: \"FooBar\" });\n```\n\n### Command Documents\n\nBelow is an example of how to use the library to create Command documents.\nSimulation for command documents is not yet supported for all command plugins.\nYou can use a Docker image/container as a playground for testing the Command document execution for the supported plugins.\n\nIn this example there is a complete CDK stack. Notice that the `CommandDocument` is saved as a field so that it can be tested from the test code.\n```typescript\nexport class HelloCdkStack extends Stack {\n readonly myCommandDoc: CommandDocument;\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n this.myCommandDoc = new CommandDocument(this, \"MyCommandDoc\", {\n docInputs: [Input.ofTypeString('FirstCommand', { defaultValue: 'a' })],\n })\n const runScriptStep = new RunShellScriptStep(this, \"MyShellScript\", {\n runCommand: [\n StringVariable.of(\"FirstCommand\"),\n HardCodedString.of(\"mkdir asdf\"),\n ],\n });\n this.myCommandDoc.addStep(runScriptStep);\n }\n}\n```\n\nBelow is an example of how you would run a simulation against the above `CommandDocument`.\n\nCurrently, `bash` must be available in the container or the executions against the docker will not succeed.\n\n```typescript\ntest('Test command doc', () => {\n const app = new cdk.App();\n const stack = new HelloCdk.HelloCdkStack(app, 'MyTestStack');\n // 1. $ docker pull amazonlinux\n // 2. $ docker run -di amazonlinux\n const simulation = Simulation.ofCommand(stack.myCommandDoc, {\n simulationPlatform: Platform.LINUX,\n environment: DockerEnvironment.fromContainer('MY_CONTAINER_ID')\n });\n simulation.simulate({FirstCommand: 'mkdir foobar'})\n // 3. The document should run the first command (create 'foobar') and create file 'asdf'\n // 4. $ docker exec -it <container name> bash\n // 5. Ensure that 'asdf' and 'foobar' were written to /tmp\n});\n```\n\n## Patterns (High-Level Constructs)\n\nIn typical CDK style, you can assemble often used groups of steps into higher level Constructs.\n\nConsider if you typically create AutomationDocuments that start with logging the time and end with logging the total time taken. You can create a high-level Automation Document and extend that when you implement an Automation.\n\nSee the `TimedDocument` class to see such implementation.\n\nOr consider the case of multiple steps that are always run together such as rebooting and instance and waiting for it to be active.\n\nThe below example is copied from the `RebootInstanceAndWait` class:\n\n```ts\nexport class RebootInstanceAndWait extends CompositeAutomationStep {\n\n readonly reboot: AwsApiStep;\n readonly describe: WaitForResourceStep;\n\n constructor(scope: Construct, id: string, instanceId: IStringVariable) {\n super(scope, id);\n this.reboot = new AwsApiStep(this, 'RebootInstances', {\n service: 'ec2',\n pascalCaseApi: 'RebootInstances',\n apiParams: { InstanceIds: [instanceId] },\n outputs: [],\n });\n this.describe = new WaitForResourceStep(this, 'DescribeInstances', {\n service: 'ec2',\n pascalCaseApi: 'DescribeInstances',\n apiParams: { InstanceIds: [instanceId] },\n selector: '$.Reservations[0].Instances[0].State.Name',\n desiredValues: ['running'],\n });\n }\n\n addToDocument(doc: AutomationDocumentBuilder): void {\n doc.addStep(this.reboot);\n doc.addStep(this.describe);\n }\n}\n\n```\n\nNow, you can use `RebootInstanceAndWait` as a step in a document and the child steps will be included.\n\n## Existing Documents\n\nDo you have an existing document that you want to convert to code and/or test locally using the simulation?\n\n### Import Existing Document\n\nHere is an example of how you can import an existing document and then simulate it locally with mocked AWS resources:\n\n```ts\n// Initialize Mocks\nconst sleeper = new MockSleep();\nconst awsInvoker = new MockAwsInvoker();\nawsInvoker.whenThen(\n // when invoked with...\n {awsApi: 'listBuckets', awsParams: {}, service: 'S3'},\n // then response with...\n {Owner: {ID: \"BUCKET_ID\"}})\n\n// ======> Create document from file <=======\nconst stack: Stack = new Stack();\nconst myAutomationDoc = StringDocument.fromFile(stack, \"MyAutomationDoc\", 'test/myAutomation.json', {\n // ======================\n});\n\n// Execute simulation\nconst simOutput = Simulation.ofAutomation(myAutomationDoc, {\n sleepHook: sleeper,\n awsInvoker: awsInvoker\n}).simulate({});\n\n// Assert simulation result\nassert.deepEqual(awsInvoker.previousInvocations, [\n { awsApi: 'listBuckets', awsParams: {}, service: 'S3' }]);\nassert.deepEqual(sleeper.sleepMilliInvocations, [3000]);\nassert.deepEqual(simOutput.outputs['simulationSteps'], ['MySleep', 'GetBucketId']);\n```\n\n### Import Existing Steps\n\nYou can also grab a string step (or steps) and import them as CDK step constructs.\nThis can be used to convert existing documents into CDK with each step defined separately.\nDoing so will allow you do modify steps and reuse them in other documents.\n\nHere's a simple example of a sleep step copy and pasted from its original yaml:\n\n```ts\nStringStep.fromYaml(this, `\n name: sleep\n action: aws:sleep\n inputs:\n Duration: PT0M\n`, {});\n```\n\nThe above will return the CDK construct SleepStep.\n\n## What is Planned?\n\nThis library currently contains AutomationDocument steps.\n\nAlso planned is the ability to run Command documents.\n\nStay tuned!\n\n## Related Projects\n\n- https://github.com/udondan/cdk-ssm-document\n\n## Security\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\nThis project is licensed under the Apache-2.0 License.\n\n"
2802
2802
  },
2803
2803
  "repository": {
2804
2804
  "type": "git",
@@ -2826,6 +2826,68 @@
2826
2826
  }
2827
2827
  },
2828
2828
  "types": {
2829
+ "@cdklabs/cdk-ssm-documents.Abort": {
2830
+ "assembly": "@cdklabs/cdk-ssm-documents",
2831
+ "base": "@cdklabs/cdk-ssm-documents.OnCancel",
2832
+ "docs": {
2833
+ "stability": "stable"
2834
+ },
2835
+ "fqn": "@cdklabs/cdk-ssm-documents.Abort",
2836
+ "initializer": {
2837
+ "docs": {
2838
+ "stability": "stable"
2839
+ }
2840
+ },
2841
+ "kind": "class",
2842
+ "locationInModule": {
2843
+ "filename": "src/interface/on-failure.ts",
2844
+ "line": 122
2845
+ },
2846
+ "methods": [
2847
+ {
2848
+ "docs": {
2849
+ "stability": "stable"
2850
+ },
2851
+ "locationInModule": {
2852
+ "filename": "src/interface/on-failure.ts",
2853
+ "line": 124
2854
+ },
2855
+ "name": "stepToInvoke",
2856
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
2857
+ "parameters": [
2858
+ {
2859
+ "name": "_currentStep",
2860
+ "type": {
2861
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
2862
+ }
2863
+ }
2864
+ ],
2865
+ "returns": {
2866
+ "type": {
2867
+ "primitive": "string"
2868
+ }
2869
+ }
2870
+ },
2871
+ {
2872
+ "docs": {
2873
+ "stability": "stable"
2874
+ },
2875
+ "locationInModule": {
2876
+ "filename": "src/interface/on-failure.ts",
2877
+ "line": 128
2878
+ },
2879
+ "name": "toSsmValue",
2880
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
2881
+ "returns": {
2882
+ "type": {
2883
+ "primitive": "string"
2884
+ }
2885
+ }
2886
+ }
2887
+ ],
2888
+ "name": "Abort",
2889
+ "symbolId": "src/interface/on-failure:Abort"
2890
+ },
2829
2891
  "@cdklabs/cdk-ssm-documents.ActionVariable": {
2830
2892
  "assembly": "@cdklabs/cdk-ssm-documents",
2831
2893
  "base": "@cdklabs/cdk-ssm-documents.StringVariable",
@@ -5105,7 +5167,7 @@
5105
5167
  },
5106
5168
  "locationInModule": {
5107
5169
  "filename": "src/parent-steps/automation-step.ts",
5108
- "line": 65
5170
+ "line": 75
5109
5171
  },
5110
5172
  "parameters": [
5111
5173
  {
@@ -5134,7 +5196,7 @@
5134
5196
  "kind": "class",
5135
5197
  "locationInModule": {
5136
5198
  "filename": "src/parent-steps/automation-step.ts",
5137
- "line": 53
5199
+ "line": 62
5138
5200
  },
5139
5201
  "methods": [
5140
5202
  {
@@ -5143,7 +5205,7 @@
5143
5205
  },
5144
5206
  "locationInModule": {
5145
5207
  "filename": "src/parent-steps/automation-step.ts",
5146
- "line": 74
5208
+ "line": 85
5147
5209
  },
5148
5210
  "name": "addToDocument",
5149
5211
  "overrides": "@cdklabs/cdk-ssm-documents.IAutomationComponent",
@@ -5162,7 +5224,7 @@
5162
5224
  },
5163
5225
  "locationInModule": {
5164
5226
  "filename": "src/parent-steps/automation-step.ts",
5165
- "line": 78
5227
+ "line": 89
5166
5228
  },
5167
5229
  "name": "prepareSsmEntry",
5168
5230
  "parameters": [
@@ -5196,7 +5258,7 @@
5196
5258
  },
5197
5259
  "locationInModule": {
5198
5260
  "filename": "src/parent-steps/automation-step.ts",
5199
- "line": 125
5261
+ "line": 139
5200
5262
  },
5201
5263
  "name": "variables",
5202
5264
  "returns": {
@@ -5221,7 +5283,7 @@
5221
5283
  "immutable": true,
5222
5284
  "locationInModule": {
5223
5285
  "filename": "src/parent-steps/automation-step.ts",
5224
- "line": 55
5286
+ "line": 64
5225
5287
  },
5226
5288
  "name": "DEFAULT_MAX_ATTEMPTS",
5227
5289
  "static": true,
@@ -5237,7 +5299,7 @@
5237
5299
  "immutable": true,
5238
5300
  "locationInModule": {
5239
5301
  "filename": "src/parent-steps/automation-step.ts",
5240
- "line": 54
5302
+ "line": 63
5241
5303
  },
5242
5304
  "name": "DEFAULT_TIMEOUT",
5243
5305
  "static": true,
@@ -5252,7 +5314,7 @@
5252
5314
  "immutable": true,
5253
5315
  "locationInModule": {
5254
5316
  "filename": "src/parent-steps/automation-step.ts",
5255
- "line": 58
5317
+ "line": 67
5256
5318
  },
5257
5319
  "name": "isEnd",
5258
5320
  "type": {
@@ -5266,7 +5328,7 @@
5266
5328
  "immutable": true,
5267
5329
  "locationInModule": {
5268
5330
  "filename": "src/parent-steps/automation-step.ts",
5269
- "line": 56
5331
+ "line": 65
5270
5332
  },
5271
5333
  "name": "maxAttempts",
5272
5334
  "type": {
@@ -5280,11 +5342,11 @@
5280
5342
  "immutable": true,
5281
5343
  "locationInModule": {
5282
5344
  "filename": "src/parent-steps/automation-step.ts",
5283
- "line": 57
5345
+ "line": 69
5284
5346
  },
5285
- "name": "timeoutSeconds",
5347
+ "name": "onCancel",
5286
5348
  "type": {
5287
- "primitive": "number"
5349
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
5288
5350
  }
5289
5351
  },
5290
5352
  {
@@ -5294,12 +5356,11 @@
5294
5356
  "immutable": true,
5295
5357
  "locationInModule": {
5296
5358
  "filename": "src/parent-steps/automation-step.ts",
5297
- "line": 60
5359
+ "line": 68
5298
5360
  },
5299
- "name": "onCancel",
5300
- "optional": true,
5361
+ "name": "onFailure",
5301
5362
  "type": {
5302
- "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
5363
+ "fqn": "@cdklabs/cdk-ssm-documents.OnFailure"
5303
5364
  }
5304
5365
  },
5305
5366
  {
@@ -5309,12 +5370,26 @@
5309
5370
  "immutable": true,
5310
5371
  "locationInModule": {
5311
5372
  "filename": "src/parent-steps/automation-step.ts",
5312
- "line": 59
5373
+ "line": 66
5313
5374
  },
5314
- "name": "onFailure",
5375
+ "name": "timeoutSeconds",
5376
+ "type": {
5377
+ "primitive": "number"
5378
+ }
5379
+ },
5380
+ {
5381
+ "docs": {
5382
+ "stability": "stable"
5383
+ },
5384
+ "immutable": true,
5385
+ "locationInModule": {
5386
+ "filename": "src/parent-steps/automation-step.ts",
5387
+ "line": 70
5388
+ },
5389
+ "name": "explicitNextStep",
5315
5390
  "optional": true,
5316
5391
  "type": {
5317
- "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
5392
+ "fqn": "@cdklabs/cdk-ssm-documents.StepRef"
5318
5393
  }
5319
5394
  },
5320
5395
  {
@@ -5323,7 +5398,7 @@
5323
5398
  },
5324
5399
  "locationInModule": {
5325
5400
  "filename": "src/parent-steps/automation-step.ts",
5326
- "line": 63
5401
+ "line": 73
5327
5402
  },
5328
5403
  "name": "allStepsInExecution",
5329
5404
  "optional": true,
@@ -5342,7 +5417,7 @@
5342
5417
  },
5343
5418
  "locationInModule": {
5344
5419
  "filename": "src/parent-steps/automation-step.ts",
5345
- "line": 62
5420
+ "line": 72
5346
5421
  },
5347
5422
  "name": "nextStep",
5348
5423
  "optional": true,
@@ -5366,10 +5441,29 @@
5366
5441
  "kind": "interface",
5367
5442
  "locationInModule": {
5368
5443
  "filename": "src/parent-steps/automation-step.ts",
5369
- "line": 9
5444
+ "line": 11
5370
5445
  },
5371
5446
  "name": "AutomationStepProps",
5372
5447
  "properties": [
5448
+ {
5449
+ "abstract": true,
5450
+ "docs": {
5451
+ "default": "will implicitly choose the next step in the sequence that the steps are added to the document.",
5452
+ "remarks": "https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-actions.html#nextProp",
5453
+ "stability": "stable",
5454
+ "summary": "(Optional) explicit step to go to after this step completes."
5455
+ },
5456
+ "immutable": true,
5457
+ "locationInModule": {
5458
+ "filename": "src/parent-steps/automation-step.ts",
5459
+ "line": 50
5460
+ },
5461
+ "name": "explicitNextStep",
5462
+ "optional": true,
5463
+ "type": {
5464
+ "fqn": "@cdklabs/cdk-ssm-documents.StepRef"
5465
+ }
5466
+ },
5373
5467
  {
5374
5468
  "abstract": true,
5375
5469
  "docs": {
@@ -5380,7 +5474,7 @@
5380
5474
  "immutable": true,
5381
5475
  "locationInModule": {
5382
5476
  "filename": "src/parent-steps/automation-step.ts",
5383
- "line": 15
5477
+ "line": 17
5384
5478
  },
5385
5479
  "name": "isEnd",
5386
5480
  "optional": true,
@@ -5398,7 +5492,7 @@
5398
5492
  "immutable": true,
5399
5493
  "locationInModule": {
5400
5494
  "filename": "src/parent-steps/automation-step.ts",
5401
- "line": 34
5495
+ "line": 36
5402
5496
  },
5403
5497
  "name": "maxAttempts",
5404
5498
  "optional": true,
@@ -5411,17 +5505,17 @@
5411
5505
  "docs": {
5412
5506
  "default": "undefined",
5413
5507
  "stability": "stable",
5414
- "summary": "(Optional) Step to jump to in the event that this step is cancelled."
5508
+ "summary": "(Optional) Fallback action to take in the event that this step is cancelled."
5415
5509
  },
5416
5510
  "immutable": true,
5417
5511
  "locationInModule": {
5418
5512
  "filename": "src/parent-steps/automation-step.ts",
5419
- "line": 27
5513
+ "line": 29
5420
5514
  },
5421
5515
  "name": "onCancel",
5422
5516
  "optional": true,
5423
5517
  "type": {
5424
- "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
5518
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
5425
5519
  }
5426
5520
  },
5427
5521
  {
@@ -5429,17 +5523,17 @@
5429
5523
  "docs": {
5430
5524
  "default": "undefined",
5431
5525
  "stability": "stable",
5432
- "summary": "(Optional) Step to jump to in the event that this step fails."
5526
+ "summary": "(Optional) Fallback action to take in the event that this step fails."
5433
5527
  },
5434
5528
  "immutable": true,
5435
5529
  "locationInModule": {
5436
5530
  "filename": "src/parent-steps/automation-step.ts",
5437
- "line": 21
5531
+ "line": 23
5438
5532
  },
5439
5533
  "name": "onFailure",
5440
5534
  "optional": true,
5441
5535
  "type": {
5442
- "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
5536
+ "fqn": "@cdklabs/cdk-ssm-documents.OnFailure"
5443
5537
  }
5444
5538
  },
5445
5539
  {
@@ -5453,7 +5547,7 @@
5453
5547
  "immutable": true,
5454
5548
  "locationInModule": {
5455
5549
  "filename": "src/parent-steps/automation-step.ts",
5456
- "line": 41
5550
+ "line": 43
5457
5551
  },
5458
5552
  "name": "timeoutSeconds",
5459
5553
  "optional": true,
@@ -5540,7 +5634,7 @@
5540
5634
  },
5541
5635
  "locationInModule": {
5542
5636
  "filename": "src/simulation/automation-step-simulation.ts",
5543
- "line": 196
5637
+ "line": 206
5544
5638
  },
5545
5639
  "name": "prependSelf",
5546
5640
  "parameters": [
@@ -8922,6 +9016,68 @@
8922
9016
  ],
8923
9017
  "symbolId": "src/parent-steps/command/configure-package-step:ConfigurePackageStepProps"
8924
9018
  },
9019
+ "@cdklabs/cdk-ssm-documents.Continue": {
9020
+ "assembly": "@cdklabs/cdk-ssm-documents",
9021
+ "base": "@cdklabs/cdk-ssm-documents.OnFailure",
9022
+ "docs": {
9023
+ "stability": "stable"
9024
+ },
9025
+ "fqn": "@cdklabs/cdk-ssm-documents.Continue",
9026
+ "initializer": {
9027
+ "docs": {
9028
+ "stability": "stable"
9029
+ }
9030
+ },
9031
+ "kind": "class",
9032
+ "locationInModule": {
9033
+ "filename": "src/interface/on-failure.ts",
9034
+ "line": 133
9035
+ },
9036
+ "methods": [
9037
+ {
9038
+ "docs": {
9039
+ "stability": "stable"
9040
+ },
9041
+ "locationInModule": {
9042
+ "filename": "src/interface/on-failure.ts",
9043
+ "line": 135
9044
+ },
9045
+ "name": "stepToInvoke",
9046
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
9047
+ "parameters": [
9048
+ {
9049
+ "name": "currentStep",
9050
+ "type": {
9051
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
9052
+ }
9053
+ }
9054
+ ],
9055
+ "returns": {
9056
+ "type": {
9057
+ "primitive": "string"
9058
+ }
9059
+ }
9060
+ },
9061
+ {
9062
+ "docs": {
9063
+ "stability": "stable"
9064
+ },
9065
+ "locationInModule": {
9066
+ "filename": "src/interface/on-failure.ts",
9067
+ "line": 139
9068
+ },
9069
+ "name": "toSsmValue",
9070
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
9071
+ "returns": {
9072
+ "type": {
9073
+ "primitive": "string"
9074
+ }
9075
+ }
9076
+ }
9077
+ ],
9078
+ "name": "Continue",
9079
+ "symbolId": "src/interface/on-failure:Continue"
9080
+ },
8925
9081
  "@cdklabs/cdk-ssm-documents.CopyImageSimulation": {
8926
9082
  "assembly": "@cdklabs/cdk-ssm-documents",
8927
9083
  "base": "@cdklabs/cdk-ssm-documents.AutomationSimulationBase",
@@ -21469,80 +21625,328 @@
21469
21625
  "name": "NumberVariable",
21470
21626
  "symbolId": "src/interface/variables/number-variable:NumberVariable"
21471
21627
  },
21472
- "@cdklabs/cdk-ssm-documents.OnFailureVariable": {
21628
+ "@cdklabs/cdk-ssm-documents.OnCancel": {
21629
+ "abstract": true,
21473
21630
  "assembly": "@cdklabs/cdk-ssm-documents",
21474
- "base": "@cdklabs/cdk-ssm-documents.StringVariable",
21631
+ "base": "@cdklabs/cdk-ssm-documents.OnFailure",
21475
21632
  "docs": {
21476
- "stability": "stable"
21633
+ "remarks": "See docs here: https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-actions.html#canProp\nThe supported actions are abort (default) or invoking a specific step.\nThis behavior can be adopted by using the static methods available on OnCancel.",
21634
+ "stability": "stable",
21635
+ "summary": "Steps can specify an action to take onCancel."
21477
21636
  },
21478
- "fqn": "@cdklabs/cdk-ssm-documents.OnFailureVariable",
21637
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel",
21479
21638
  "initializer": {
21480
21639
  "docs": {
21481
21640
  "stability": "stable"
21482
- },
21483
- "locationInModule": {
21484
- "filename": "src/interface/variables/variable.ts",
21485
- "line": 72
21486
- },
21487
- "parameters": [
21488
- {
21489
- "name": "reference",
21490
- "type": {
21491
- "primitive": "string"
21492
- }
21493
- }
21494
- ]
21641
+ }
21495
21642
  },
21496
- "interfaces": [
21497
- "@cdklabs/cdk-ssm-documents.IOnFailureVariable"
21498
- ],
21499
21643
  "kind": "class",
21500
21644
  "locationInModule": {
21501
- "filename": "src/parent-steps/automation/create-stack-step.ts",
21502
- "line": 52
21645
+ "filename": "src/interface/on-failure.ts",
21646
+ "line": 49
21503
21647
  },
21504
21648
  "methods": [
21505
21649
  {
21506
21650
  "docs": {
21507
- "stability": "stable"
21651
+ "remarks": "(This is the default behavior.)",
21652
+ "stability": "stable",
21653
+ "summary": "To abort execution if a cancellation occurs during execution of the current step."
21508
21654
  },
21509
21655
  "locationInModule": {
21510
- "filename": "src/parent-steps/automation/create-stack-step.ts",
21656
+ "filename": "src/interface/on-failure.ts",
21657
+ "line": 71
21658
+ },
21659
+ "name": "abort",
21660
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
21661
+ "returns": {
21662
+ "type": {
21663
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
21664
+ }
21665
+ },
21666
+ "static": true
21667
+ },
21668
+ {
21669
+ "docs": {
21670
+ "remarks": "Provide the step object to execute for the onCancel action.\nIf you don't have a handle to the step object, use the invokeStepByName function.\nNot all action types may be invoked during cancellation. See documentation referenced on this class.",
21671
+ "stability": "stable",
21672
+ "summary": "Invoke a specific step."
21673
+ },
21674
+ "locationInModule": {
21675
+ "filename": "src/interface/on-failure.ts",
21511
21676
  "line": 55
21512
21677
  },
21513
- "name": "assertType",
21514
- "overrides": "@cdklabs/cdk-ssm-documents.StringVariable",
21678
+ "name": "invokeStep",
21679
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
21515
21680
  "parameters": [
21516
21681
  {
21517
- "name": "value",
21682
+ "name": "step",
21518
21683
  "type": {
21519
- "primitive": "any"
21684
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
21520
21685
  }
21521
21686
  }
21522
21687
  ],
21523
- "protected": true
21524
- }
21525
- ],
21526
- "name": "OnFailureVariable",
21527
- "properties": [
21688
+ "returns": {
21689
+ "type": {
21690
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
21691
+ }
21692
+ },
21693
+ "static": true
21694
+ },
21528
21695
  {
21529
21696
  "docs": {
21530
- "stability": "stable"
21697
+ "remarks": "Not all action types may be invoked during cancellation. See documentation referenced on this class.",
21698
+ "stability": "stable",
21699
+ "summary": "Invoke a specific step by the step name for the OnCancel action."
21531
21700
  },
21532
- "immutable": true,
21533
21701
  "locationInModule": {
21534
- "filename": "src/parent-steps/automation/create-stack-step.ts",
21535
- "line": 53
21702
+ "filename": "src/interface/on-failure.ts",
21703
+ "line": 63
21536
21704
  },
21537
- "name": "validValues",
21538
- "type": {
21539
- "collection": {
21540
- "elementtype": {
21705
+ "name": "invokeStepByName",
21706
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
21707
+ "parameters": [
21708
+ {
21709
+ "name": "stepName",
21710
+ "type": {
21541
21711
  "primitive": "string"
21542
- },
21543
- "kind": "array"
21712
+ }
21544
21713
  }
21545
- }
21714
+ ],
21715
+ "returns": {
21716
+ "type": {
21717
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
21718
+ }
21719
+ },
21720
+ "static": true
21721
+ }
21722
+ ],
21723
+ "name": "OnCancel",
21724
+ "symbolId": "src/interface/on-failure:OnCancel"
21725
+ },
21726
+ "@cdklabs/cdk-ssm-documents.OnFailure": {
21727
+ "abstract": true,
21728
+ "assembly": "@cdklabs/cdk-ssm-documents",
21729
+ "docs": {
21730
+ "remarks": "See docs here: https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-actions.html#failProp\nThe supported actions are abort (default), continue, or invoking a specific step.\nThis behavior can be adopted by using the static methods available on OnFailure.",
21731
+ "stability": "stable",
21732
+ "summary": "Steps can specify an action to take onFailure."
21733
+ },
21734
+ "fqn": "@cdklabs/cdk-ssm-documents.OnFailure",
21735
+ "initializer": {
21736
+ "docs": {
21737
+ "stability": "stable"
21738
+ }
21739
+ },
21740
+ "kind": "class",
21741
+ "locationInModule": {
21742
+ "filename": "src/interface/on-failure.ts",
21743
+ "line": 9
21744
+ },
21745
+ "methods": [
21746
+ {
21747
+ "docs": {
21748
+ "remarks": "(This is the default behavior.)",
21749
+ "stability": "stable",
21750
+ "summary": "To abort execution if a failure occurs during execution of the current step."
21751
+ },
21752
+ "locationInModule": {
21753
+ "filename": "src/interface/on-failure.ts",
21754
+ "line": 29
21755
+ },
21756
+ "name": "abort",
21757
+ "returns": {
21758
+ "type": {
21759
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
21760
+ }
21761
+ },
21762
+ "static": true
21763
+ },
21764
+ {
21765
+ "docs": {
21766
+ "stability": "stable",
21767
+ "summary": "To continue execution of the subsequent step if a failure occurs during execution of the current step."
21768
+ },
21769
+ "locationInModule": {
21770
+ "filename": "src/interface/on-failure.ts",
21771
+ "line": 36
21772
+ },
21773
+ "name": "continue",
21774
+ "returns": {
21775
+ "type": {
21776
+ "fqn": "@cdklabs/cdk-ssm-documents.OnFailure"
21777
+ }
21778
+ },
21779
+ "static": true
21780
+ },
21781
+ {
21782
+ "docs": {
21783
+ "remarks": "Provide the step object to execute for the onFailure action.\nIf you don't have a handle to the step object, use the invokeStepByName function.",
21784
+ "stability": "stable",
21785
+ "summary": "Invoke a specific step."
21786
+ },
21787
+ "locationInModule": {
21788
+ "filename": "src/interface/on-failure.ts",
21789
+ "line": 14
21790
+ },
21791
+ "name": "invokeStep",
21792
+ "parameters": [
21793
+ {
21794
+ "name": "step",
21795
+ "type": {
21796
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
21797
+ }
21798
+ }
21799
+ ],
21800
+ "returns": {
21801
+ "type": {
21802
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
21803
+ }
21804
+ },
21805
+ "static": true
21806
+ },
21807
+ {
21808
+ "docs": {
21809
+ "stability": "stable",
21810
+ "summary": "Invoke a specific step by the step name for the OnFailure action."
21811
+ },
21812
+ "locationInModule": {
21813
+ "filename": "src/interface/on-failure.ts",
21814
+ "line": 21
21815
+ },
21816
+ "name": "invokeStepByName",
21817
+ "parameters": [
21818
+ {
21819
+ "name": "stepName",
21820
+ "type": {
21821
+ "primitive": "string"
21822
+ }
21823
+ }
21824
+ ],
21825
+ "returns": {
21826
+ "type": {
21827
+ "fqn": "@cdklabs/cdk-ssm-documents.OnCancel"
21828
+ }
21829
+ },
21830
+ "static": true
21831
+ },
21832
+ {
21833
+ "abstract": true,
21834
+ "docs": {
21835
+ "stability": "stable"
21836
+ },
21837
+ "locationInModule": {
21838
+ "filename": "src/interface/on-failure.ts",
21839
+ "line": 39
21840
+ },
21841
+ "name": "stepToInvoke",
21842
+ "parameters": [
21843
+ {
21844
+ "name": "currentStep",
21845
+ "type": {
21846
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
21847
+ }
21848
+ }
21849
+ ],
21850
+ "returns": {
21851
+ "type": {
21852
+ "primitive": "string"
21853
+ }
21854
+ }
21855
+ },
21856
+ {
21857
+ "abstract": true,
21858
+ "docs": {
21859
+ "stability": "stable"
21860
+ },
21861
+ "locationInModule": {
21862
+ "filename": "src/interface/on-failure.ts",
21863
+ "line": 40
21864
+ },
21865
+ "name": "toSsmValue",
21866
+ "returns": {
21867
+ "type": {
21868
+ "primitive": "string"
21869
+ }
21870
+ }
21871
+ }
21872
+ ],
21873
+ "name": "OnFailure",
21874
+ "symbolId": "src/interface/on-failure:OnFailure"
21875
+ },
21876
+ "@cdklabs/cdk-ssm-documents.OnFailureVariable": {
21877
+ "assembly": "@cdklabs/cdk-ssm-documents",
21878
+ "base": "@cdklabs/cdk-ssm-documents.StringVariable",
21879
+ "docs": {
21880
+ "stability": "stable"
21881
+ },
21882
+ "fqn": "@cdklabs/cdk-ssm-documents.OnFailureVariable",
21883
+ "initializer": {
21884
+ "docs": {
21885
+ "stability": "stable"
21886
+ },
21887
+ "locationInModule": {
21888
+ "filename": "src/interface/variables/variable.ts",
21889
+ "line": 72
21890
+ },
21891
+ "parameters": [
21892
+ {
21893
+ "name": "reference",
21894
+ "type": {
21895
+ "primitive": "string"
21896
+ }
21897
+ }
21898
+ ]
21899
+ },
21900
+ "interfaces": [
21901
+ "@cdklabs/cdk-ssm-documents.IOnFailureVariable"
21902
+ ],
21903
+ "kind": "class",
21904
+ "locationInModule": {
21905
+ "filename": "src/parent-steps/automation/create-stack-step.ts",
21906
+ "line": 52
21907
+ },
21908
+ "methods": [
21909
+ {
21910
+ "docs": {
21911
+ "stability": "stable"
21912
+ },
21913
+ "locationInModule": {
21914
+ "filename": "src/parent-steps/automation/create-stack-step.ts",
21915
+ "line": 55
21916
+ },
21917
+ "name": "assertType",
21918
+ "overrides": "@cdklabs/cdk-ssm-documents.StringVariable",
21919
+ "parameters": [
21920
+ {
21921
+ "name": "value",
21922
+ "type": {
21923
+ "primitive": "any"
21924
+ }
21925
+ }
21926
+ ],
21927
+ "protected": true
21928
+ }
21929
+ ],
21930
+ "name": "OnFailureVariable",
21931
+ "properties": [
21932
+ {
21933
+ "docs": {
21934
+ "stability": "stable"
21935
+ },
21936
+ "immutable": true,
21937
+ "locationInModule": {
21938
+ "filename": "src/parent-steps/automation/create-stack-step.ts",
21939
+ "line": 53
21940
+ },
21941
+ "name": "validValues",
21942
+ "type": {
21943
+ "collection": {
21944
+ "elementtype": {
21945
+ "primitive": "string"
21946
+ },
21947
+ "kind": "array"
21948
+ }
21949
+ }
21546
21950
  }
21547
21951
  ],
21548
21952
  "symbolId": "src/parent-steps/automation/create-stack-step:OnFailureVariable"
@@ -29503,6 +29907,233 @@
29503
29907
  ],
29504
29908
  "symbolId": "src/parent-steps/step:Step"
29505
29909
  },
29910
+ "@cdklabs/cdk-ssm-documents.StepFallback": {
29911
+ "assembly": "@cdklabs/cdk-ssm-documents",
29912
+ "base": "@cdklabs/cdk-ssm-documents.OnCancel",
29913
+ "docs": {
29914
+ "stability": "stable"
29915
+ },
29916
+ "fqn": "@cdklabs/cdk-ssm-documents.StepFallback",
29917
+ "initializer": {
29918
+ "docs": {
29919
+ "stability": "stable"
29920
+ },
29921
+ "locationInModule": {
29922
+ "filename": "src/interface/on-failure.ts",
29923
+ "line": 80
29924
+ },
29925
+ "parameters": [
29926
+ {
29927
+ "name": "step",
29928
+ "type": {
29929
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
29930
+ }
29931
+ },
29932
+ {
29933
+ "name": "validateStepAction",
29934
+ "type": {
29935
+ "primitive": "boolean"
29936
+ }
29937
+ }
29938
+ ]
29939
+ },
29940
+ "kind": "class",
29941
+ "locationInModule": {
29942
+ "filename": "src/interface/on-failure.ts",
29943
+ "line": 76
29944
+ },
29945
+ "methods": [
29946
+ {
29947
+ "docs": {
29948
+ "stability": "stable"
29949
+ },
29950
+ "locationInModule": {
29951
+ "filename": "src/interface/on-failure.ts",
29952
+ "line": 88
29953
+ },
29954
+ "name": "stepToInvoke",
29955
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
29956
+ "parameters": [
29957
+ {
29958
+ "name": "_currentStep",
29959
+ "type": {
29960
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
29961
+ }
29962
+ }
29963
+ ],
29964
+ "returns": {
29965
+ "type": {
29966
+ "primitive": "string"
29967
+ }
29968
+ }
29969
+ },
29970
+ {
29971
+ "docs": {
29972
+ "stability": "stable"
29973
+ },
29974
+ "locationInModule": {
29975
+ "filename": "src/interface/on-failure.ts",
29976
+ "line": 92
29977
+ },
29978
+ "name": "toSsmValue",
29979
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
29980
+ "returns": {
29981
+ "type": {
29982
+ "primitive": "string"
29983
+ }
29984
+ }
29985
+ }
29986
+ ],
29987
+ "name": "StepFallback",
29988
+ "properties": [
29989
+ {
29990
+ "const": true,
29991
+ "docs": {
29992
+ "stability": "stable"
29993
+ },
29994
+ "immutable": true,
29995
+ "locationInModule": {
29996
+ "filename": "src/interface/on-failure.ts",
29997
+ "line": 77
29998
+ },
29999
+ "name": "ILLEGAL_FALLBACK_ACTIONS",
30000
+ "static": true,
30001
+ "type": {
30002
+ "collection": {
30003
+ "elementtype": {
30004
+ "primitive": "string"
30005
+ },
30006
+ "kind": "array"
30007
+ }
30008
+ }
30009
+ },
30010
+ {
30011
+ "docs": {
30012
+ "stability": "stable"
30013
+ },
30014
+ "immutable": true,
30015
+ "locationInModule": {
30016
+ "filename": "src/interface/on-failure.ts",
30017
+ "line": 79
30018
+ },
30019
+ "name": "step",
30020
+ "type": {
30021
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
30022
+ }
30023
+ }
30024
+ ],
30025
+ "symbolId": "src/interface/on-failure:StepFallback"
30026
+ },
30027
+ "@cdklabs/cdk-ssm-documents.StepNameFallback": {
30028
+ "assembly": "@cdklabs/cdk-ssm-documents",
30029
+ "base": "@cdklabs/cdk-ssm-documents.OnCancel",
30030
+ "docs": {
30031
+ "stability": "stable"
30032
+ },
30033
+ "fqn": "@cdklabs/cdk-ssm-documents.StepNameFallback",
30034
+ "initializer": {
30035
+ "docs": {
30036
+ "stability": "stable"
30037
+ },
30038
+ "locationInModule": {
30039
+ "filename": "src/interface/on-failure.ts",
30040
+ "line": 100
30041
+ },
30042
+ "parameters": [
30043
+ {
30044
+ "name": "step",
30045
+ "type": {
30046
+ "primitive": "string"
30047
+ }
30048
+ },
30049
+ {
30050
+ "name": "validateStepAction",
30051
+ "type": {
30052
+ "primitive": "boolean"
30053
+ }
30054
+ }
30055
+ ]
30056
+ },
30057
+ "kind": "class",
30058
+ "locationInModule": {
30059
+ "filename": "src/interface/on-failure.ts",
30060
+ "line": 97
30061
+ },
30062
+ "methods": [
30063
+ {
30064
+ "docs": {
30065
+ "stability": "stable"
30066
+ },
30067
+ "locationInModule": {
30068
+ "filename": "src/interface/on-failure.ts",
30069
+ "line": 106
30070
+ },
30071
+ "name": "stepToInvoke",
30072
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
30073
+ "parameters": [
30074
+ {
30075
+ "name": "currentStep",
30076
+ "type": {
30077
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
30078
+ }
30079
+ }
30080
+ ],
30081
+ "returns": {
30082
+ "type": {
30083
+ "primitive": "string"
30084
+ }
30085
+ }
30086
+ },
30087
+ {
30088
+ "docs": {
30089
+ "stability": "stable"
30090
+ },
30091
+ "locationInModule": {
30092
+ "filename": "src/interface/on-failure.ts",
30093
+ "line": 117
30094
+ },
30095
+ "name": "toSsmValue",
30096
+ "overrides": "@cdklabs/cdk-ssm-documents.OnFailure",
30097
+ "returns": {
30098
+ "type": {
30099
+ "primitive": "string"
30100
+ }
30101
+ }
30102
+ }
30103
+ ],
30104
+ "name": "StepNameFallback",
30105
+ "properties": [
30106
+ {
30107
+ "docs": {
30108
+ "stability": "stable"
30109
+ },
30110
+ "immutable": true,
30111
+ "locationInModule": {
30112
+ "filename": "src/interface/on-failure.ts",
30113
+ "line": 98
30114
+ },
30115
+ "name": "step",
30116
+ "type": {
30117
+ "primitive": "string"
30118
+ }
30119
+ },
30120
+ {
30121
+ "docs": {
30122
+ "stability": "stable"
30123
+ },
30124
+ "immutable": true,
30125
+ "locationInModule": {
30126
+ "filename": "src/interface/on-failure.ts",
30127
+ "line": 99
30128
+ },
30129
+ "name": "validateStepAction",
30130
+ "type": {
30131
+ "primitive": "boolean"
30132
+ }
30133
+ }
30134
+ ],
30135
+ "symbolId": "src/interface/on-failure:StepNameFallback"
30136
+ },
29506
30137
  "@cdklabs/cdk-ssm-documents.StepProps": {
29507
30138
  "assembly": "@cdklabs/cdk-ssm-documents",
29508
30139
  "datatype": true,
@@ -29592,6 +30223,137 @@
29592
30223
  ],
29593
30224
  "symbolId": "src/parent-steps/step:StepProps"
29594
30225
  },
30226
+ "@cdklabs/cdk-ssm-documents.StepRef": {
30227
+ "assembly": "@cdklabs/cdk-ssm-documents",
30228
+ "docs": {
30229
+ "remarks": "The class allows steps to be referenced by the Step object or by the step name.",
30230
+ "stability": "stable",
30231
+ "summary": "Class to reference AutomationSteps."
30232
+ },
30233
+ "fqn": "@cdklabs/cdk-ssm-documents.StepRef",
30234
+ "initializer": {
30235
+ "docs": {
30236
+ "stability": "stable"
30237
+ },
30238
+ "locationInModule": {
30239
+ "filename": "src/interface/step-ref.ts",
30240
+ "line": 22
30241
+ },
30242
+ "parameters": [
30243
+ {
30244
+ "name": "stepName",
30245
+ "type": {
30246
+ "primitive": "string"
30247
+ }
30248
+ }
30249
+ ]
30250
+ },
30251
+ "kind": "class",
30252
+ "locationInModule": {
30253
+ "filename": "src/interface/step-ref.ts",
30254
+ "line": 7
30255
+ },
30256
+ "methods": [
30257
+ {
30258
+ "docs": {
30259
+ "stability": "stable",
30260
+ "summary": "Static constructor for creating a reference to a step from a step name."
30261
+ },
30262
+ "locationInModule": {
30263
+ "filename": "src/interface/step-ref.ts",
30264
+ "line": 18
30265
+ },
30266
+ "name": "fromName",
30267
+ "parameters": [
30268
+ {
30269
+ "name": "stepName",
30270
+ "type": {
30271
+ "primitive": "string"
30272
+ }
30273
+ }
30274
+ ],
30275
+ "returns": {
30276
+ "type": {
30277
+ "fqn": "@cdklabs/cdk-ssm-documents.StepRef"
30278
+ }
30279
+ },
30280
+ "static": true
30281
+ },
30282
+ {
30283
+ "docs": {
30284
+ "stability": "stable",
30285
+ "summary": "Static constructor for creating a reference to a step from an AutomationStep object."
30286
+ },
30287
+ "locationInModule": {
30288
+ "filename": "src/interface/step-ref.ts",
30289
+ "line": 11
30290
+ },
30291
+ "name": "fromObject",
30292
+ "parameters": [
30293
+ {
30294
+ "name": "step",
30295
+ "type": {
30296
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
30297
+ }
30298
+ }
30299
+ ],
30300
+ "returns": {
30301
+ "type": {
30302
+ "fqn": "@cdklabs/cdk-ssm-documents.StepRef"
30303
+ }
30304
+ },
30305
+ "static": true
30306
+ },
30307
+ {
30308
+ "docs": {
30309
+ "remarks": "Provide all the steps in the execution to find the associated step.",
30310
+ "stability": "stable",
30311
+ "summary": "Resolve to an AutomationStep object."
30312
+ },
30313
+ "locationInModule": {
30314
+ "filename": "src/interface/step-ref.ts",
30315
+ "line": 29
30316
+ },
30317
+ "name": "resolve",
30318
+ "parameters": [
30319
+ {
30320
+ "name": "allStepsInExecution",
30321
+ "type": {
30322
+ "collection": {
30323
+ "elementtype": {
30324
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
30325
+ },
30326
+ "kind": "array"
30327
+ }
30328
+ }
30329
+ }
30330
+ ],
30331
+ "returns": {
30332
+ "type": {
30333
+ "fqn": "@cdklabs/cdk-ssm-documents.AutomationStep"
30334
+ }
30335
+ }
30336
+ }
30337
+ ],
30338
+ "name": "StepRef",
30339
+ "properties": [
30340
+ {
30341
+ "docs": {
30342
+ "stability": "stable"
30343
+ },
30344
+ "immutable": true,
30345
+ "locationInModule": {
30346
+ "filename": "src/interface/step-ref.ts",
30347
+ "line": 21
30348
+ },
30349
+ "name": "stepName",
30350
+ "type": {
30351
+ "primitive": "string"
30352
+ }
30353
+ }
30354
+ ],
30355
+ "symbolId": "src/interface/step-ref:StepRef"
30356
+ },
29595
30357
  "@cdklabs/cdk-ssm-documents.StringDocument": {
29596
30358
  "assembly": "@cdklabs/cdk-ssm-documents",
29597
30359
  "docs": {
@@ -31926,6 +32688,6 @@
31926
32688
  "symbolId": "src/interface/webhook:WebhookImpl"
31927
32689
  }
31928
32690
  },
31929
- "version": "0.0.18",
31930
- "fingerprint": "xjidUOkY58rXnsuJ+UcqsakVY3A/kYyqJTD5jBhvstc="
32691
+ "version": "0.0.21",
32692
+ "fingerprint": "MHsuAT8tEHjLi6zJGs2rvlPNjjeQ1KZi9ojvYT7/Sn4="
31931
32693
  }