Skip to content

Commit f8e6599

Browse files
authored
chore: make a few more examples compile (#18605)
- cognito - acmpca - codeguruprofiler - cloud9 - signer ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 43f232d commit f8e6599

File tree

16 files changed

+173
-90
lines changed

16 files changed

+173
-90
lines changed

Diff for: packages/@aws-cdk/aws-acmpca/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

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

17-
```ts
17+
```ts nofixture
1818
import * as acmpca from '@aws-cdk/aws-acmpca';
1919
```
2020

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

6464
```ts
65+
declare const cfnCertificateAuthority: acmpca.CfnCertificateAuthority;
66+
6567
const certificateAuthority = acmpca.CertificateAuthority.fromCertificateAuthorityArn(this, 'CertificateAuthority',
6668
cfnCertificateAuthority.attrArn);
6769
```

Diff for: packages/@aws-cdk/aws-acmpca/package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
]
2929
}
3030
},
31-
"projectReferences": true
31+
"projectReferences": true,
32+
"metadata": {
33+
"jsii": {
34+
"rosetta": {
35+
"strict": true
36+
}
37+
}
38+
}
3239
},
3340
"repository": {
3441
"type": "git",
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Fixture with packages imported, but nothing else
2+
import { Stack } from '@aws-cdk/core';
3+
import { Construct } from 'constructs';
4+
import * as acmpca from '@aws-cdk/aws-acmpca';
5+
6+
class Fixture extends Stack {
7+
constructor(scope: Construct, id: string) {
8+
super(scope, id);
9+
/// here
10+
}
11+
}

Diff for: packages/@aws-cdk/aws-cloud9/README.md

+21-12
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,23 @@
2323

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

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

2835

2936
## Creating EC2 Environment
3037

31-
EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment in the private subnet, specify `subnetSelection` with private `subnetType`.
38+
EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment in the private subnet, specify
39+
`subnetSelection` with private `subnetType`.
3240

3341

3442
```ts
35-
import * as cloud9 from '@aws-cdk/aws-cloud9';
36-
3743
// create a cloud9 ec2 environment in a new VPC
3844
const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3});
3945
new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc });
@@ -42,36 +48,39 @@ new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc });
4248
const defaultVpc = ec2.Vpc.fromLookup(this, 'DefaultVPC', { isDefault: true });
4349
new cloud9.Ec2Environment(this, 'Cloud9Env2', {
4450
vpc: defaultVpc,
45-
instanceType: new ec2.InstanceType('t3.large')
51+
instanceType: new ec2.InstanceType('t3.large'),
4652
});
4753

4854
// or specify in a different subnetSelection
4955
const c9env = new cloud9.Ec2Environment(this, 'Cloud9Env3', {
50-
vpc,
51-
subnetSelection: {
52-
subnetType: ec2.SubnetType.PRIVATE
53-
}
56+
vpc,
57+
subnetSelection: {
58+
subnetType: ec2.SubnetType.PRIVATE,
59+
},
5460
});
5561

5662
// print the Cloud9 IDE URL in the output
57-
new cdk.CfnOutput(this, 'URL', { value: c9env.ideUrl });
63+
new CfnOutput(this, 'URL', { value: c9env.ideUrl });
5864
```
5965

6066
## Cloning Repositories
6167

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

6470
```ts
71+
import * as codecommit from '@aws-cdk/aws-codecommit';
72+
6573
// create a codecommit repository to clone into the cloud9 environment
6674
const repoNew = new codecommit.Repository(this, 'RepoNew', {
6775
repositoryName: 'new-repo',
6876
});
6977

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

7381
// create a new Cloud9 environment and clone the two repositories
74-
new cloud9.Ec2Environment(stack, 'C9Env', {
82+
declare const vpc: ec2.Vpc;
83+
new cloud9.Ec2Environment(this, 'C9Env', {
7584
vpc,
7685
clonedRepositories: [
7786
cloud9.CloneRepository.fromCodeCommit(repoNew, '/src/new-repo'),

Diff for: packages/@aws-cdk/aws-cloud9/package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
]
2929
}
3030
},
31-
"projectReferences": true
31+
"projectReferences": true,
32+
"metadata": {
33+
"jsii": {
34+
"rosetta": {
35+
"strict": true
36+
}
37+
}
38+
}
3239
},
3340
"repository": {
3441
"type": "git",
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Fixture with packages imported, but nothing else
2+
import { CfnOutput, Stack } from '@aws-cdk/core';
3+
import { Construct } from 'constructs';
4+
import * as cloud9 from '@aws-cdk/aws-cloud9';
5+
import * as ec2 from '@aws-cdk/aws-ec2';
6+
7+
class Fixture extends Stack {
8+
constructor(scope: Construct, id: string) {
9+
super(scope, id);
10+
/// here
11+
}
12+
}

Diff for: packages/@aws-cdk/aws-codeguruprofiler/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Amazon CodeGuru Profiler collects runtime performance data from your live applic
1717

1818
Import to your project:
1919

20-
```ts
20+
```ts nofixture
2121
import * as codeguruprofiler from '@aws-cdk/aws-codeguruprofiler';
2222
```
2323

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

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

34-
const profilingGroup = new ProfilingGroup(stack, 'MyProfilingGroup');
34+
const profilingGroup = new codeguruprofiler.ProfilingGroup(this, 'MyProfilingGroup');
3535
profilingGroup.grantPublish(publishAppRole);
3636
```
3737

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

4343
```ts
44-
const profilingGroup = new ProfilingGroup(stack, 'MyProfilingGroup', {
45-
computePlatform: ComputePlatform.AWS_LAMBDA,
44+
const profilingGroup = new codeguruprofiler.ProfilingGroup(this, 'MyProfilingGroup', {
45+
computePlatform: codeguruprofiler.ComputePlatform.AWS_LAMBDA,
4646
});
4747
```

Diff for: packages/@aws-cdk/aws-codeguruprofiler/package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@
2828
]
2929
}
3030
},
31-
"projectReferences": true
31+
"projectReferences": true,
32+
"metadata": {
33+
"jsii": {
34+
"rosetta": {
35+
"strict": true
36+
}
37+
}
38+
}
3239
},
3340
"repository": {
3441
"type": "git",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Fixture with packages imported, but nothing else
2+
import { Stack } from '@aws-cdk/core';
3+
import { Construct } from 'constructs';
4+
import * as codeguruprofiler from '@aws-cdk/aws-codeguruprofiler';
5+
import * as iam from '@aws-cdk/aws-iam';
6+
7+
class Fixture extends Stack {
8+
constructor(scope: Construct, id: string) {
9+
super(scope, id);
10+
/// here
11+
}
12+
}

0 commit comments

Comments
 (0)