awscloud9

package
v1.168.0-devpreview Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

AWS Cloud9 Construct Library

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.

// create a cloud9 ec2 environment in a new VPC
vpc := ec2.NewVpc(this, jsii.String("VPC"), &vpcProps{
	maxAzs: jsii.Number(3),
})
cloud9.NewEc2Environment(this, jsii.String("Cloud9Env"), &ec2EnvironmentProps{
	vpc: vpc,
})

// or create the cloud9 environment in the default VPC with specific instanceType
defaultVpc := ec2.vpc.fromLookup(this, jsii.String("DefaultVPC"), &vpcLookupOptions{
	isDefault: jsii.Boolean(true),
})
cloud9.NewEc2Environment(this, jsii.String("Cloud9Env2"), &ec2EnvironmentProps{
	vpc: defaultVpc,
	instanceType: ec2.NewInstanceType(jsii.String("t3.large")),
})

// or specify in a different subnetSelection
c9env := cloud9.NewEc2Environment(this, jsii.String("Cloud9Env3"), &ec2EnvironmentProps{
	vpc: vpc,
	subnetSelection: &subnetSelection{
		subnetType: ec2.subnetType_PRIVATE_WITH_NAT,
	},
})

// print the Cloud9 IDE URL in the output
// print the Cloud9 IDE URL in the output
awscdk.NewCfnOutput(this, jsii.String("URL"), &cfnOutputProps{
	value: c9env.ideUrl,
})

Cloning Repositories

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

import codecommit "github.com/aws/aws-cdk-go/awscdk"

// create a new Cloud9 environment and clone the two repositories
var vpc vpc


// create a codecommit repository to clone into the cloud9 environment
repoNew := codecommit.NewRepository(this, jsii.String("RepoNew"), &repositoryProps{
	repositoryName: jsii.String("new-repo"),
})

// import an existing codecommit repository to clone into the cloud9 environment
repoExisting := codecommit.repository.fromRepositoryName(this, jsii.String("RepoExisting"), jsii.String("existing-repo"))
cloud9.NewEc2Environment(this, jsii.String("C9Env"), &ec2EnvironmentProps{
	vpc: vpc,
	clonedRepositories: []cloneRepository{
		cloud9.*cloneRepository.fromCodeCommit(repoNew, jsii.String("/src/new-repo")),
		cloud9.*cloneRepository.fromCodeCommit(repoExisting, jsii.String("/src/existing-repo")),
	},
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CfnEnvironmentEC2_CFN_RESOURCE_TYPE_NAME

func CfnEnvironmentEC2_CFN_RESOURCE_TYPE_NAME() *string

func CfnEnvironmentEC2_IsCfnElement

func CfnEnvironmentEC2_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnEnvironmentEC2_IsCfnResource

func CfnEnvironmentEC2_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnEnvironmentEC2_IsConstruct

func CfnEnvironmentEC2_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func Ec2Environment_IsConstruct

func Ec2Environment_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func Ec2Environment_IsResource

func Ec2Environment_IsResource(construct awscdk.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func NewCfnEnvironmentEC2_Override

func NewCfnEnvironmentEC2_Override(c CfnEnvironmentEC2, scope awscdk.Construct, id *string, props *CfnEnvironmentEC2Props)

Create a new `AWS::Cloud9::EnvironmentEC2`.

func NewEc2Environment_Override

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

Experimental.

Types

type CfnEnvironmentEC2

type CfnEnvironmentEC2 interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The Amazon Resource Name (ARN) of the development environment, such as `arn:aws:cloud9:us-east-2:123456789012:environment:2bc3642873c342e485f7e0c561234567` .
	AttrArn() *string
	// The name of the environment.
	AttrName() *string
	// The number of minutes until the running instance is shut down after the environment was last used.
	AutomaticStopTimeMinutes() *float64
	SetAutomaticStopTimeMinutes(val *float64)
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// The connection type used for connecting to an Amazon EC2 environment.
	//
	// Valid values are `CONNECT_SSH` (default) and `CONNECT_SSM` (connected through AWS Systems Manager ).
	ConnectionType() *string
	SetConnectionType(val *string)
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The description of the environment to create.
	Description() *string
	SetDescription(val *string)
	// The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance.
	//
	// To choose an AMI for the instance, you must specify a valid AMI alias or a valid AWS Systems Manager path.
	//
	// The default AMI is used if the parameter isn't explicitly assigned a value in the request.
	//
	// *AMI aliases*
	//
	// - *Amazon Linux (default): `amazonlinux-1-x86_64`*
	// - Amazon Linux 2: `amazonlinux-2-x86_64`
	// - Ubuntu 18.04: `ubuntu-18.04-x86_64`
	//
	// *SSM paths*
	//
	// - *Amazon Linux (default): `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64`*
	// - Amazon Linux 2: `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64`
	// - Ubuntu 18.04: `resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64`
	ImageId() *string
	SetImageId(val *string)
	// The type of instance to connect to the environment (for example, `t2.micro` ).
	InstanceType() *string
	SetInstanceType(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The name of the environment.
	Name() *string
	SetName(val *string)
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// The Amazon Resource Name (ARN) of the environment owner.
	//
	// This ARN can be the ARN of any AWS Identity and Access Management principal. If this value is not specified, the ARN defaults to this environment's creator.
	OwnerArn() *string
	SetOwnerArn(val *string)
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// Any AWS CodeCommit source code repositories to be cloned into the development environment.
	Repositories() interface{}
	SetRepositories(val interface{})
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// The ID of the subnet in Amazon Virtual Private Cloud (Amazon VPC) that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.
	SubnetId() *string
	SetSubnetId(val *string)
	// An array of key-value pairs that will be associated with the new AWS Cloud9 development environment.
	Tags() awscdk.TagManager
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::Cloud9::EnvironmentEC2`.

The `AWS::Cloud9::EnvironmentEC2` resource creates an Amazon EC2 development environment in AWS Cloud9 . For more information, see [Creating an Environment](https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment.html) in the *AWS Cloud9 User Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnEnvironmentEC2 := awscdk.Aws_cloud9.NewCfnEnvironmentEC2(this, jsii.String("MyCfnEnvironmentEC2"), &cfnEnvironmentEC2Props{
	instanceType: jsii.String("instanceType"),

	// the properties below are optional
	automaticStopTimeMinutes: jsii.Number(123),
	connectionType: jsii.String("connectionType"),
	description: jsii.String("description"),
	imageId: jsii.String("imageId"),
	name: jsii.String("name"),
	ownerArn: jsii.String("ownerArn"),
	repositories: []interface{}{
		&repositoryProperty{
			pathComponent: jsii.String("pathComponent"),
			repositoryUrl: jsii.String("repositoryUrl"),
		},
	},
	subnetId: jsii.String("subnetId"),
	tags: []cfnTag{
		&cfnTag{
			key: jsii.String("key"),
			value: jsii.String("value"),
		},
	},
})

func NewCfnEnvironmentEC2

func NewCfnEnvironmentEC2(scope awscdk.Construct, id *string, props *CfnEnvironmentEC2Props) CfnEnvironmentEC2

Create a new `AWS::Cloud9::EnvironmentEC2`.

type CfnEnvironmentEC2Props

type CfnEnvironmentEC2Props struct {
	// The type of instance to connect to the environment (for example, `t2.micro` ).
	InstanceType *string `field:"required" json:"instanceType" yaml:"instanceType"`
	// The number of minutes until the running instance is shut down after the environment was last used.
	AutomaticStopTimeMinutes *float64 `field:"optional" json:"automaticStopTimeMinutes" yaml:"automaticStopTimeMinutes"`
	// The connection type used for connecting to an Amazon EC2 environment.
	//
	// Valid values are `CONNECT_SSH` (default) and `CONNECT_SSM` (connected through AWS Systems Manager ).
	ConnectionType *string `field:"optional" json:"connectionType" yaml:"connectionType"`
	// The description of the environment to create.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance.
	//
	// To choose an AMI for the instance, you must specify a valid AMI alias or a valid AWS Systems Manager path.
	//
	// The default AMI is used if the parameter isn't explicitly assigned a value in the request.
	//
	// *AMI aliases*
	//
	// - *Amazon Linux (default): `amazonlinux-1-x86_64`*
	// - Amazon Linux 2: `amazonlinux-2-x86_64`
	// - Ubuntu 18.04: `ubuntu-18.04-x86_64`
	//
	// *SSM paths*
	//
	// - *Amazon Linux (default): `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64`*
	// - Amazon Linux 2: `resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64`
	// - Ubuntu 18.04: `resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64`
	ImageId *string `field:"optional" json:"imageId" yaml:"imageId"`
	// The name of the environment.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The Amazon Resource Name (ARN) of the environment owner.
	//
	// This ARN can be the ARN of any AWS Identity and Access Management principal. If this value is not specified, the ARN defaults to this environment's creator.
	OwnerArn *string `field:"optional" json:"ownerArn" yaml:"ownerArn"`
	// Any AWS CodeCommit source code repositories to be cloned into the development environment.
	Repositories interface{} `field:"optional" json:"repositories" yaml:"repositories"`
	// The ID of the subnet in Amazon Virtual Private Cloud (Amazon VPC) that AWS Cloud9 will use to communicate with the Amazon Elastic Compute Cloud (Amazon EC2) instance.
	SubnetId *string `field:"optional" json:"subnetId" yaml:"subnetId"`
	// An array of key-value pairs that will be associated with the new AWS Cloud9 development environment.
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Properties for defining a `CfnEnvironmentEC2`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnEnvironmentEC2Props := &cfnEnvironmentEC2Props{
	instanceType: jsii.String("instanceType"),

	// the properties below are optional
	automaticStopTimeMinutes: jsii.Number(123),
	connectionType: jsii.String("connectionType"),
	description: jsii.String("description"),
	imageId: jsii.String("imageId"),
	name: jsii.String("name"),
	ownerArn: jsii.String("ownerArn"),
	repositories: []interface{}{
		&repositoryProperty{
			pathComponent: jsii.String("pathComponent"),
			repositoryUrl: jsii.String("repositoryUrl"),
		},
	},
	subnetId: jsii.String("subnetId"),
	tags: []cfnTag{
		&cfnTag{
			key: jsii.String("key"),
			value: jsii.String("value"),
		},
	},
}

type CfnEnvironmentEC2_RepositoryProperty

type CfnEnvironmentEC2_RepositoryProperty struct {
	// The path within the development environment's default file system location to clone the AWS CodeCommit repository into.
	//
	// For example, `/REPOSITORY_NAME` would clone the repository into the `/home/USER_NAME/environment/REPOSITORY_NAME` directory in the environment.
	PathComponent *string `field:"required" json:"pathComponent" yaml:"pathComponent"`
	// The clone URL of the AWS CodeCommit repository to be cloned.
	//
	// For example, for an AWS CodeCommit repository this might be `https://git-codecommit.us-east-2.amazonaws.com/v1/repos/REPOSITORY_NAME` .
	RepositoryUrl *string `field:"required" json:"repositoryUrl" yaml:"repositoryUrl"`
}

The `Repository` property type specifies an AWS CodeCommit source code repository to be cloned into an AWS Cloud9 development environment.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

repositoryProperty := &repositoryProperty{
	pathComponent: jsii.String("pathComponent"),
	repositoryUrl: jsii.String("repositoryUrl"),
}

type CloneRepository

type CloneRepository interface {
	// Experimental.
	PathComponent() *string
	// Experimental.
	RepositoryUrl() *string
}

The class for different repository providers.

Example:

import codecommit "github.com/aws/aws-cdk-go/awscdk"

// create a new Cloud9 environment and clone the two repositories
var vpc vpc

// create a codecommit repository to clone into the cloud9 environment
repoNew := codecommit.NewRepository(this, jsii.String("RepoNew"), &repositoryProps{
	repositoryName: jsii.String("new-repo"),
})

// import an existing codecommit repository to clone into the cloud9 environment
repoExisting := codecommit.repository.fromRepositoryName(this, jsii.String("RepoExisting"), jsii.String("existing-repo"))
cloud9.NewEc2Environment(this, jsii.String("C9Env"), &ec2EnvironmentProps{
	vpc: vpc,
	clonedRepositories: []cloneRepository{
		cloud9.*cloneRepository.fromCodeCommit(repoNew, jsii.String("/src/new-repo")),
		cloud9.*cloneRepository.fromCodeCommit(repoExisting, jsii.String("/src/existing-repo")),
	},
})

Experimental.

func CloneRepository_FromCodeCommit

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

import repository to cloud9 environment from AWS CodeCommit. Experimental.

type ConnectionType

type ConnectionType string

The connection type used for connecting to an Amazon EC2 environment. Experimental.

const (
	// Conect through SSH.
	// Experimental.
	ConnectionType_CONNECT_SSH ConnectionType = "CONNECT_SSH"
	// Connect through AWS Systems Manager.
	// Experimental.
	ConnectionType_CONNECT_SSM ConnectionType = "CONNECT_SSM"
)

type Ec2Environment

type Ec2Environment interface {
	awscdk.Resource
	IEc2Environment
	// The environment ARN of this Cloud9 environment.
	// Experimental.
	Ec2EnvironmentArn() *string
	// The environment name of this Cloud9 environment.
	// Experimental.
	Ec2EnvironmentName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The environment ID of this Cloud9 environment.
	// Experimental.
	EnvironmentId() *string
	// The complete IDE URL of this Cloud9 environment.
	// Experimental.
	IdeUrl() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// VPC ID.
	// Experimental.
	Vpc() awsec2.IVpc
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

A Cloud9 Environment with Amazon EC2.

Example:

// create a cloud9 ec2 environment in a new VPC
vpc := ec2.NewVpc(this, jsii.String("VPC"), &vpcProps{
	maxAzs: jsii.Number(3),
})
cloud9.NewEc2Environment(this, jsii.String("Cloud9Env"), &ec2EnvironmentProps{
	vpc: vpc,
})

// or create the cloud9 environment in the default VPC with specific instanceType
defaultVpc := ec2.vpc.fromLookup(this, jsii.String("DefaultVPC"), &vpcLookupOptions{
	isDefault: jsii.Boolean(true),
})
cloud9.NewEc2Environment(this, jsii.String("Cloud9Env2"), &ec2EnvironmentProps{
	vpc: defaultVpc,
	instanceType: ec2.NewInstanceType(jsii.String("t3.large")),
})

// or specify in a different subnetSelection
c9env := cloud9.NewEc2Environment(this, jsii.String("Cloud9Env3"), &ec2EnvironmentProps{
	vpc: vpc,
	subnetSelection: &subnetSelection{
		subnetType: ec2.subnetType_PRIVATE_WITH_NAT,
	},
})

// print the Cloud9 IDE URL in the output
// print the Cloud9 IDE URL in the output
awscdk.NewCfnOutput(this, jsii.String("URL"), &cfnOutputProps{
	value: c9env.ideUrl,
})

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 `field:"required" json:"vpc" yaml:"vpc"`
	// The AWS CodeCommit repository to be cloned.
	// Experimental.
	ClonedRepositories *[]CloneRepository `field:"optional" json:"clonedRepositories" yaml:"clonedRepositories"`
	// The connection type used for connecting to an Amazon EC2 environment.
	//
	// Valid values are: CONNECT_SSH (default) and CONNECT_SSM (connected through AWS Systems Manager).
	// Experimental.
	ConnectionType ConnectionType `field:"optional" json:"connectionType" yaml:"connectionType"`
	// Description of the environment.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// Name of the environment.
	// Experimental.
	Ec2EnvironmentName *string `field:"optional" json:"ec2EnvironmentName" yaml:"ec2EnvironmentName"`
	// The type of instance to connect to the environment.
	// Experimental.
	InstanceType awsec2.InstanceType `field:"optional" json:"instanceType" yaml:"instanceType"`
	// The subnetSelection of the VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.
	// Experimental.
	SubnetSelection *awsec2.SubnetSelection `field:"optional" json:"subnetSelection" yaml:"subnetSelection"`
}

Properties for Ec2Environment.

Example:

// create a cloud9 ec2 environment in a new VPC
vpc := ec2.NewVpc(this, jsii.String("VPC"), &vpcProps{
	maxAzs: jsii.Number(3),
})
cloud9.NewEc2Environment(this, jsii.String("Cloud9Env"), &ec2EnvironmentProps{
	vpc: vpc,
})

// or create the cloud9 environment in the default VPC with specific instanceType
defaultVpc := ec2.vpc.fromLookup(this, jsii.String("DefaultVPC"), &vpcLookupOptions{
	isDefault: jsii.Boolean(true),
})
cloud9.NewEc2Environment(this, jsii.String("Cloud9Env2"), &ec2EnvironmentProps{
	vpc: defaultVpc,
	instanceType: ec2.NewInstanceType(jsii.String("t3.large")),
})

// or specify in a different subnetSelection
c9env := cloud9.NewEc2Environment(this, jsii.String("Cloud9Env3"), &ec2EnvironmentProps{
	vpc: vpc,
	subnetSelection: &subnetSelection{
		subnetType: ec2.subnetType_PRIVATE_WITH_NAT,
	},
})

// print the Cloud9 IDE URL in the output
// print the Cloud9 IDE URL in the output
awscdk.NewCfnOutput(this, jsii.String("URL"), &cfnOutputProps{
	value: c9env.ideUrl,
})

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

Jump to

Keyboard shortcuts

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