Skip to content

Commit e024835

Browse files
authored
Remove JavaScript examples from documentation (#16518)
1 parent ce999eb commit e024835

File tree

25 files changed

+53
-758
lines changed

25 files changed

+53
-758
lines changed

content/docs/iac/automation-api/_index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ To learn how to use Automation API, see [Getting Started with Automation API](/d
3535

3636
The following examples demonstrate how to use Automation API in various use cases.
3737

38-
{{< chooser language "typescript,javascript,python,go,csharp,java" >}}
38+
{{< chooser language "typescript,python,go,csharp,java" >}}
3939

4040
{{% choosable language typescript %}}
4141

@@ -48,11 +48,7 @@ The following examples demonstrate how to use Automation API in various use case
4848
* [Remote Deployment - ts-node](https://github.com/pulumi/automation-api-examples/blob/main/nodejs/remoteDeployment-tsnode)
4949

5050
{{% /choosable %}}
51-
{{% choosable language javascript %}}
5251

53-
* [Inline Program](https://github.com/pulumi/automation-api-examples/blob/main/nodejs/inlineProgram-js)
54-
55-
{{% /choosable %}}
5652
{{% choosable language python %}}
5753

5854
* [Inline Program](https://github.com/pulumi/automation-api-examples/blob/main/python/inline_program)

content/docs/iac/automation-api/getting-started-automation-api.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Install the required language runtime, if you have not already.
3333

3434
#### Choose your language
3535

36-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
36+
{{< chooser language "typescript,python,go,csharp,java" >}}
3737

38-
{{% choosable language "javascript,typescript" %}}
38+
{{% choosable language "typescript" %}}
3939
{{< install-node >}}
4040
{{% /choosable %}}
4141

@@ -62,11 +62,11 @@ You'll need a [Pulumi access token](/docs/pulumi-cloud/accounts#access-tokens) s
6262

6363
## Define your Pulumi program
6464

65-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
65+
{{< chooser language "typescript,python,go,csharp,java" >}}
6666

6767
First, define the Pulumi program you want to run as a function within your overall program. Note how it looks like a standard Pulumi program.
6868

69-
{{% choosable language "javascript,typescript" %}}
69+
{{% choosable language "typescript" %}}
7070

7171
{{% notes type="info" %}}
7272
This tutorial is based on the [`inlineProgram-ts` example](https://github.com/pulumi/automation-api-examples/tree/main/nodejs/inlineProgram-ts), which is a complete example of how to construct a simple Automation API program.
@@ -401,9 +401,9 @@ As with executing Pulumi programs through the CLI, you need to associate your Pu
401401

402402
Here's a convenient method to select an existing `Stack` or create one if none exists:
403403

404-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
404+
{{< chooser language "typescript,python,go,csharp,java" >}}
405405

406-
{{% choosable language "javascript,typescript" %}}
406+
{{% choosable language "typescript" %}}
407407

408408
```typescript
409409
const args: InlineProgramArgs = {
@@ -469,8 +469,8 @@ A `Stack` object operates within the context of a `Workspace`. A `Workspace` is
469469

470470
The AWS plugin also needs configuration. You can provide that configuration just as you would with other Pulumi programs: either through [stack configuration](/docs/concepts/config/) or environment variables. In this tutorial, you'll use the `Stack` object to set the AWS region for the AWS provider plugin.
471471

472-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
473-
{{% choosable language "javascript,typescript" %}}
472+
{{< chooser language "typescript,python,go,csharp,java" >}}
473+
{{% choosable language "typescript" %}}
474474

475475
```typescript
476476
await stack.workspace.installPlugin("aws", "v4.0.0");
@@ -527,8 +527,8 @@ stack.setConfig("aws:region", new ConfigValue("us-west-2"));
527527
You're now ready to execute commands against the `Stack`, including update, preview, refresh, destroy, import, and export.
528528
If you want to update the stack, invoke the update method (`up`) against the `Stack` object:
529529

530-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
531-
{{% choosable language "javascript,typescript" %}}
530+
{{< chooser language "typescript,python,go,csharp,java" >}}
531+
{{% choosable language "typescript" %}}
532532

533533
```typescript
534534
const upRes = await stack.up({ onOutput: console.info });

content/docs/iac/concepts/resources/options/hidediffs.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,8 @@ This is useful when working with properties that generate large or verbose diffs
2828

2929
## Example usage
3030

31-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
32-
33-
{{% choosable language javascript %}}
34-
35-
```javascript
36-
let res = new MyResource("res",
37-
{ prop: "new-value" }, { hideDiffs: ["prop"] });
38-
```
31+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
3932

40-
{{% /choosable %}}
4133
{{% choosable language typescript %}}
4234

4335
```typescript

content/docs/iac/get-started/aws/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Complete this step-by-step tutorial to deploy an AWS S3 bucket-based website usi
2727

2828
First, choose your language and ensure you've performed any prerequisites:
2929

30-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" / >}}
30+
{{< chooser language "typescript,python,go,csharp,java,yaml" / >}}
3131

32-
{{% choosable language "typescript,javascript" %}}
32+
{{% choosable language "typescript" %}}
3333

3434
* An <a href="https://aws.amazon.com/free" target=_blank>AWS account</a>
3535
* <a href="https://nodejs.org/en/download" target=_blank>Node.js</a> and <a href="https://www.npmjs.com/package/npm" target=_blank>npm</a> installed locally

content/docs/iac/get-started/aws/create-component.md

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ complexity and enable sharing and reuse. Instead of copy-pasting common patterns
2222
You will now create your first component that packages up your S3 website so you can easily stamp out
2323
entire websites in just a few lines of code:
2424

25-
{{% choosable language javascript %}}
26-
27-
```javascript
28-
const website = new AwsS3Website("my-website", {
29-
files: [ "index.html" ],
30-
});
31-
```
32-
33-
{{% /choosable %}}
34-
3525
{{% choosable language typescript %}}
3626

3727
```typescript
@@ -104,32 +94,6 @@ component -- the `files` to add to the website -- and outputs -- a single proper
10494

10595
To get going, create a new file {{< compfile >}} alongside {{< langfile >}} and add the following:
10696

107-
{{% choosable language javascript %}}
108-
109-
```javascript
110-
"use strict";
111-
const aws = require("@pulumi/aws");
112-
const pulumi = require("@pulumi/pulumi");
113-
114-
// A component that encapsulates creating an AWS S3 hosted static website.
115-
export class AwsS3Website extends pulumi.ComponentResource {
116-
constructor(name, args, opts) {
117-
super("quickstart:index:AwsS3Website", name, args, opts);
118-
119-
// Component initialization will go here next...
120-
121-
this.registerOutputs({}); // Signal component completion.
122-
}
123-
}
124-
125-
module.exports = {
126-
AWSS3Website,
127-
AWSS3WebsiteArgs,
128-
};
129-
```
130-
131-
{{% /choosable %}}
132-
13397
{{% choosable language typescript %}}
13498

13599
```typescript
@@ -296,73 +260,6 @@ Next, make four changes:
296260
The resulting {{< compfile >}} file will look like this; feel free to make each edit one at a time if you'd like
297261
to get a feel for things, or simply paste the contents of this into {{< compfile >}}:
298262

299-
{{% choosable language javascript %}}
300-
301-
```javascript
302-
"use strict";
303-
const pulumi = require("@pulumi/pulumi");
304-
const aws = require("@pulumi/aws");
305-
306-
// A component that encapsulates creating an AWS S3 hosted static website.
307-
class AwsS3Website extends pulumi.ComponentResource {
308-
constructor(name, args, opts) {
309-
super("quickstart:index:AwsS3Website", name, args, opts);
310-
311-
// Create an AWS resource (S3 Bucket)
312-
const bucket = new aws.s3.Bucket("my-bucket", {}, {
313-
// Set the parent to the component (step #2) above.
314-
// Also, do the same for all other resources below.
315-
parent: this,
316-
});
317-
318-
// Turn the bucket into a website:
319-
const website = new aws.s3.BucketWebsiteConfiguration("website", {
320-
bucket: bucket.id,
321-
indexDocument: {
322-
suffix: "index.html",
323-
},
324-
}, { parent: this });
325-
326-
// Permit access control configuration:
327-
const ownershipControls = new aws.s3.BucketOwnershipControls("ownership-controls", {
328-
bucket: bucket.id,
329-
rule: {
330-
objectOwnership: "ObjectWriter"
331-
}
332-
}, { parent: this });
333-
334-
// Enable public access to the website:
335-
const publicAccessBlock = new aws.s3.BucketPublicAccessBlock("public-access-block", {
336-
bucket: bucket.id,
337-
blockPublicAcls: false,
338-
}, { parent: this });
339-
340-
// Create an S3 Bucket object for each file; note the changes to name/source:
341-
for (const file of args.files) {
342-
new aws.s3.BucketObject(file, {
343-
bucket: bucket.id,
344-
source: new pulumi.asset.FileAsset(file),
345-
contentType: "text/html",
346-
acl: "public-read",
347-
}, {
348-
dependsOn: [ownershipControls, publicAccessBlock],
349-
parent: this,
350-
});
351-
}
352-
353-
// Capture the URL and make it available as a component property and output:
354-
this.url = pulumi.interpolate`http://${website.websiteEndpoint}`;
355-
this.registerOutputs({ url: this.url }) // Signal component completion.
356-
}
357-
}
358-
359-
module.exports = {
360-
AWSS3Website,
361-
};
362-
```
363-
364-
{{% /choosable %}}
365-
366263
{{% choosable language typescript %}}
367264

368265
```typescript
@@ -786,23 +683,6 @@ Ensure the file is empty and we will build it back up by simply importing and in
786683

787684
Add this to your now-empty {{< langfile >}}:
788685

789-
{{% choosable language javascript %}}
790-
791-
```javascript
792-
"use strict";
793-
// Import from our new component module:
794-
const web = require("./website");
795-
796-
// Create an instance of our component with the same files as before:
797-
const website = new web.AwsS3Website("my-website", {
798-
files: [ "index.html" ],
799-
});
800-
801-
exports.url = website.url;
802-
```
803-
804-
{{% /choosable %}}
805-
806686
{{% choosable language typescript %}}
807687

808688
```typescript

content/docs/iac/get-started/aws/create-project.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,6 @@ $ cd pulumi-start-aws
5959

6060
Now initialize a new Pulumi project for AWS using the `pulumi new` command:
6161

62-
{{% choosable language javascript %}}
63-
64-
{{% choosable os "linux,macos" %}}
65-
66-
```bash
67-
$ pulumi new aws-javascript
68-
```
69-
70-
{{% /choosable %}}
71-
{{% choosable os "windows" %}}
72-
73-
```powershell
74-
> pulumi new aws-javascript
75-
```
76-
77-
{{% /choosable %}}
78-
79-
{{% /choosable %}}
8062
{{% choosable language typescript %}}
8163

8264
{{% choosable os "linux,macos" %}}
@@ -199,7 +181,7 @@ The AWS region to deploy into (aws:region) (us-east-1): us-west-2
199181

200182
{{< cli-note >}}
201183

202-
{{% choosable language "javascript,typescript" %}}
184+
{{% choosable language "typescript" %}}
203185

204186
After some dependency installations from `npm`, the project and stack will be ready.
205187

@@ -233,7 +215,7 @@ If you list the contents of your directory, you'll see some key files:
233215

234216
{{% /choosable %}}
235217

236-
{{% choosable language "javascript,typescript,python,go,csharp,java" %}}
218+
{{% choosable language "typescript,python,go,csharp,java" %}}
237219

238220
- <span>{{< langfile >}}</span> contains your project's main code that declares a new S3 bucket
239221
- `Pulumi.yaml` is a [project file](/docs/iac/concepts/projects/project-file) containing metadata about your project like its name
@@ -249,23 +231,6 @@ If you list the contents of your directory, you'll see some key files:
249231

250232
Now examine the code in {{< langfile >}}:
251233

252-
{{% choosable language javascript %}}
253-
254-
```javascript
255-
"use strict";
256-
const pulumi = require("@pulumi/pulumi");
257-
const aws = require("@pulumi/aws");
258-
const awsx = require("@pulumi/awsx");
259-
260-
// Create an AWS resource (S3 Bucket)
261-
const bucket = new aws.s3.Bucket("my-bucket");
262-
263-
// Export the name of the bucket
264-
exports.bucketName = bucket.id;
265-
```
266-
267-
{{% /choosable %}}
268-
269234
{{% choosable language typescript %}}
270235

271236
```typescript

content/docs/iac/get-started/aws/deploy-stack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ the contents of your new bucket -- which of course will be empty:
8989

9090
{{% choosable os "linux,macos" %}}
9191

92-
{{% choosable language "javascript,typescript,go,csharp,java,yaml" %}}
92+
{{% choosable language "typescript,go,csharp,java,yaml" %}}
9393

9494
```bash
9595
$ aws s3 ls s3://$(pulumi stack output bucketName)
@@ -109,7 +109,7 @@ $ aws s3 ls s3://$(pulumi stack output bucket_name)
109109

110110
{{% choosable os "windows" %}}
111111

112-
{{% choosable language "javascript,typescript,go,csharp,java,yaml" %}}
112+
{{% choosable language "typescript,go,csharp,java,yaml" %}}
113113

114114
```powershell
115115
$ aws s3 ls ("s3://" + (pulumi stack output bucketName))

content/docs/iac/get-started/aws/modify-program.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ To turn your bucket into a static website, start by adding three new AWS S3 reso
3737

3838
Open up {{< langfile >}} in your editor and add them right after your S3 bucket:
3939

40-
{{% choosable language "javascript,typescript" %}}
40+
{{% choosable language "typescript" %}}
4141

4242
```typescript
4343
// Bucket...
@@ -271,7 +271,7 @@ Next, add a new file called `index.html` to your current directory with these co
271271

272272
Then open {{< langfile >}} and create a [`BucketObject`](/registry/packages/aws/api-docs/s3/bucketobject/) after the three other new resources:
273273

274-
{{% choosable language "javascript,typescript" %}}
274+
{{% choosable language "typescript" %}}
275275

276276
```typescript
277277
// Other resources ...
@@ -406,15 +406,6 @@ automatically but these ones are invisible to Pulumi because those specific reso
406406

407407
Now to export the website's URL for easy access add this to the end of your program:
408408

409-
{{% choosable language javascript %}}
410-
411-
```javascript
412-
// Export the bucket's autoassigned URL:
413-
exports.url = pulumi.interpolate`http://${website.websiteEndpoint}`;
414-
```
415-
416-
{{% /choosable %}}
417-
418409
{{% choosable language typescript %}}
419410

420411
```typescript

content/docs/iac/get-started/azure/review-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ aliases:
1818

1919
Let's review some of the generated project files:
2020

21-
{{% choosable language "javascript,typescript,python,go,csharp,java" %}}
21+
{{% choosable language "typescript,python,go,csharp,java" %}}
2222

2323
- `Pulumi.yaml` defines the [project](/docs/concepts/projects/).
2424

@@ -44,7 +44,7 @@ Let's review some of the generated project files:
4444

4545
{{% /choosable %}}
4646

47-
{{% choosable language "javascript,typescript,go,csharp,java" %}}
47+
{{% choosable language "typescript,go,csharp,java" %}}
4848

4949
- <span>{{< langfile >}}</span> is the Pulumi program that defines your stack resources.
5050

0 commit comments

Comments
 (0)