
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@cdk-use-cases/custom-cloud9-ssm
Advanced tools
All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
| Language | Package |
|---|---|
Python | cdk_use_cases.custom_cloud9_ssm |
Typescript | @cdk-use-cases/custom-cloud9-ssm |
This pattern implements a Cloud9 EC2 environment, applying an initial configuration to the EC2 instance using an SSM Document. It includes helper methods to add steps and parameters to the SSM Document and to resize the EBS volume of the EC2 instance to a given size.
Here is a minimal deployable pattern definition in Typescript:
new CustomCloud9Ssm(stack, 'CustomCloud9Ssm');
You can view other usage examples.
new CustomCloud9Ssm(scope: Construct, id: string, props: CustomCloud9SsmProps);
Parameters
ConstructstringCustomCloud9SsmProps| Name | Type | Description |
|---|---|---|
| ssmDocumentProps? | ssm.CfnDocumentProps | Optional configuration for the SSM Document. |
| cloud9Ec2Props? | cloud9.CfnEnvironmentEC2Props | Optional configuration for the Cloud9 EC2 environment. |
| Name | Type | Description |
|---|---|---|
| ec2Role | iam.Role | The IAM Role that is attached to the EC2 instance launched with the Cloud9 environment to grant it permissions to execute the statements in the SSM Document. |
public addDocumentSteps(steps: string): void
Description
Adds one or more steps to the content of the SSM Document.
Parameters
string: YAML formatted string containing one or more steps to be added to the mainSteps section of the SSM Document.public addDocumentParameters(parameters: string): void
Description
Adds one or more parameters to the content of the SSM Document.
Parameters
string: YAML formatted string containing one or more parameters to be added to the parameters section of the SSM Document.public resizeEBSTo(size: number): void
Description
Adds a step to the SSM Document content that resizes the EBS volume of the EC2 instance. Attaches the required policies to ec2Role.
Parameters
number: size in GiB to resize the EBS volume to.Out of the box implementation of the Construct without any override will set the following defaults:

Using default configuration and adding steps
import {CustomCloud9Ssm} from '@cdk-use-cases/custom-cloud9-ssm';
// Define a step that installs boto3
const boto3Step = `
- name: InstallBoto3
action: aws:runShellScript
inputs:
runCommand:
- "#!/bin/bash"
- sudo pip install boto3
`
// Create the custom environment
let customCloud9 = new CustomCloud9Ssm(this, 'CustomCloud9Ssm')
// Add your step to the default document configuration
customCloud9.addDocumentSteps(boto3Step)
Providing props for the SSM Document and resizing the EBS volume
import {CustomCloud9Ssm, CustomCloud9SsmProps} from '@cdk-use-cases/custom-cloud9-ssm';
const yaml = require('yaml')
// Define the content of the document
const content = `
schemaVersion: '2.2'
description: Bootstrap Cloud9 EC2 instance
mainSteps:
- name: InstallBoto3
action: aws:runShellScript
inputs:
runCommand:
- "#!/bin/bash"
- sudo pip install boto3
`
// Specify the configuration for the SSM Document
const cloud9Props: CustomCloud9SsmProps = {
ssmDocumentProps: {
documentType: 'Command',
content: yaml.parse(content),
name: 'MyDocument'
}
}
// Create the custom environment
let customCloud9 = new CustomCloud9Ssm(this, 'CustomCloud9Ssm', cloud9Props)
// Add a step to resize the EBS volume to 50GB
customCloud9.resizeEBSTo(50)
© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
FAQs
Pattern for Cloud9 EC2 environment and SSM Document.
We found that @cdk-use-cases/custom-cloud9-ssm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.