@cdklabs/cdk-ssm-documents 0.0.21 → 0.0.24

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 (119) hide show
  1. package/.jsii +624 -168
  2. package/API.md +582 -94
  3. package/README.md +4 -5
  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.d.ts +1 -0
  10. package/lib/document/ssm-document.js +3 -3
  11. package/lib/domain/choice.js +1 -1
  12. package/lib/domain/data-type.js +1 -1
  13. package/lib/domain/enum/install-action.js +2 -2
  14. package/lib/domain/enum/install-uninstall-repair.js +2 -2
  15. package/lib/domain/enum/installation-type.js +2 -2
  16. package/lib/domain/enum/package-name.js +2 -2
  17. package/lib/domain/input.js +1 -1
  18. package/lib/domain/operation.js +1 -1
  19. package/lib/domain/platform.js +1 -1
  20. package/lib/domain/precondition.js +1 -1
  21. package/lib/interface/approve-hook.js +2 -2
  22. package/lib/interface/auth-method.js +3 -3
  23. package/lib/interface/aws-invoker.js +2 -2
  24. package/lib/interface/downloadable-content.js +8 -8
  25. package/lib/interface/environment.js +3 -3
  26. package/lib/interface/execute-automation-hook/api-execute-automation-hook.js +1 -1
  27. package/lib/interface/observer.js +1 -1
  28. package/lib/interface/on-failure.js +6 -6
  29. package/lib/interface/pause-hook.js +2 -2
  30. package/lib/interface/run-command-hook/api-run-command-hook.js +1 -1
  31. package/lib/interface/run-document-location.js +2 -2
  32. package/lib/interface/sleep-hook.js +2 -2
  33. package/lib/interface/step-ref.js +1 -1
  34. package/lib/interface/variables/boolean-variable.js +2 -2
  35. package/lib/interface/variables/map-list-variable.js +2 -2
  36. package/lib/interface/variables/number-variable.js +2 -2
  37. package/lib/interface/variables/secure-string-variable.js +4 -4
  38. package/lib/interface/variables/string-list-variable.js +2 -2
  39. package/lib/interface/variables/string-map-variable.js +2 -2
  40. package/lib/interface/variables/string-variable.js +4 -4
  41. package/lib/interface/variables/variable.js +2 -2
  42. package/lib/interface/webhook.js +1 -1
  43. package/lib/parent-steps/automation/approve-step.js +5 -3
  44. package/lib/parent-steps/automation/assert-aws-resource-step.js +1 -1
  45. package/lib/parent-steps/automation/aws-api-step.js +1 -1
  46. package/lib/parent-steps/automation/branch-step.js +1 -1
  47. package/lib/parent-steps/automation/change-instance-state-step.js +3 -3
  48. package/lib/parent-steps/automation/copy-image-step.js +1 -1
  49. package/lib/parent-steps/automation/create-image-step.js +1 -1
  50. package/lib/parent-steps/automation/create-stack-step.js +3 -3
  51. package/lib/parent-steps/automation/create-tags-step.js +3 -3
  52. package/lib/parent-steps/automation/delete-image-step.js +1 -1
  53. package/lib/parent-steps/automation/delete-stack-step.js +1 -1
  54. package/lib/parent-steps/automation/execute-automation-step.js +1 -1
  55. package/lib/parent-steps/automation/execute-script-step.d.ts +116 -39
  56. package/lib/parent-steps/automation/execute-script-step.js +157 -62
  57. package/lib/parent-steps/automation/execute-state-machine-step.js +1 -1
  58. package/lib/parent-steps/automation/invoke-lambda-function-step.js +1 -1
  59. package/lib/parent-steps/automation/invoke-webhook-step.js +1 -1
  60. package/lib/parent-steps/automation/pause-step.js +1 -1
  61. package/lib/parent-steps/automation/run-command-step.js +3 -3
  62. package/lib/parent-steps/automation/run-instance-step.js +1 -1
  63. package/lib/parent-steps/automation/sleep-step.js +1 -1
  64. package/lib/parent-steps/automation/wait-for-resource-step.js +1 -1
  65. package/lib/parent-steps/automation-step.js +1 -1
  66. package/lib/parent-steps/command/applications-step.js +1 -1
  67. package/lib/parent-steps/command/configure-docker-step.js +1 -1
  68. package/lib/parent-steps/command/configure-package-step.js +1 -1
  69. package/lib/parent-steps/command/domain-join-step.js +1 -1
  70. package/lib/parent-steps/command/download-content-step.js +1 -1
  71. package/lib/parent-steps/command/ps-module-step.js +1 -1
  72. package/lib/parent-steps/command/run-docker-action-step.js +1 -1
  73. package/lib/parent-steps/command/run-document-step.js +1 -1
  74. package/lib/parent-steps/command/run-powershell-script-step.js +1 -1
  75. package/lib/parent-steps/command/run-shell-script-step.js +1 -1
  76. package/lib/parent-steps/command/software-inventory-step.js +1 -1
  77. package/lib/parent-steps/command/update-agent-step.js +1 -1
  78. package/lib/parent-steps/command/update-ssm-agent-step.js +1 -1
  79. package/lib/parent-steps/command-step.js +1 -1
  80. package/lib/parent-steps/step.js +1 -1
  81. package/lib/patterns/automation/composite-step.js +2 -2
  82. package/lib/patterns/automation/reboot-instance-and-wait.js +1 -1
  83. package/lib/patterns/automation/string-step.js +9 -7
  84. package/lib/patterns/document/string-document.js +1 -1
  85. package/lib/patterns/document/timed-document.js +10 -10
  86. package/lib/samples/hello-world.js +7 -8
  87. package/lib/simulation/automation/approve-simulation.js +1 -1
  88. package/lib/simulation/automation/assert-aws-resource-simulation.js +1 -1
  89. package/lib/simulation/automation/automation-simulation-base.js +1 -1
  90. package/lib/simulation/automation/aws-api-simulation.js +1 -1
  91. package/lib/simulation/automation/branch-simulation.js +1 -1
  92. package/lib/simulation/automation/change-instance-state-simulation.js +1 -1
  93. package/lib/simulation/automation/copy-image-simulation.js +1 -1
  94. package/lib/simulation/automation/create-image-simulation.js +1 -1
  95. package/lib/simulation/automation/create-stack-simulation.js +1 -1
  96. package/lib/simulation/automation/create-tags-simulation.js +1 -1
  97. package/lib/simulation/automation/delete-image-simulation.js +1 -1
  98. package/lib/simulation/automation/delete-stack-simulation.js +1 -1
  99. package/lib/simulation/automation/execute-script-simulation.js +5 -11
  100. package/lib/simulation/automation/execute-state-machine-simulation.js +1 -1
  101. package/lib/simulation/automation/invoke-lambda-function-simulation.js +1 -1
  102. package/lib/simulation/automation/invoke-webhook-simulation.js +1 -1
  103. package/lib/simulation/automation/pause-simulation.js +1 -1
  104. package/lib/simulation/automation/run-command-simulation.js +1 -1
  105. package/lib/simulation/automation/run-instance-simulation.js +1 -1
  106. package/lib/simulation/automation/sleep-simulation.js +1 -1
  107. package/lib/simulation/automation/wait-for-resource-simulation.js +1 -1
  108. package/lib/simulation/automation-step-simulation.js +3 -3
  109. package/lib/simulation/command/command-simulation-base.js +1 -1
  110. package/lib/simulation/command/ps-module-simulation.js +1 -1
  111. package/lib/simulation/command/run-powershell-script-simulation.js +1 -1
  112. package/lib/simulation/command/run-shell-script-simulation.js +1 -1
  113. package/lib/simulation/command-step-simulation.js +1 -1
  114. package/lib/simulation/document/automation-simulation.js +1 -1
  115. package/lib/simulation/document/command-simulation.js +1 -1
  116. package/lib/simulation/simulation.js +1 -1
  117. package/package.json +1 -1
  118. package/releasetag.txt +1 -1
  119. 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\", {\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"
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 language: ScriptLanguage.python(PythonVersion.VERSION_3_6, 'my_func'),\n code: ScriptCode.fromFile(resolve(\"test/test_file.py\")),\n // OR ScriptCode.inline(\"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 inputPayload: { MyInput: StringVariable.of('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",
@@ -3828,7 +3828,7 @@
3828
3828
  },
3829
3829
  "locationInModule": {
3830
3830
  "filename": "src/parent-steps/automation/approve-step.ts",
3831
- "line": 96
3831
+ "line": 98
3832
3832
  },
3833
3833
  "name": "provideDate",
3834
3834
  "protected": true,
@@ -13890,7 +13890,7 @@
13890
13890
  },
