Skip to content

Commit

Permalink
Merge branch 'aws:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthsalot authored Jan 24, 2022
2 parents 305a4cd + f8e6599 commit 3be7785
Show file tree
Hide file tree
Showing 16 changed files with 173 additions and 90 deletions.
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-acmpca/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

```ts
```ts nofixture
import * as acmpca from '@aws-cdk/aws-acmpca';
```

Expand Down Expand Up @@ -62,6 +62,8 @@ If you need to pass the higher-level `ICertificateAuthority` somewhere,
you can get it from the lower-level `CfnCertificateAuthority` using the same `fromCertificateAuthorityArn` method:

```ts
declare const cfnCertificateAuthority: acmpca.CfnCertificateAuthority;

const certificateAuthority = acmpca.CertificateAuthority.fromCertificateAuthorityArn(this, 'CertificateAuthority',
cfnCertificateAuthority.attrArn);
```
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-acmpca/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@
]
}
},
"projectReferences": true
"projectReferences": true,
"metadata": {
"jsii": {
"rosetta": {
"strict": true
}
}
}
},
"repository": {
"type": "git",
Expand Down
11 changes: 11 additions & 0 deletions packages/@aws-cdk/aws-acmpca/rosetta/default.ts-fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Fixture with packages imported, but nothing else
import { Stack } from '@aws-cdk/core';
import { Construct } from 'constructs';
import * as acmpca from '@aws-cdk/aws-acmpca';

class Fixture extends Stack {
constructor(scope: Construct, id: string) {
super(scope, id);
/// here
}
}
33 changes: 21 additions & 12 deletions packages/@aws-cdk/aws-cloud9/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,23 @@

This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) 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.
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`.
EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment in the private subnet, specify
`subnetSelection` with private `subnetType`.


```ts
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 });
Expand All @@ -42,36 +48,39 @@ new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc });
const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true });
new cloud9.Ec2Environment(this, 'Cloud9Env2', {
vpc: defaultVpc,
instanceType: new ec2.InstanceType('t3.large')
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
}
vpc,
subnetSelection: {
subnetType: ec2.SubnetType.PRIVATE,
},
});

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

## Cloning Repositories

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

```ts
import * as codecommit from '@aws-cdk/aws-codecommit';

// 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');
const repoExisting = codecommit.Repository.fromRepositoryName(this, 'RepoExisting', 'existing-repo');

// create a new Cloud9 environment and clone the two repositories
new cloud9.Ec2Environment(stack, 'C9Env', {
declare const vpc: ec2.Vpc;
new cloud9.Ec2Environment(this, 'C9Env', {
vpc,
clonedRepositories: [
cloud9.CloneRepository.fromCodeCommit(repoNew, '/src/new-repo'),
Expand Down
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-cloud9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@
]
}
},
"projectReferences": true
"projectReferences": true,
"metadata": {
"jsii": {
"rosetta": {
"strict": true
}
}
}
},
"repository": {
"type": "git",
Expand Down
12 changes: 12 additions & 0 deletions packages/@aws-cdk/aws-cloud9/rosetta/default.ts-fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Fixture with packages imported, but nothing else
import { CfnOutput, Stack } from '@aws-cdk/core';
import { Construct } from 'constructs';
import * as cloud9 from '@aws-cdk/aws-cloud9';
import * as ec2 from '@aws-cdk/aws-ec2';

class Fixture extends Stack {
constructor(scope: Construct, id: string) {
super(scope, id);
/// here
}
}
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-codeguruprofiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Amazon CodeGuru Profiler collects runtime performance data from your live applic

Import to your project:

```ts
```ts nofixture
import * as codeguruprofiler from '@aws-cdk/aws-codeguruprofiler';
```

Expand All @@ -27,11 +27,11 @@ Here's how to setup a profiling group and give your compute role permissions to

```ts
// The execution role of your application that publishes to the ProfilingGroup via CodeGuru Profiler Profiling Agent. (the following is merely an example)
const publishAppRole = new Role(stack, 'PublishAppRole', {
assumedBy: new AccountRootPrincipal(),
const publishAppRole = new iam.Role(this, 'PublishAppRole', {
assumedBy: new iam.AccountRootPrincipal(),
});

const profilingGroup = new ProfilingGroup(stack, 'MyProfilingGroup');
const profilingGroup = new codeguruprofiler.ProfilingGroup(this, 'MyProfilingGroup');
profilingGroup.grantPublish(publishAppRole);
```

Expand All @@ -41,7 +41,7 @@ Code Guru Profiler supports multiple compute environments.
They can be configured when creating a Profiling Group by using the `computePlatform` property:

```ts
const profilingGroup = new ProfilingGroup(stack, 'MyProfilingGroup', {
computePlatform: ComputePlatform.AWS_LAMBDA,
const profilingGroup = new codeguruprofiler.ProfilingGroup(this, 'MyProfilingGroup', {
computePlatform: codeguruprofiler.ComputePlatform.AWS_LAMBDA,
});
```
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-codeguruprofiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@
]
}
},
"projectReferences": true
"projectReferences": true,
"metadata": {
"jsii": {
"rosetta": {
"strict": true
}
}
}
},
"repository": {
"type": "git",
Expand Down
12 changes: 12 additions & 0 deletions packages/@aws-cdk/aws-codeguruprofiler/rosetta/default.ts-fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Fixture with packages imported, but nothing else
import { Stack } from '@aws-cdk/core';
import { Construct } from 'constructs';
import * as codeguruprofiler from '@aws-cdk/aws-codeguruprofiler';
import * as iam from '@aws-cdk/aws-iam';

class Fixture extends Stack {
constructor(scope: Construct, id: string) {
super(scope, id);
/// here
}
}
Loading

0 comments on commit 3be7785

Please sign in to comment.