Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions content/docs/iac/automation-api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To learn how to use Automation API, see [Getting Started with Automation API](/d

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

{{< chooser language "typescript,javascript,python,go,csharp,java" >}}
{{< chooser language "typescript,python,go,csharp,java" >}}

{{% choosable language typescript %}}

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

{{% /choosable %}}
{{% choosable language javascript %}}

* [Inline Program](https://github.com/pulumi/automation-api-examples/blob/main/nodejs/inlineProgram-js)

{{% /choosable %}}
{{% choosable language python %}}

* [Inline Program](https://github.com/pulumi/automation-api-examples/blob/main/python/inline_program)
Expand Down
20 changes: 10 additions & 10 deletions content/docs/iac/automation-api/getting-started-automation-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Install the required language runtime, if you have not already.

#### Choose your language

{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
{{< chooser language "typescript,python,go,csharp,java" >}}

{{% choosable language "javascript,typescript" %}}
{{% choosable language "typescript" %}}
{{< install-node >}}
{{% /choosable %}}

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

## Define your Pulumi program

{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
{{< chooser language "typescript,python,go,csharp,java" >}}

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.

{{% choosable language "javascript,typescript" %}}
{{% choosable language "typescript" %}}

{{% notes type="info" %}}
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.
Expand Down Expand Up @@ -401,9 +401,9 @@ As with executing Pulumi programs through the CLI, you need to associate your Pu

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

{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
{{< chooser language "typescript,python,go,csharp,java" >}}

{{% choosable language "javascript,typescript" %}}
{{% choosable language "typescript" %}}

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

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.

{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
{{% choosable language "javascript,typescript" %}}
{{< chooser language "typescript,python,go,csharp,java" >}}
{{% choosable language "typescript" %}}

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

{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
{{% choosable language "javascript,typescript" %}}
{{< chooser language "typescript,python,go,csharp,java" >}}
{{% choosable language "typescript" %}}

```typescript
const upRes = await stack.up({ onOutput: console.info });
Expand Down
10 changes: 1 addition & 9 deletions content/docs/iac/concepts/resources/options/hidediffs.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,8 @@ This is useful when working with properties that generate large or verbose diffs

## Example usage

{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}

{{% choosable language javascript %}}

```javascript
let res = new MyResource("res",
{ prop: "new-value" }, { hideDiffs: ["prop"] });
```
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}

{{% /choosable %}}
{{% choosable language typescript %}}

```typescript
Expand Down
4 changes: 2 additions & 2 deletions content/docs/iac/get-started/aws/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Complete this step-by-step tutorial to deploy an AWS S3 bucket-based website usi

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

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

{{% choosable language "typescript,javascript" %}}
{{% choosable language "typescript" %}}

* An <a href="https://aws.amazon.com/free" target=_blank>AWS account</a>
* <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
Expand Down
120 changes: 0 additions & 120 deletions content/docs/iac/get-started/aws/create-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ complexity and enable sharing and reuse. Instead of copy-pasting common patterns
You will now create your first component that packages up your S3 website so you can easily stamp out
entire websites in just a few lines of code:

{{% choosable language javascript %}}

```javascript
const website = new AwsS3Website("my-website", {
files: [ "index.html" ],
});
```

{{% /choosable %}}

{{% choosable language typescript %}}

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

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

{{% choosable language javascript %}}

```javascript
"use strict";
const aws = require("@pulumi/aws");
const pulumi = require("@pulumi/pulumi");

// A component that encapsulates creating an AWS S3 hosted static website.
export class AwsS3Website extends pulumi.ComponentResource {
constructor(name, args, opts) {
super("quickstart:index:AwsS3Website", name, args, opts);

// Component initialization will go here next...

this.registerOutputs({}); // Signal component completion.
}
}

module.exports = {
AWSS3Website,
AWSS3WebsiteArgs,
};
```

{{% /choosable %}}

{{% choosable language typescript %}}

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

{{% choosable language javascript %}}

```javascript
"use strict";
const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");

// A component that encapsulates creating an AWS S3 hosted static website.
class AwsS3Website extends pulumi.ComponentResource {
constructor(name, args, opts) {
super("quickstart:index:AwsS3Website", name, args, opts);

// Create an AWS resource (S3 Bucket)
const bucket = new aws.s3.Bucket("my-bucket", {}, {
// Set the parent to the component (step #2) above.
// Also, do the same for all other resources below.
parent: this,
});

// Turn the bucket into a website:
const website = new aws.s3.BucketWebsiteConfiguration("website", {
bucket: bucket.id,
indexDocument: {
suffix: "index.html",
},
}, { parent: this });

// Permit access control configuration:
const ownershipControls = new aws.s3.BucketOwnershipControls("ownership-controls", {
bucket: bucket.id,
rule: {
objectOwnership: "ObjectWriter"
}
}, { parent: this });

// Enable public access to the website:
const publicAccessBlock = new aws.s3.BucketPublicAccessBlock("public-access-block", {
bucket: bucket.id,
blockPublicAcls: false,
}, { parent: this });

// Create an S3 Bucket object for each file; note the changes to name/source:
for (const file of args.files) {
new aws.s3.BucketObject(file, {
bucket: bucket.id,
source: new pulumi.asset.FileAsset(file),
contentType: "text/html",
acl: "public-read",
}, {
dependsOn: [ownershipControls, publicAccessBlock],
parent: this,
});
}

// Capture the URL and make it available as a component property and output:
this.url = pulumi.interpolate`http://${website.websiteEndpoint}`;
this.registerOutputs({ url: this.url }) // Signal component completion.
}
}

module.exports = {
AWSS3Website,
};
```

{{% /choosable %}}

{{% choosable language typescript %}}

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

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

{{% choosable language javascript %}}

```javascript
"use strict";
// Import from our new component module:
const web = require("./website");

// Create an instance of our component with the same files as before:
const website = new web.AwsS3Website("my-website", {
files: [ "index.html" ],
});

exports.url = website.url;
```

{{% /choosable %}}

{{% choosable language typescript %}}

```typescript
Expand Down
39 changes: 2 additions & 37 deletions content/docs/iac/get-started/aws/create-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,6 @@ $ cd pulumi-start-aws

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

{{% choosable language javascript %}}

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

```bash
$ pulumi new aws-javascript
```

{{% /choosable %}}
{{% choosable os "windows" %}}

```powershell
> pulumi new aws-javascript
```

{{% /choosable %}}

{{% /choosable %}}
{{% choosable language typescript %}}

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

{{< cli-note >}}

{{% choosable language "javascript,typescript" %}}
{{% choosable language "typescript" %}}

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

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

{{% /choosable %}}

{{% choosable language "javascript,typescript,python,go,csharp,java" %}}
{{% choosable language "typescript,python,go,csharp,java" %}}

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

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

{{% choosable language javascript %}}

```javascript
"use strict";
const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");

// Create an AWS resource (S3 Bucket)
const bucket = new aws.s3.Bucket("my-bucket");

// Export the name of the bucket
exports.bucketName = bucket.id;
```

{{% /choosable %}}

{{% choosable language typescript %}}

```typescript
Expand Down
4 changes: 2 additions & 2 deletions content/docs/iac/get-started/aws/deploy-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ the contents of your new bucket -- which of course will be empty:

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

{{% choosable language "javascript,typescript,go,csharp,java,yaml" %}}
{{% choosable language "typescript,go,csharp,java,yaml" %}}

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

{{% choosable os "windows" %}}

{{% choosable language "javascript,typescript,go,csharp,java,yaml" %}}
{{% choosable language "typescript,go,csharp,java,yaml" %}}

```powershell
$ aws s3 ls ("s3://" + (pulumi stack output bucketName))
Expand Down
13 changes: 2 additions & 11 deletions content/docs/iac/get-started/aws/modify-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To turn your bucket into a static website, start by adding three new AWS S3 reso

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

{{% choosable language "javascript,typescript" %}}
{{% choosable language "typescript" %}}

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

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

{{% choosable language "javascript,typescript" %}}
{{% choosable language "typescript" %}}

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

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

{{% choosable language javascript %}}

```javascript
// Export the bucket's autoassigned URL:
exports.url = pulumi.interpolate`http://${website.websiteEndpoint}`;
```

{{% /choosable %}}

{{% choosable language typescript %}}

```typescript
Expand Down
4 changes: 2 additions & 2 deletions content/docs/iac/get-started/azure/review-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ aliases:

Let's review some of the generated project files:

{{% choosable language "javascript,typescript,python,go,csharp,java" %}}
{{% choosable language "typescript,python,go,csharp,java" %}}

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

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

{{% /choosable %}}

{{% choosable language "javascript,typescript,go,csharp,java" %}}
{{% choosable language "typescript,go,csharp,java" %}}

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

Expand Down
Loading
Loading