13891
13891
  "locationInModule": {
13892
13892
  "filename": "src/simulation/automation/execute-script-simulation.ts",
13893
- "line": 13
13893
+ "line": 12
13894
13894
  },
13895
13895
  "parameters": [
13896
13896
  {
@@ -13904,7 +13904,7 @@
13904
13904
  "kind": "class",
13905
13905
  "locationInModule": {
13906
13906
  "filename": "src/simulation/automation/execute-script-simulation.ts",
13907
- "line": 9
13907
+ "line": 8
13908
13908
  },
13909
13909
  "methods": [
13910
13910
  {
@@ -13915,7 +13915,7 @@
13915
13915
  },
13916
13916
  "locationInModule": {
13917
13917
  "filename": "src/simulation/automation/execute-script-simulation.ts",
13918
- "line": 22
13918
+ "line": 21
13919
13919
  },
13920
13920
  "name": "executeStep",
13921
13921
  "overrides": "@cdklabs/cdk-ssm-documents.AutomationSimulationBase",
@@ -13953,7 +13953,7 @@
13953
13953
  "immutable": true,
13954
13954
  "locationInModule": {
13955
13955
  "filename": "src/simulation/automation/execute-script-simulation.ts",
13956
- "line": 11
13956
+ "line": 10
13957
13957
  },
13958
13958
  "name": "action",
13959
13959
  "type": {
@@ -13967,7 +13967,7 @@
13967
13967
  "immutable": true,
13968
13968
  "locationInModule": {
13969
13969
  "filename": "src/simulation/automation/execute-script-simulation.ts",
13970
- "line": 12
13970
+ "line": 11
13971
13971
  },
13972
13972
  "name": "executeScriptStep",
13973
13973
  "type": {
@@ -13991,7 +13991,7 @@
13991
13991
  },
13992
13992
  "locationInModule": {
13993
13993
  "filename": "src/parent-steps/automation/execute-script-step.ts",
13994
- "line": 85
13994
+ "line": 242
13995
13995
  },
13996
13996
  "parameters": [
13997
13997
  {
@@ -14017,33 +14017,9 @@
14017
14017
  "kind": "class",
14018
14018
  "locationInModule": {
14019
14019
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14020
- "line": 62
14020
+ "line": 234
14021
14021
  },
14022
14022
  "methods": [
14023
- {
14024
- "docs": {
14025
- "stability": "stable"
14026
- },
14027
- "locationInModule": {
14028
- "filename": "src/parent-steps/automation/execute-script-step.ts",
14029
- "line": 64
14030
- },
14031
- "name": "getLanguage",
14032
- "parameters": [
14033
- {
14034
- "name": "runtime",
14035
- "type": {
14036
- "primitive": "string"
14037
- }
14038
- }
14039
- ],
14040
- "returns": {
14041
- "type": {
14042
- "fqn": "@cdklabs/cdk-ssm-documents.ScriptLanguage"
14043
- }
14044
- },
14045
- "static": true
14046
- },
14047
14023
  {
14048
14024
  "docs": {
14049
14025
  "stability": "stable",
@@ -14051,7 +14027,7 @@
14051
14027
  },
14052
14028
  "locationInModule": {
14053
14029
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14054
- "line": 124
14030
+ "line": 259
14055
14031
  },
14056
14032
  "name": "listInputs",
14057
14033
  "overrides": "@cdklabs/cdk-ssm-documents.Step",
@@ -14073,7 +14049,7 @@
14073
14049
  },
14074
14050
  "locationInModule": {
14075
14051
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14076
- "line": 120
14052
+ "line": 255
14077
14053
  },
14078
14054
  "name": "listOutputs",
14079
14055
  "overrides": "@cdklabs/cdk-ssm-documents.Step",
@@ -14095,7 +14071,7 @@
14095
14071
  },
14096
14072
  "locationInModule": {
14097
14073
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14098
- "line": 128
14074
+ "line": 263
14099
14075
  },
14100
14076
  "name": "toSsmEntry",
14101
14077
  "overrides": "@cdklabs/cdk-ssm-documents.Step",
@@ -14120,7 +14096,7 @@
14120
14096
  "immutable": true,
14121
14097
  "locationInModule": {
14122
14098
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14123
- "line": 82
14099
+ "line": 240
14124
14100
  },
14125
14101
  "name": "action",
14126
14102
  "overrides": "@cdklabs/cdk-ssm-documents.Step",
@@ -14135,25 +14111,11 @@
14135
14111
  "immutable": true,
14136
14112
  "locationInModule": {
14137
14113
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14138
- "line": 78
14139
- },
14140
- "name": "fullPathToCode",
14141
- "type": {
14142
- "primitive": "string"
14143
- }
14144
- },
14145
- {
14146
- "docs": {
14147
- "stability": "stable"
14148
- },
14149
- "immutable": true,
14150
- "locationInModule": {
14151
- "filename": "src/parent-steps/automation/execute-script-step.ts",
14152
- "line": 79
14114
+ "line": 237
14153
14115
  },
14154
- "name": "handlerName",
14116
+ "name": "code",
14155
14117
  "type": {
14156
- "primitive": "string"
14118
+ "fqn": "@cdklabs/cdk-ssm-documents.ScriptCode"
14157
14119
  }
14158
14120
  },
14159
14121
  {
@@ -14163,15 +14125,15 @@
14163
14125
  "immutable": true,
14164
14126
  "locationInModule": {
14165
14127
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14166
- "line": 81
14128
+ "line": 239
14167
14129
  },
14168
14130
  "name": "inputs",
14169
14131
  "type": {
14170
14132
  "collection": {
14171
14133
  "elementtype": {
14172
- "primitive": "string"
14134
+ "fqn": "@cdklabs/cdk-ssm-documents.IGenericVariable"
14173
14135
  },
14174
- "kind": "array"
14136
+ "kind": "map"
14175
14137
  }
14176
14138
  }
14177
14139
  },
@@ -14182,7 +14144,7 @@
14182
14144
  "immutable": true,
14183
14145
  "locationInModule": {
14184
14146
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14185
- "line": 77
14147
+ "line": 236
14186
14148
  },
14187
14149
  "name": "language",
14188
14150
  "type": {
@@ -14196,7 +14158,7 @@
14196
14158
  "immutable": true,
14197
14159
  "locationInModule": {
14198
14160
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14199
- "line": 80
14161
+ "line": 238
14200
14162
  },
14201
14163
  "name": "outputs",
14202
14164
  "type": {
@@ -14225,100 +14187,63 @@
14225
14187
  "kind": "interface",
14226
14188
  "locationInModule": {
14227
14189
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14228
- "line": 17
14190
+ "line": 201
14229
14191
  },
14230
14192
  "name": "ExecuteScriptStepProps",
14231
14193
  "properties": [
14232
14194
  {
14233
14195
  "abstract": true,
14234
14196
  "docs": {
14235
- "default": "[]",
14236
- "stability": "stable",
14237
- "summary": "(Optional) Inputs that the function needs in order to execute."
14238
- },
14239
- "immutable": true,
14240
- "locationInModule": {
14241
- "filename": "src/parent-steps/automation/execute-script-step.ts",
14242
- "line": 55
14243
- },
14244
- "name": "inputs",
14245
- "type": {
14246
- "collection": {
14247
- "elementtype": {
14248
- "primitive": "string"
14249
- },
14250
- "kind": "array"
14251
- }
14252
- }
14253
- },
14254
- {
14255
- "abstract": true,
14256
- "docs": {
14257
- "stability": "stable",
14258
- "summary": "(Required) Language used to execute the script."
14259
- },
14260
- "immutable": true,
14261
- "locationInModule": {
14262
- "filename": "src/parent-steps/automation/execute-script-step.ts",
14263
- "line": 22
14264
- },
14265
- "name": "language",
14266
- "type": {
14267
- "fqn": "@cdklabs/cdk-ssm-documents.ScriptLanguage"
14268
- }
14269
- },
14270
- {
14271
- "abstract": true,
14272
- "docs": {
14273
- "remarks": "File is parsed to produce yaml/json.\nSimulation will execute this file using the language specified.\nEither this OR inclineCode must be provided.",
14197
+ "remarks": "String will be used to produce function in yaml/json.\nSimulation will execute the function in this code using the language specified.",
14274
14198
  "stability": "stable",
14275
- "summary": "Full path to the code to execute."
14199
+ "summary": "Inline code to be executed."
14276
14200
  },
14277
14201
  "immutable": true,
14278
14202
  "locationInModule": {
14279
14203
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14280
- "line": 29
14204
+ "line": 212
14281
14205
  },
14282
- "name": "fullPathToCode",
14283
- "optional": true,
14206
+ "name": "code",
14284
14207
  "type": {
14285
- "primitive": "string"
14208
+ "fqn": "@cdklabs/cdk-ssm-documents.ScriptCode"
14286
14209
  }
14287
14210
  },
14288
14211
  {
14289
14212
  "abstract": true,
14290
14213
  "docs": {
14291
- "default": "script_handler",
14214
+ "remarks": "This can be used to pass input data to the script.\nThe key of this dict is the variable name that will be available to the code.\nThe value is the Variable object.",
14292
14215
  "stability": "stable",
14293
- "summary": "(Optional) Function name in fullPathToCode file to use as entry point for script handler."
14216
+ "summary": "InputPayload that will be passed to the first parameter of the handler."
14294
14217
  },
14295
14218
  "immutable": true,
14296
14219
  "locationInModule": {
14297
14220
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14298
- "line": 42
14221
+ "line": 227
14299
14222
  },
14300
- "name": "handlerName",
14301
- "optional": true,
14223
+ "name": "inputPayload",
14302
14224
  "type": {
14303
- "primitive": "string"
14225
+ "collection": {
14226
+ "elementtype": {
14227
+ "fqn": "@cdklabs/cdk-ssm-documents.IGenericVariable"
14228
+ },
14229
+ "kind": "map"
14230
+ }
14304
14231
  }
14305
14232
  },
14306
14233
  {
14307
14234
  "abstract": true,
14308
14235
  "docs": {
14309
- "remarks": "String will be used to produce function in yaml/json.\nSimulation will execute the function in this string using the language specified.\nEither this OR fullPathToCode must be provided.",
14310
14236
  "stability": "stable",
14311
- "summary": "Inline code to be executed."
14237
+ "summary": "(Required) Language used to execute the script."
14312
14238
  },
14313
14239
  "immutable": true,
14314
14240
  "locationInModule": {
14315
14241
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14316
- "line": 36
14242
+ "line": 206
14317
14243
  },
14318
- "name": "inlineCode",
14319
- "optional": true,
14244
+ "name": "language",
14320
14245
  "type": {
14321
- "primitive": "string"
14246
+ "fqn": "@cdklabs/cdk-ssm-documents.ScriptLanguage"
14322
14247
  }
14323
14248
  },
14324
14249
  {
@@ -14332,7 +14257,7 @@
14332
14257
  "immutable": true,
14333
14258
  "locationInModule": {
14334
14259
  "filename": "src/parent-steps/automation/execute-script-step.ts",
14335
- "line": 49
14260
+ "line": 219
14336
14261
  },
14337
14262
  "name": "outputs",
14338
14263
  "optional": true,
@@ -14713,6 +14638,98 @@
14713
14638
  ],
14714
14639
  "symbolId": "src/parent-steps/automation/execute-state-machine-step:ExecuteStateMachineStepProps"
14715
14640
  },
14641
+ "@cdklabs/cdk-ssm-documents.FileScriptCode": {
14642
+ "assembly": "@cdklabs/cdk-ssm-documents",
14643
+ "base": "@cdklabs/cdk-ssm-documents.ScriptCode",
14644
+ "docs": {
14645
+ "stability": "stable"
14646
+ },
14647
+ "fqn": "@cdklabs/cdk-ssm-documents.FileScriptCode",
14648
+ "initializer": {
14649
+ "docs": {
14650
+ "stability": "stable"
14651
+ },
14652
+ "locationInModule": {
14653
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
14654
+ "line": 75
14655
+ },
14656
+ "parameters": [
14657
+ {
14658
+ "name": "fullPath",
14659
+ "type": {
14660
+ "primitive": "string"
14661
+ }
14662
+ }
14663
+ ]
14664
+ },
14665
+ "kind": "class",
14666
+ "locationInModule": {
14667
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
14668
+ "line": 73
14669
+ },
14670
+ "methods": [
14671
+ {
14672
+ "docs": {
14673
+ "stability": "stable"
14674
+ },
14675
+ "locationInModule": {
14676
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
14677
+ "line": 79
14678
+ },
14679
+ "name": "codeAsString",
14680
+ "overrides": "@cdklabs/cdk-ssm-documents.ScriptCode",
14681
+ "returns": {
14682
+ "type": {
14683
+ "primitive": "string"
14684
+ }
14685
+ }
14686
+ },
14687
+ {
14688
+ "docs": {
14689
+ "remarks": "Otherwise, create a file with the specified suffix.",
14690
+ "stability": "stable",
14691
+ "summary": "If there is a file for this code, return it."
14692
+ },
14693
+ "locationInModule": {
14694
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
14695
+ "line": 83
14696
+ },
14697
+ "name": "createOrGetFile",
14698
+ "overrides": "@cdklabs/cdk-ssm-documents.ScriptCode",
14699
+ "parameters": [
14700
+ {
14701
+ "name": "_suffix",
14702
+ "type": {
14703
+ "primitive": "string"
14704
+ }
14705
+ }
14706
+ ],
14707
+ "returns": {
14708
+ "type": {
14709
+ "primitive": "string"
14710
+ }
14711
+ }
14712
+ }
14713
+ ],
14714
+ "name": "FileScriptCode",
14715
+ "properties": [
14716
+ {
14717
+ "docs": {
14718
+ "stability": "stable"
14719
+ },
14720
+ "immutable": true,
14721
+ "locationInModule": {
14722
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
14723
+ "line": 74
14724
+ },
14725
+ "name": "fullPath",
14726
+ "type": {
14727
+ "primitive": "string"
14728
+ }
14729
+ }
14730
+ ],
14731
+ "symbolId": "src/parent-steps/automation/execute-script-step:FileScriptCode"
14732
+ },
14716
14733
  "@cdklabs/cdk-ssm-documents.GenericVariable": {
14717
14734
  "abstract": true,
14718
14735
  "assembly": "@cdklabs/cdk-ssm-documents",
@@ -17148,7 +17165,7 @@
17148
17165
  },
17149
17166
  "locationInModule": {
17150
17167
  "filename": "src/samples/hello-world.ts",
17151
- "line": 11
17168
+ "line": 16
17152
17169
  },
17153
17170
  "parameters": [
17154
17171
  {
@@ -17168,7 +17185,7 @@
17168
17185
  "kind": "class",
17169
17186
  "locationInModule": {
17170
17187
  "filename": "src/samples/hello-world.ts",
17171
- "line": 10
17188
+ "line": 15
17172
17189
  },
17173
17190
  "name": "HelloWorld",
17174
17191
  "symbolId": "src/samples/hello-world:HelloWorld"
@@ -18558,34 +18575,34 @@
18558
18575
  "name": "IWebhook",
18559
18576
  "symbolId": "src/interface/webhook:IWebhook"
18560
18577
  },
18561
- "@cdklabs/cdk-ssm-documents.Input": {
18562
- "abstract": true,
18578
+ "@cdklabs/cdk-ssm-documents.InlineScriptCode": {
18563
18579
  "assembly": "@cdklabs/cdk-ssm-documents",
18580
+ "base": "@cdklabs/cdk-ssm-documents.ScriptCode",
18564
18581
  "docs": {
18565
18582
  "stability": "stable"
18566
18583
  },
18567
- "fqn": "@cdklabs/cdk-ssm-documents.Input",
18584
+ "fqn": "@cdklabs/cdk-ssm-documents.InlineScriptCode",
18568
18585
  "initializer": {
18569
18586
  "docs": {
18570
18587
  "stability": "stable"
18571
18588
  },
18572
18589
  "locationInModule": {
18573
- "filename": "src/domain/input.ts",
18574
- "line": 125
18590
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
18591
+ "line": 59
18575
18592
  },
18576
18593
  "parameters": [
18577
18594
  {
18578
- "name": "props",
18595
+ "name": "inlineCode",
18579
18596
  "type": {
18580
- "fqn": "@cdklabs/cdk-ssm-documents.InputProps"
18597
+ "primitive": "string"
18581
18598
  }
18582
18599
  }
18583
18600
  ]
18584
18601
  },
18585
18602
  "kind": "class",
18586
18603
  "locationInModule": {
18587
- "filename": "src/domain/input.ts",
18588
- "line": 69
18604
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
18605
+ "line": 48
18589
18606
  },
18590
18607
  "methods": [
18591
18608
  {
@@ -18593,36 +18610,128 @@
18593
18610
  "stability": "stable"
18594
18611
  },
18595
18612
  "locationInModule": {
18596
- "filename": "src/domain/input.ts",
18597
- "line": 95
18613
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
18614
+ "line": 64
18598
18615
  },
18599
- "name": "ofSpecifiedType",
18616
+ "name": "codeAsString",
18617
+ "overrides": "@cdklabs/cdk-ssm-documents.ScriptCode",
18618
+ "returns": {
18619
+ "type": {
18620
+ "primitive": "string"
18621
+ }
18622
+ }
18623
+ },
18624
+ {
18625
+ "docs": {
18626
+ "remarks": "Otherwise, create a file with the specified suffix.",
18627
+ "stability": "stable",
18628
+ "summary": "If there is a file for this code, return it."
18629
+ },
18630
+ "locationInModule": {
18631
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
18632
+ "line": 68
18633
+ },
18634
+ "name": "createOrGetFile",
18635
+ "overrides": "@cdklabs/cdk-ssm-documents.ScriptCode",
18600
18636
  "parameters": [
18601
18637
  {
18602
- "name": "type",
18603
- "type": {
18604
- "fqn": "@cdklabs/cdk-ssm-documents.DataTypeEnum"
18605
- }
18606
- },
18607
- {
18608
- "name": "inputName",
18638
+ "name": "suffix",
18609
18639
  "type": {
18610
18640
  "primitive": "string"
18611
18641
  }
18612
- },
18613
- {
18614
- "name": "props",
18615
- "type": {
18616
- "fqn": "@cdklabs/cdk-ssm-documents.InputProps"
18617
- }
18618
18642
  }
18619
18643
  ],
18620
18644
  "returns": {
18621
18645
  "type": {
18622
- "fqn": "@cdklabs/cdk-ssm-documents.Input"
18646
+ "primitive": "string"
18623
18647
  }
18624
- },
18625
- "static": true
18648
+ }
18649
+ }
18650
+ ],
18651
+ "name": "InlineScriptCode",
18652
+ "properties": [
18653
+ {
18654
+ "docs": {
18655
+ "stability": "stable"
18656
+ },
18657
+ "immutable": true,
18658
+ "locationInModule": {
18659
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
18660
+ "line": 58
18661
+ },
18662
+ "name": "inlineCode",
18663
+ "type": {
18664
+ "primitive": "string"
18665
+ }
18666
+ }
18667
+ ],
18668
+ "symbolId": "src/parent-steps/automation/execute-script-step:InlineScriptCode"
18669
+ },
18670
+ "@cdklabs/cdk-ssm-documents.Input": {
18671
+ "abstract": true,
18672
+ "assembly": "@cdklabs/cdk-ssm-documents",
18673
+ "docs": {
18674
+ "stability": "stable"
18675
+ },
18676
+ "fqn": "@cdklabs/cdk-ssm-documents.Input",
18677
+ "initializer": {
18678
+ "docs": {
18679
+ "stability": "stable"
18680
+ },
18681
+ "locationInModule": {
18682
+ "filename": "src/domain/input.ts",
18683
+ "line": 125
18684
+ },
18685
+ "parameters": [
18686
+ {
18687
+ "name": "props",
18688
+ "type": {
18689
+ "fqn": "@cdklabs/cdk-ssm-documents.InputProps"
18690
+ }
18691
+ }
18692
+ ]
18693
+ },
18694
+ "kind": "class",
18695
+ "locationInModule": {
18696
+ "filename": "src/domain/input.ts",
18697
+ "line": 69
18698
+ },
18699
+ "methods": [
18700
+ {
18701
+ "docs": {
18702
+ "stability": "stable"
18703
+ },
18704
+ "locationInModule": {
18705
+ "filename": "src/domain/input.ts",
18706
+ "line": 95
18707
+ },
18708
+ "name": "ofSpecifiedType",
18709
+ "parameters": [
18710
+ {
18711
+ "name": "type",
18712
+ "type": {
18713
+ "fqn": "@cdklabs/cdk-ssm-documents.DataTypeEnum"
18714
+ }
18715
+ },
18716
+ {
18717
+ "name": "inputName",
18718
+ "type": {
18719
+ "primitive": "string"
18720
+ }
18721
+ },
18722
+ {
18723
+ "name": "props",
18724
+ "type": {
18725
+ "fqn": "@cdklabs/cdk-ssm-documents.InputProps"
18726
+ }
18727
+ }
18728
+ ],
18729
+ "returns": {
18730
+ "type": {
18731
+ "fqn": "@cdklabs/cdk-ssm-documents.Input"
18732
+ }
18733
+ },
18734
+ "static": true
18626
18735
  },
18627
18736
  {
18628
18737
  "docs": {
@@ -23340,6 +23449,42 @@
23340
23449
  ],
23341
23450
  "symbolId": "src/parent-steps/command/ps-module-step:PsModuleStepProps"
23342
23451
  },
23452
+ "@cdklabs/cdk-ssm-documents.PythonVersion": {
23453
+ "assembly": "@cdklabs/cdk-ssm-documents",
23454
+ "docs": {
23455
+ "remarks": "Simulation will use local python version.",
23456
+ "stability": "stable",
23457
+ "summary": "Python runtime to use when writing SSM Document."
23458
+ },
23459
+ "fqn": "@cdklabs/cdk-ssm-documents.PythonVersion",
23460
+ "kind": "enum",
23461
+ "locationInModule": {
23462
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
23463
+ "line": 192
23464
+ },
23465
+ "members": [
23466
+ {
23467
+ "docs": {
23468
+ "stability": "stable"
23469
+ },
23470
+ "name": "VERSION_3_6"
23471
+ },
23472
+ {
23473
+ "docs": {
23474
+ "stability": "stable"
23475
+ },
23476
+ "name": "VERSION_3_7"
23477
+ },
23478
+ {
23479
+ "docs": {
23480
+ "stability": "stable"
23481
+ },
23482
+ "name": "VERSION_3_8"
23483
+ }
23484
+ ],
23485
+ "name": "PythonVersion",
23486
+ "symbolId": "src/parent-steps/automation/execute-script-step:PythonVersion"
23487
+ },
23343
23488
  "@cdklabs/cdk-ssm-documents.RebootInstanceAndWait": {
23344
23489
  "assembly": "@cdklabs/cdk-ssm-documents",
23345
23490
  "base": "@cdklabs/cdk-ssm-documents.CompositeAutomationStep",
@@ -27492,23 +27637,320 @@
27492
27637
  ],
27493
27638
  "symbolId": "src/interface/downloadable-content:SSMDocumentContent"
27494
27639
  },
27640
+ "@cdklabs/cdk-ssm-documents.ScriptCode": {
27641
+ "abstract": true,
27642
+ "assembly": "@cdklabs/cdk-ssm-documents",
27643
+ "docs": {
27644
+ "remarks": "See \"script\" parameter here:\nhttps://docs.aws.amazon.com/systems-manager/latest/userguide/automation-action-executeScript.html\nAttachments are not yet supported.",
27645
+ "stability": "stable",
27646
+ "summary": "The code to run for the execution."
27647
+ },
27648
+ "fqn": "@cdklabs/cdk-ssm-documents.ScriptCode",
27649
+ "initializer": {
27650
+ "docs": {
27651
+ "stability": "stable"
27652
+ }
27653
+ },
27654
+ "kind": "class",
27655
+ "locationInModule": {
27656
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27657
+ "line": 18
27658
+ },
27659
+ "methods": [
27660
+ {
27661
+ "docs": {
27662
+ "remarks": "File is parsed to produce yaml/json.\nSimulation will execute this file using the language specified.\n(Attachments not yet supported)",
27663
+ "stability": "stable",
27664
+ "summary": "Full path to the code to execute."
27665
+ },
27666
+ "locationInModule": {
27667
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27668
+ "line": 31
27669
+ },
27670
+ "name": "fromFile",
27671
+ "parameters": [
27672
+ {
27673
+ "name": "fullPath",
27674
+ "type": {
27675
+ "primitive": "string"
27676
+ }
27677
+ }
27678
+ ],
27679
+ "returns": {
27680
+ "type": {
27681
+ "fqn": "@cdklabs/cdk-ssm-documents.FileScriptCode"
27682
+ }
27683
+ },
27684
+ "static": true
27685
+ },
27686
+ {
27687
+ "docs": {
27688
+ "remarks": "String will be used to produce function in yaml/json.\nSimulation will execute the function in this string using the language specified.",
27689
+ "stability": "stable",
27690
+ "summary": "Inline code to be executed."
27691
+ },
27692
+ "locationInModule": {
27693
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27694
+ "line": 23
27695
+ },
27696
+ "name": "inline",
27697
+ "parameters": [
27698
+ {
27699
+ "name": "code",
27700
+ "type": {
27701
+ "primitive": "string"
27702
+ }
27703
+ }
27704
+ ],
27705
+ "returns": {
27706
+ "type": {
27707
+ "fqn": "@cdklabs/cdk-ssm-documents.InlineScriptCode"
27708
+ }
27709
+ },
27710
+ "static": true
27711
+ },
27712
+ {
27713
+ "abstract": true,
27714
+ "docs": {
27715
+ "returns": "code as a string",
27716
+ "stability": "stable"
27717
+ },
27718
+ "locationInModule": {
27719
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27720
+ "line": 38
27721
+ },
27722
+ "name": "codeAsString",
27723
+ "returns": {
27724
+ "type": {
27725
+ "primitive": "string"
27726
+ }
27727
+ }
27728
+ },
27729
+ {
27730
+ "abstract": true,
27731
+ "docs": {
27732
+ "remarks": "Otherwise, create a file with the specified suffix.",
27733
+ "stability": "stable",
27734
+ "summary": "If there is a file for this code, return it."
27735
+ },
27736
+ "locationInModule": {
27737
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27738
+ "line": 45
27739
+ },
27740
+ "name": "createOrGetFile",
27741
+ "parameters": [
27742
+ {
27743
+ "docs": {
27744
+ "summary": "of the file to create (such as \".py\")."
27745
+ },
27746
+ "name": "suffix",
27747
+ "type": {
27748
+ "primitive": "string"
27749
+ }
27750
+ }
27751
+ ],
27752
+ "returns": {
27753
+ "type": {
27754
+ "primitive": "string"
27755
+ }
27756
+ }
27757
+ }
27758
+ ],
27759
+ "name": "ScriptCode",
27760
+ "symbolId": "src/parent-steps/automation/execute-script-step:ScriptCode"
27761
+ },
27495
27762
  "@cdklabs/cdk-ssm-documents.ScriptLanguage": {
27763
+ "abstract": true,
27496
27764
  "assembly": "@cdklabs/cdk-ssm-documents",
27497
27765
  "docs": {
27498
- "stability": "stable"
27766
+ "stability": "stable",
27767
+ "summary": "Specifies the script language as described in the \"Runtime\" argument here: https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-action-executeScript.html."
27499
27768
  },
27500
27769
  "fqn": "@cdklabs/cdk-ssm-documents.ScriptLanguage",
27501
- "kind": "enum",
27770
+ "initializer": {
27771
+ "docs": {
27772
+ "stability": "stable"
27773
+ }
27774
+ },
27775
+ "kind": "class",
27502
27776
  "locationInModule": {
27503
27777
  "filename": "src/parent-steps/automation/execute-script-step.ts",
27504
- "line": 10
27778
+ "line": 92
27505
27779
  },
27506
- "members": [
27780
+ "methods": [
27507
27781
  {
27508
27782
  "docs": {
27509
- "stability": "stable"
27783
+ "remarks": "Prefer one of the other static constructors if possible.",
27784
+ "stability": "stable",
27785
+ "summary": "Creates a ScriptLanguage based on the provided runtime."
27786
+ },
27787
+ "locationInModule": {
27788
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27789
+ "line": 109
27790
+ },
27791
+ "name": "fromRuntime",
27792
+ "parameters": [
27793
+ {
27794
+ "docs": {
27795
+ "summary": "is the runtime name (such as \"python3.6\")."
27796
+ },
27797
+ "name": "runtime",
27798
+ "type": {
27799
+ "primitive": "string"
27800
+ }
27801
+ },
27802
+ {
27803
+ "docs": {
27804
+ "summary": "to be provided for python executions."
27805
+ },
27806
+ "name": "handlerName",
27807
+ "optional": true,
27808
+ "type": {
27809
+ "primitive": "string"
27810
+ }
27811
+ }
27812
+ ],
27813
+ "returns": {
27814
+ "type": {
27815
+ "fqn": "@cdklabs/cdk-ssm-documents.ScriptLanguage"
27816
+ }
27817
+ },
27818
+ "static": true
27819
+ },
27820
+ {
27821
+ "docs": {
27822
+ "stability": "stable",
27823
+ "summary": "Create a new ScriptLanguage for python execution."
27824
+ },
27825
+ "locationInModule": {
27826
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27827
+ "line": 99
27828
+ },
27829
+ "name": "python",
27830
+ "parameters": [
27831
+ {
27832
+ "docs": {
27833
+ "summary": "is the pythonVersion to use when writing the document (for simulation will not matter)."
27834
+ },
27835
+ "name": "version",
27836
+ "type": {
27837
+ "fqn": "@cdklabs/cdk-ssm-documents.PythonVersion"
27838
+ }
27839
+ },
27840
+ {
27841
+ "docs": {
27842
+ "summary": "is the function name in code as entry point for script handler."
27843
+ },
27844
+ "name": "handlerName",
27845
+ "type": {
27846
+ "primitive": "string"
27847
+ }
27848
+ }
27849
+ ],
27850
+ "returns": {
27851
+ "type": {
27852
+ "fqn": "@cdklabs/cdk-ssm-documents.ScriptLanguage"
27853
+ }
27854
+ },
27855
+ "static": true
27856
+ },
27857
+ {
27858
+ "abstract": true,
27859
+ "docs": {
27860
+ "stability": "stable",
27861
+ "summary": "The suffix to apply to file names of this type of execution."
27862
+ },
27863
+ "locationInModule": {
27864
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27865
+ "line": 142
27866
+ },
27867
+ "name": "fileSuffix",
27868
+ "returns": {
27869
+ "type": {
27870
+ "primitive": "string"
27871
+ }
27872
+ }
27873
+ },
27874
+ {
27875
+ "abstract": true,
27876
+ "docs": {
27877
+ "stability": "stable",
27878
+ "summary": "The associated runtime of this ScriptLanguage."
27879
+ },
27880
+ "locationInModule": {
27881
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27882
+ "line": 137
27883
+ },
27884
+ "name": "runtime",
27885
+ "returns": {
27886
+ "type": {
27887
+ "primitive": "string"
27888
+ }
27889
+ }
27890
+ },
27891
+ {
27892
+ "abstract": true,
27893
+ "docs": {
27894
+ "remarks": "Provide the inputs after replaced with the actual values (not variables).",
27895
+ "stability": "stable",
27896
+ "summary": "Simulate an execution of this ScriptLanguage."
27897
+ },
27898
+ "locationInModule": {
27899
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27900
+ "line": 148
27901
+ },
27902
+ "name": "simulate",
27903
+ "parameters": [
27904
+ {
27905
+ "name": "code",
27906
+ "type": {
27907
+ "fqn": "@cdklabs/cdk-ssm-documents.ScriptCode"
27908
+ }
27909
+ },
27910
+ {
27911
+ "name": "inputs",
27912
+ "type": {
27913
+ "collection": {
27914
+ "elementtype": {
27915
+ "primitive": "string"
27916
+ },
27917
+ "kind": "map"
27918
+ }
27919
+ }
27920
+ }
27921
+ ],
27922
+ "returns": {
27923
+ "type": {
27924
+ "collection": {
27925
+ "elementtype": {
27926
+ "primitive": "string"
27927
+ },
27928
+ "kind": "map"
27929
+ }
27930
+ }
27931
+ }
27932
+ },
27933
+ {
27934
+ "abstract": true,
27935
+ "docs": {
27936
+ "stability": "stable",
27937
+ "summary": "Builds the ssm inputs."
27938
+ },
27939
+ "locationInModule": {
27940
+ "filename": "src/parent-steps/automation/execute-script-step.ts",
27941
+ "line": 132
27510
27942
  },
27511
- "name": "PYTHON"
27943
+ "name": "ssmInputs",
27944
+ "returns": {
27945
+ "type": {
27946
+ "collection": {
27947
+ "elementtype": {
27948
+ "primitive": "string"
27949
+ },
27950
+ "kind": "map"
27951
+ }
27952
+ }
27953
+ }
27512
27954
  }
27513
27955
  ],
27514
27956
  "name": "ScriptLanguage",
@@ -29007,7 +29449,7 @@
29007
29449
  },
29008
29450
  "locationInModule": {
29009
29451
  "filename": "src/document/ssm-document.ts",
29010
- "line": 91
29452
+ "line": 92
29011
29453
  },
29012
29454
  "parameters": [
29013
29455
  {
@@ -29044,7 +29486,7 @@
29044
29486
  },
29045
29487
  "locationInModule": {
29046
29488
  "filename": "src/document/ssm-document.ts",
29047
- "line": 139
29489
+ "line": 140
29048
29490
  },
29049
29491
  "name": "buildSsmDocument",
29050
29492
  "protected": true,
@@ -29066,7 +29508,7 @@
29066
29508
  },
29067
29509
  "locationInModule": {
29068
29510
  "filename": "src/document/ssm-document.ts",
29069
- "line": 134
29511
+ "line": 135
29070
29512
  },
29071
29513
  "name": "documentType",
29072
29514
  "returns": {
@@ -29083,7 +29525,7 @@
29083
29525
  },
29084
29526
  "locationInModule": {
29085
29527
  "filename": "src/document/ssm-document.ts",
29086
- "line": 126
29528
+ "line": 127
29087
29529
  },
29088
29530
  "name": "formatInputs",
29089
29531
  "protected": true,
@@ -29107,7 +29549,7 @@
29107
29549
  },
29108
29550
  "locationInModule": {
29109
29551
  "filename": "src/document/ssm-document.ts",
29110
- "line": 150
29552
+ "line": 151
29111
29553
  },
29112
29554
  "name": "print",
29113
29555
  "returns": {
@@ -29119,6 +29561,20 @@
29119
29561
  ],
29120
29562
  "name": "SsmDocument",
29121
29563
  "properties": [
29564
+ {
29565
+ "docs": {
29566
+ "stability": "stable"
29567
+ },
29568
+ "immutable": true,
29569
+ "locationInModule": {
29570
+ "filename": "src/document/ssm-document.ts",
29571
+ "line": 90
29572
+ },
29573
+ "name": "cfnDocument",
29574
+ "type": {
29575
+ "fqn": "aws-cdk-lib.aws_ssm.CfnDocument"
29576
+ }
29577
+ },
29122
29578
  {
29123
29579
  "docs": {
29124
29580
  "stability": "stable"
@@ -31296,7 +31752,7 @@
31296
31752
  "kind": "class",
31297
31753
  "locationInModule": {
31298
31754
  "filename": "src/patterns/automation/string-step.ts",
31299
- "line": 26
31755
+ "line": 27
31300
31756
  },
31301
31757
  "methods": [
31302
31758
  {
@@ -31308,7 +31764,7 @@
31308
31764
  },
31309
31765
  "locationInModule": {
31310
31766
  "filename": "src/patterns/automation/string-step.ts",
31311
- "line": 44
31767
+ "line": 45
31312
31768
  },
31313
31769
  "name": "fromJson",
31314
31770
  "parameters": [
@@ -31341,7 +31797,7 @@
31341
31797
  },
31342
31798
  "locationInModule": {
31343
31799
  "filename": "src/patterns/automation/string-step.ts",
31344
- "line": 54
31800
+ "line": 55
31345
31801
  },
31346
31802
  "name": "fromObject",
31347
31803
  "parameters": [
@@ -31379,7 +31835,7 @@
31379
31835
  },
31380
31836
  "locationInModule": {
31381
31837
  "filename": "src/patterns/automation/string-step.ts",
31382
- "line": 34
31838
+ "line": 35
31383
31839
  },
31384
31840
  "name": "fromYaml",
31385
31841
  "parameters": [
@@ -31409,7 +31865,7 @@
31409
31865
  },
31410
31866
  "locationInModule": {
31411
31867
  "filename": "src/patterns/automation/string-step.ts",
31412
- "line": 155
31868
+ "line": 158
31413
31869
  },
31414
31870
  "name": "addToDocument",
31415
31871
  "overrides": "@cdklabs/cdk-ssm-documents.CompositeAutomationStep",
@@ -31600,7 +32056,7 @@
31600
32056
  },
31601
32057
  "locationInModule": {
31602
32058
  "filename": "src/patterns/document/timed-document.ts",
31603
- "line": 7
32059
+ "line": 15
31604
32060
  },
31605
32061
  "parameters": [
31606
32062
  {
@@ -31626,7 +32082,7 @@
31626
32082
  "kind": "class",
31627
32083
  "locationInModule": {
31628
32084
  "filename": "src/patterns/document/timed-document.ts",
31629
- "line": 5
32085
+ "line": 13
31630
32086
  },
31631
32087
  "methods": [
31632
32088
  {
@@ -31635,7 +32091,7 @@
31635
32091
  },
31636
32092
  "locationInModule": {
31637
32093
  "filename": "src/patterns/document/timed-document.ts",
31638
- "line": 11
32094
+ "line": 19
31639
32095
  },
31640
32096
  "name": "collectedSteps",
31641
32097
  "overrides": "@cdklabs/cdk-ssm-documents.AutomationDocument",
@@ -32688,6 +33144,6 @@
32688
33144
  "symbolId": "src/interface/webhook:WebhookImpl"
32689
33145
  }
32690
33146
  },
32691
- "version": "0.0.21",
32692
- "fingerprint": "MHsuAT8tEHjLi6zJGs2rvlPNjjeQ1KZi9ojvYT7/Sn4="
33147
+ "version": "0.0.24",
33148
+ "fingerprint": "fNWFnycU8Jx0l0dh29dxEPssLWWxLqr3kLeO5CtOZUY="
32693
33149
  }