awscdkawscloud9alpha

package module
v2.0.0-rc.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

README

AWS Cloud9 Construct Library


All classes with the Cfn prefix in this module (CFN Resources) are always stable and safe to use.

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. 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.


This module is part of the AWS Cloud Development Kit project.

AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser. It includes a code editor, debugger, and terminal. Cloud9 comes prepackaged with essential tools for popular programming languages, including JavaScript, Python, PHP, and more, so you don’t need to install files or configure your development machine to start new projects. Since your Cloud9 IDE is cloud-based, you can work on your projects from your office, home, or anywhere using an internet-connected machine. Cloud9 also provides a seamless experience for developing serverless applications enabling you to easily define resources, debug, and switch between local and remote execution of serverless applications. With Cloud9, you can quickly share your development environment with your team, enabling you to pair program and track each other's inputs in real time.

Creating EC2 Environment

EC2 Environments are defined with Ec2Environment. To create an EC2 environment in the private subnet, specify subnetSelection with private subnetType.

import * as cloud9 from '@aws-cdk/aws-cloud9';

// create a cloud9 ec2 environment in a new VPC
const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3});
new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc });

// or create the cloud9 environment in the default VPC with specific instanceType
const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true });
new cloud9.Ec2Environment(this, 'Cloud9Env2', {
  vpc: defaultVpc,
  instanceType: new ec2.InstanceType('t3.large')
});

// or specify in a different subnetSelection
const c9env = new cloud9.Ec2Environment(this, 'Cloud9Env3', {
    vpc,
    subnetSelection: {
      subnetType: ec2.SubnetType.PRIVATE
    }
});

// print the Cloud9 IDE URL in the output
new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl });

Cloning Repositories

Use clonedRepositories to clone one or multiple AWS Codecommit repositories into the environment:

// create a codecommit repository to clone into the cloud9 environment
const repoNew = new codecommit.Repository(this, 'RepoNew', {
  repositoryName: 'new-repo',
});

// import an existing codecommit repository to clone into the cloud9 environment
const repoExisting = codecommit.Repository.fromRepositoryName(stack, 'RepoExisting', 'existing-repo');

// create a new Cloud9 environment and clone the two repositories
new cloud9.Ec2Environment(stack, 'C9Env', {
  vpc,
  clonedRepositories: [
    cloud9.CloneRepository.fromCodeCommit(repoNew, '/src/new-repo'),
    cloud9.CloneRepository.fromCodeCommit(repoExisting, '/src/existing-repo'),
  ],
});

Documentation

Overview

The CDK Construct Library for AWS::Cloud9

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ec2Environment_IsConstruct

func Ec2Environment_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func Ec2Environment_IsResource

func Ec2Environment_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func NewEc2Environment_Override

func NewEc2Environment_Override(e Ec2Environment, scope constructs.Construct, id *string, props *Ec2EnvironmentProps)

Experimental.

Types

type CloneRepository

type CloneRepository interface {
	PathComponent() *string
	RepositoryUrl() *string
}

The class for different repository providers. Experimental.

func CloneRepository_FromCodeCommit

func CloneRepository_FromCodeCommit(repository awscodecommit.IRepository, path *string) CloneRepository

import repository to cloud9 environment from AWS CodeCommit. Experimental.

type Ec2Environment

type Ec2Environment interface {
	awscdk.Resource
	IEc2Environment
	Ec2EnvironmentArn() *string
	Ec2EnvironmentName() *string
	Env() *awscdk.ResourceEnvironment
	EnvironmentId() *string
	IdeUrl() *string
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	Vpc() awsec2.IVpc
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

A Cloud9 Environment with Amazon EC2. Experimental.

func NewEc2Environment

func NewEc2Environment(scope constructs.Construct, id *string, props *Ec2EnvironmentProps) Ec2Environment

Experimental.

type Ec2EnvironmentProps

type Ec2EnvironmentProps struct {
	// The VPC that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.
	// Experimental.
	Vpc awsec2.IVpc `json:"vpc"`
	// The AWS CodeCommit repository to be cloned.
	// Experimental.
	ClonedRepositories *[]CloneRepository `json:"clonedRepositories"`
	// Description of the environment.
	// Experimental.
	Description *string `json:"description"`
	// Name of the environment.
	// Experimental.
	Ec2EnvironmentName *string `json:"ec2EnvironmentName"`
	// The type of instance to connect to the environment.
	// Experimental.
	InstanceType awsec2.InstanceType `json:"instanceType"`
	// The subnetSelection of the VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.
	// Experimental.
	SubnetSelection *awsec2.SubnetSelection `json:"subnetSelection"`
}

Properties for Ec2Environment. Experimental.

type IEc2Environment

type IEc2Environment interface {
	awscdk.IResource
	// The arn of the EnvironmentEc2.
	// Experimental.
	Ec2EnvironmentArn() *string
	// The name of the EnvironmentEc2.
	// Experimental.
	Ec2EnvironmentName() *string
}

A Cloud9 Environment. Experimental.

func Ec2Environment_FromEc2EnvironmentName

func Ec2Environment_FromEc2EnvironmentName(scope constructs.Construct, id *string, ec2EnvironmentName *string) IEc2Environment

import from EnvironmentEc2Name. Experimental.

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL