Documentation
¶
Overview ¶
The CDK Construct Library for AWS::Cloud9
Index ¶
- func Ec2Environment_IsConstruct(x interface{}) *bool
- func Ec2Environment_IsOwnedResource(construct constructs.IConstruct) *bool
- func Ec2Environment_IsResource(construct constructs.IConstruct) *bool
- func Ec2Environment_PROPERTY_INJECTION_ID() *string
- func NewEc2Environment_Override(e Ec2Environment, scope constructs.Construct, id *string, ...)
- type CloneRepository
- type ConnectionType
- type Ec2Environment
- type Ec2EnvironmentProps
- type IEc2Environment
- type ImageId
- type Owner
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.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.
func Ec2Environment_IsOwnedResource ¶
func Ec2Environment_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise. Experimental.
func Ec2Environment_IsResource ¶
func Ec2Environment_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Ec2Environment_PROPERTY_INJECTION_ID ¶
func Ec2Environment_PROPERTY_INJECTION_ID() *string
func NewEc2Environment_Override ¶
func NewEc2Environment_Override(e Ec2Environment, scope constructs.Construct, id *string, props *Ec2EnvironmentProps)
Experimental.
Types ¶
type CloneRepository ¶
type CloneRepository interface {
// Experimental.
PathComponent() *string
// Experimental.
RepositoryUrl() *string
}
The class for different repository providers.
Example:
import "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")),
},
ImageId: cloud9.ImageId_AMAZON_LINUX_2,
})
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 ( // Connect through SSH. // Experimental. ConnectionType_CONNECT_SSH ConnectionType = "CONNECT_SSH" // Connect through AWS Systems Manager When using SSM, service role and instance profile aren't automatically created. // // See https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html#service-role-ssm // 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 in a Stack (those created by
// creating new class instances like `new Role()`, `new Bucket()`, etc.), this
// is always the same as the environment of the stack they belong to.
//
// For referenced resources (those obtained from referencing methods like
// `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
// different than the stack they were imported into.
// Experimental.
Env() *interfaces.ResourceEnvironment
// The environment ID of this Cloud9 environment.
// Experimental.
EnvironmentId() *string
// The complete IDE URL of this Cloud9 environment.
// Experimental.
IdeUrl() *string
// The tree node.
// Experimental.
Node() constructs.Node
// 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
// Returns a string representation of this construct.
// Experimental.
ToString() *string
// Applies one or more mixins to this construct.
//
// Mixins are applied in order. The list of constructs is captured at the
// start of the call, so constructs added by a mixin will not be visited.
// Use multiple `with()` calls if subsequent mixins should apply to added
// constructs.
// Experimental.
With(mixins ...constructs.IMixin) constructs.IConstruct
}
A Cloud9 Environment with Amazon EC2.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
var vpc Vpc
user := iam.NewUser(this, jsii.String("user"))
user.AddManagedPolicy(iam.ManagedPolicy_FromAwsManagedPolicyName(jsii.String("AWSCloud9Administrator")))
cloud9.NewEc2Environment(this, jsii.String("C9Env"), &Ec2EnvironmentProps{
Vpc: Vpc,
ImageId: cloud9.ImageId_AMAZON_LINUX_2,
Owner: cloud9.Owner_User(user),
})
Experimental.
func NewEc2Environment ¶
func NewEc2Environment(scope constructs.Construct, id *string, props *Ec2EnvironmentProps) Ec2Environment
Experimental.
type Ec2EnvironmentProps ¶
type Ec2EnvironmentProps struct {
// The image ID used for creating an Amazon EC2 environment.
// Experimental.
ImageId ImageId `field:"required" json:"imageId" yaml:"imageId"`
// 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 number of minutes until the running instance is shut down after the environment was last used.
//
// Setting a value of 0 means the instance will never be automatically shut down."
// Default: - The instance will not be shut down automatically.
//
// Experimental.
AutomaticStop awscdk.Duration `field:"optional" json:"automaticStop" yaml:"automaticStop"`
// The AWS CodeCommit repository to be cloned.
// Default: - do not clone any repository.
//
// 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).
// Default: - CONNECT_SSH.
//
// Experimental.
ConnectionType ConnectionType `field:"optional" json:"connectionType" yaml:"connectionType"`
// Description of the environment.
// Default: - no description.
//
// Experimental.
Description *string `field:"optional" json:"description" yaml:"description"`
// Name of the environment.
// Default: - automatically generated name.
//
// Experimental.
Ec2EnvironmentName *string `field:"optional" json:"ec2EnvironmentName" yaml:"ec2EnvironmentName"`
// The type of instance to connect to the environment.
// Default: - t2.micro
//
// Experimental.
InstanceType awsec2.InstanceType `field:"optional" json:"instanceType" yaml:"instanceType"`
// Owner of the environment.
//
// The owner has full control of the environment and can invite additional members.
// Default: - The identity that CloudFormation executes under will be the owner.
//
// Experimental.
Owner Owner `field:"optional" json:"owner" yaml:"owner"`
// The subnetSelection of the VPC that AWS Cloud9 will use to communicate with the Amazon EC2 instance.
// Default: - all public subnets of the VPC are selected.
//
// Experimental.
SubnetSelection *awsec2.SubnetSelection `field:"optional" json:"subnetSelection" yaml:"subnetSelection"`
}
Properties for Ec2Environment.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
var vpc Vpc
user := iam.NewUser(this, jsii.String("user"))
user.AddManagedPolicy(iam.ManagedPolicy_FromAwsManagedPolicyName(jsii.String("AWSCloud9Administrator")))
cloud9.NewEc2Environment(this, jsii.String("C9Env"), &Ec2EnvironmentProps{
Vpc: Vpc,
ImageId: cloud9.ImageId_AMAZON_LINUX_2,
Owner: cloud9.Owner_User(user),
})
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.
type ImageId ¶
type ImageId string
The image ID used for creating an Amazon EC2 environment.
Example:
import "github.com/aws/aws-cdk-go/awscdk"
var vpc Vpc
user := iam.NewUser(this, jsii.String("user"))
user.AddManagedPolicy(iam.ManagedPolicy_FromAwsManagedPolicyName(jsii.String("AWSCloud9Administrator")))
cloud9.NewEc2Environment(this, jsii.String("C9Env"), &Ec2EnvironmentProps{
Vpc: Vpc,
ImageId: cloud9.ImageId_AMAZON_LINUX_2,
Owner: cloud9.Owner_User(user),
})
Experimental.
const ( // Create using Amazon Linux 2. // Experimental. ImageId_AMAZON_LINUX_2 ImageId = "AMAZON_LINUX_2" // Create using Amazon Linux 2023. // Experimental. ImageId_AMAZON_LINUX_2023 ImageId = "AMAZON_LINUX_2023" // Create using Ubuntu 18.04. // Deprecated: Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we recommend you choose Ubuntu 22.04. ImageId_UBUNTU_18_04 ImageId = "UBUNTU_18_04" // Create using Ubuntu 22.04. // Experimental. ImageId_UBUNTU_22_04 ImageId = "UBUNTU_22_04" )
type Owner ¶
type Owner interface {
// of environment owner.
// Experimental.
OwnerArn() *string
}
An environment owner.
Example:
import iam "github.com/aws/aws-cdk-go/awscdk"
var vpc Vpc
cloud9.NewEc2Environment(this, jsii.String("C9Env"), &Ec2EnvironmentProps{
Vpc: Vpc,
ImageId: cloud9.ImageId_AMAZON_LINUX_2,
Owner: cloud9.Owner_FederatedUser(awscdk.*stack_Of(this).Account, jsii.String("Admin/johndoe")),
})
Experimental.
func Owner_AccountRoot ¶
Make the Account Root User the environment owner (not recommended). Experimental.
func Owner_AssumedRole ¶
Make an IAM assumed role the environment owner. Experimental.
func Owner_FederatedUser ¶
Make an IAM federated user the environment owner. Experimental.
func Owner_User ¶
Make an IAM user the environment owner.
User need to have AWSCloud9Administrator permissions. See: https://docs.aws.amazon.com/cloud9/latest/user-guide/share-environment.html#share-environment-about
Experimental.