Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorials #5139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ directory, replacing `{YOUR_STACK_PATH/assume-role-create}` with the full name o

```bash
$ cd assume-role
$ npm install
$ pulumi install
$ export AWS_ACCESS_KEY_ID="$(pulumi stack output --stack {YOUR_STACK_PATH/assume-role-create} accessKeyId)"
$ export AWS_SECRET_ACCESS_KEY="$(pulumi stack output --stack {YOUR_STACK_PATH/assume-role-create} --show-secrets secretAccessKey)"
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am
Previewing update (dev):
Type Name Plan
+ pulumi:pulumi:Stack aws-cs-s3-folder-dev create
+ └─ aws:s3:Bucket my-bucket create
+ └─ aws:s3:BucketV2 my-bucket create
+ ├─ aws:s3:BucketObject index.html create
+ └─ aws:s3:BucketObject favicon.png create

Expand All @@ -58,7 +58,7 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am
Updating (dev):
Type Name Status
+ pulumi:pulumi:Stack aws-cs-s3-folder-dev created
+ └─ aws:s3:Bucket my-bucket created
+ └─ aws:s3:BucketV2 my-bucket created
+ ├─ aws:s3:BucketObject index.html created
+ └─ aws:s3:BucketObject favicon.png created

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am
Previewing update (dev):
Type Name Plan
+ pulumi:pulumi:Stack aws-cs-s3-folder-dev create
+ └─ aws:s3:Bucket my-bucket create
+ └─ aws:s3:BucketV2 my-bucket create
+ ├─ aws:s3:BucketObject index.html create
+ └─ aws:s3:BucketObject favicon.png create

Expand All @@ -58,7 +58,7 @@ A static website that uses [S3's website support](https://docs.aws.amazon.com/Am
Updating (dev):
Type Name Status
+ pulumi:pulumi:Stack aws-cs-s3-folder-dev created
+ └─ aws:s3:Bucket my-bucket created
+ └─ aws:s3:BucketV2 my-bucket created
+ ├─ aws:s3:BucketObject index.html created
+ └─ aws:s3:BucketObject favicon.png created

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ with `***`.
Type Name Status
+ pulumi:pulumi:Stack aws-go-s3-folder-component-website-component-testing created
+ └─ pulumi:example:S3Folder pulumi-static-site created
+ ├─ aws:s3:Bucket pulumi-static-site created
+ ├─ aws:s3:BucketV2 pulumi-static-site created
+ ├─ aws:s3:BucketPolicy bucketPolicy created
+ ├─ aws:s3:BucketObject index.html created
+ └─ aws:s3:BucketObject favicon.png created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ For a detailed walkthrough of this example, see the tutorial [Static Website on

#: Resource Type Name Status Extra Inf
1: pulumi:pulumi:Stack website-testing + created
2: aws:s3:Bucket s3-website-bucket + created
2: aws:s3:BucketV2 s3-website-bucket + created
3: aws:s3:BucketPolicy bucketPolicy + created
4: aws:s3:BucketObject favicon.png + created
5: aws:s3:BucketObject index.html + created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ with `***`.
Type Name Status Info
+ pulumi:pulumi:Stack aws-js-s3-folder-component-website-component-testing created
+ └─ examples:S3Folder pulumi-static-site created
+ ├─ aws:s3:Bucket pulumi-static-site created
+ ├─ aws:s3:BucketV2 pulumi-static-site created
+ ├─ aws:s3:BucketPolicy bucketPolicy created
+ ├─ aws:s3:BucketObject favicon.png created
+ └─ aws:s3:BucketObject index.html created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ with `***`.
Performing changes:

Type Name Status Info
+ pulumi:pulumi:Stack aws-js-s3-folder-website-testing created
+ ├─ aws:s3:Bucket s3-website-bucket created
+ pulumi:pulumi:Stack aws-js-s3-folder-website-testing. created
+ ├─ aws:s3:BucketV2 s3-website-bucket created
+ ├─ aws:s3:BucketPolicy bucketPolicy created
+ ├─ aws:s3:BucketObject favicon.png created
+ └─ aws:s3:BucketObject index.html created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ with `***`.

Type Name Plan
+ pulumi:pulumi:Stack aws-py-s3-folder-dev create
+ ├─ aws:s3:Bucket s3-website-bucket create
+ ├─ aws:s3:BucketV2 s3-website-bucket create
+ ├─ aws:s3:BucketObject index.html create
+ ├─ aws:s3:BucketObject python.png create
+ ├─ aws:s3:BucketObject favicon.png create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ with `***`.
Type Name Plan
+ pulumi:pulumi:Stack static-website-example create
+ ├─ pulumi:providers:aws east create
+ ├─ aws:s3:Bucket requestLogs create
+ ├─ aws:s3:Bucket contentBucket create
+ ├─ aws:s3:BucketV2 requestLogs create
+ ├─ aws:s3:BucketV2 contentBucket create
+ │ ├─ aws:s3:BucketObject 404.html create
+ │ └─ aws:s3:BucketObject index.html create
+ ├─ aws:acm:Certificate certificate create
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: "AWS Lambda for Slack Notification | TypeScript"
h1: "AWS Lambda for Slack Notification"
linktitle: "AWS Lambda for Slack Notification"
meta_desc: "AWS Lambda for Slack Notification How-to Guide using TypeScript"
no_edit_this_page: true
cloud: aws
language: ts
layout: package
---

<!-- WARNING: this page was generated by a tool. Do not edit it by hand. -->
<!-- To change it, please see https://github.com/pulumi/registry/tree/master/tools/mktutorial. -->

<p class="mb-4 inline-flex items-center">
<a class="rounded-md font-display text-lg text-white bg-white border-2 border-blue-600 px-3 mr-2 whitespace-no-wrap hover:text-white" style="height: 45px; line-height: 41px;" href="https://github.com/pulumi/examples/tree/master/aws-ts-lambda-slack" target="_blank">
<span class="flex items-center">
<i class="fab fa-github pr-1.5"></i>
<span>View Code</span>
</span>
</a>
</p>


A Pulumi example to:

- Creates an AWS Lambda function to post a message on Slack via a Webhook URL.
- Adds an AWS API Gateway so the Lambda can be invoked externally, e.g, via GitHub Webhooks.
- Uses a Pulumi ESC Environment to dynamically retrieve AWS OIDC Credentials and the Slack URL from AWS Secrets Manager.

Last update: September 2024

## 📋 Pre-requisites

- AWS OIDC configured in an Pulumi ESC Environment
- AWS Secrets Manager with a Slack Webhook URL secret
- A properly configured Slack Webhook URL
- [Pulumi CLI](https://www.pulumi.com/docs/get-started/install/)
- [Pulumi Cloud account](https://app.pulumi.com/signup)
- [npm](https://www.npmjs.com/get-npm)

## 👩‍🏫 Get started

This Pulumi example is written as a template. It is meant to be copied via `pulumi new`

```bash
# login to your Pulumi Cloud if you haven't already
$ pulumi login

# create a new dir and cd to it
$ mkdir my-slack-demo
$ cd my-slack-demo

# start your pulumi project
$ pulumi new https://github.com/pulumi/examples/aws-ts-lambda-slack
```

```bash
# Add your Pulumi ESC Environment
$ pulumi config env add YOUR_ESC_ENV --yes --non-interactive
$ pulumi up
# select 'yes' to confirm the expected changes
# 🎉 Ta-Da!
```

## 🧹 Clean up

To clean up your infrastructure, run:

```bash
$ pulumi destroy
# select 'yes' to confirm the expected changes
```

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ layout: package
A Pulumi template to:

- Create AWS resources for AWS OIDC (IdP + Role)
- Create a new Pulumi Cloud ESC Environment (optional)
- Create a new Pulumi Cloud ESC Environment

Last update: June 2024
Last update: September 2024

## 📋 Pre-requisites

Expand All @@ -54,7 +54,7 @@ Once copied to your machine, feel free to edit as needed.

## 🎬 How to run

Note that this templates contains a default value which contains a valid AWS OIDC thumbprint as of June 2024. If this thumbprint becomes invalid, obtain a new OIDC thumbprint. For more information, see [Obtain the thumbprint for an OpenID Connect identity provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc_verify-thumbprint.html) in the AWS docs.
This template will pick up the thumbprint from the URL that you set in the stack configuration. By default it will use the OIDC IDP URL for Pulumi Cloud.

To deploy your infrastructure, run:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ with `***`.
Performing changes:

Type Name Status Info
+ pulumi:pulumi:Stack aws-js-s3-folder-website-testing created
+ ├─ aws:s3:Bucket s3-website-bucket created
+ pulumi:pulumi:Stack aws-js-s3-folder-website-testing created
+ ├─ aws:s3:BucketV2 s3-website-bucket created
+ ├─ aws:s3:BucketPolicy bucketPolicy created
+ ├─ aws:s3:BucketObject favicon.png created
+ └─ aws:s3:BucketObject index.html created
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Host a Static Website on Amazon S3 with the AWS Cloud Control Provider | YAML"
h1: "Host a Static Website on Amazon S3 with the AWS Cloud Control Provider"
linktitle: "Host a Static Website on Amazon S3 with the AWS Cloud Control Provider"
meta_desc: "Host a Static Website on Amazon S3 with the AWS Cloud Control Provider How-to Guide using YAML"
title: "Host a Static Website on Amazon S3 with the AWS Native Provider | YAML"
h1: "Host a Static Website on Amazon S3 with the AWS Native Provider"
linktitle: "Host a Static Website on Amazon S3 with the AWS Native Provider"
meta_desc: "Host a Static Website on Amazon S3 with the AWS Native Provider How-to Guide using YAML"
no_edit_this_page: true
cloud: aws
language: yaml
Expand All @@ -28,8 +28,9 @@ layout: package
A static website that uses [S3's website support](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html).
For a detailed walkthrough of this example, see the tutorial [Static Website on AWS S3](https://www.pulumi.com/docs/tutorials/aws/s3-website/).

Note: Some resources are not yet supported by the AWS Cloud Control provider, so we are also using
the standard AWS provider for additional resources in this example.
Note: Some resources are not yet supported by the Native AWS provider, so we are using both the Native
and Classic provider in this example. The resources will be updated to use native resources as they are
available in AWS's Cloud Control API.

## Deploying and running the program

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,42 @@ To deploy your infrastructure, follow the below steps.

### Publish Bot Steps

1. Within the **/bot** subfolder, publish the bot to subfolder called publish:
1. Within the **/bot** subfolder, publish the bot to subfolder called publish:

```bash
$ dotnet publish -o publish
dotnet publish -o publish
```

### Pulumi Steps

1. Within the **azure-cs-botservice** folder, create a new stack:
1. Within the **azure-cs-botservice** folder, create a new stack:

```bash
$ pulumi stack init dev
pulumi stack init dev
```

2. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
1. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):

```bash
$ az login
az login
```

3. Configure the location to deploy the resources to:
1. Configure the location to deploy the resources to:

```bash
$ pulumi config set azure:location "North Europe"
pulumi config set azure:location "North Europe"
pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
```

4. Configure the Bot Name:
1. Configure the Bot Name:

```bash
$ pulumi config set botName PulumiBot1
pulumi config set botName PulumiBot1
```

5. Run `pulumi up` to preview and deploy changes:
1. Run `pulumi up` to preview and deploy changes:

```bash
```console
$ pulumi up
Previewing changes:
...
Expand All @@ -89,21 +90,21 @@ To deploy your infrastructure, follow the below steps.
Update duration: 1m22s
```

6. Check the deployed bot using either:
1. Check the deployed bot using either:

* Azure Portal Azure Bot Service - [Test in Webchat feature](https://docs.microsoft.com/en-us/azure/bot-service/abs-quickstart?view=azure-bot-service-4.0#test-the-bot)
* [Bot Framework Emulator](https://github.com/Microsoft/BotFramework-Emulator) pointing to the output bot endpoint and Microsoft Application Id and the secret you supplied:
* Azure Portal Azure Bot Service - [Test in Webchat feature](https://docs.microsoft.com/en-us/azure/bot-service/abs-quickstart?view=azure-bot-service-4.0#test-the-bot)
* [Bot Framework Emulator](https://github.com/Microsoft/BotFramework-Emulator) pointing to the output bot endpoint and Microsoft Application Id and the secret you supplied:

```bash
$ BotEndpoint: "https://app8asdf.azurewebsites.net/api/messages"
$ MicrosoftAppId: "b5e65403-923c-4568-z2f6-a6f41b258azz"
$ MicrosoftAppPassword: "<secret>"
```
```yaml
BotEndpoint: "https://app8asdf.azurewebsites.net/api/messages"
MicrosoftAppId: "b5e65403-923c-4568-z2f6-a6f41b258azz"
MicrosoftAppPassword: "<secret>"
```

7. Once you've finished, you can tear down your stack's resources by destroying and removing it:
1. Once you've finished, you can tear down your stack's resources by destroying and removing it:

```bash
$ pulumi destroy -y
$ pulumi stack rm -y
pulumi destroy -y
pulumi stack rm -y
```

Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,34 @@ To deploy your infrastructure, follow the below steps.

### Steps

1. Create a new stack:
1. Create a new stack:

```
$ pulumi stack init dev
```bash
pulumi stack init dev
```

1. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
1. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):

```
$ az login
```bash
az login
```

1. Build and publish the ASP.NET Core project:
1. Build and publish the ASP.NET Core project:

```
$ dotnet publish webapp
```bash
dotnet publish webapp
```

1. Set an appropriate Azure location like:

```
$ pulumi config set azure:location westus
```bash
pulumi config set azure:location westus
pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
```

1. Run `pulumi up` to preview and deploy changes:
1. Run `pulumi up` to preview and deploy changes:

```
```console
$ pulumi up
Previewing changes:
...
Expand All @@ -86,9 +87,9 @@ To deploy your infrastructure, follow the below steps.
Update duration: 4m16s
```

1. Check the deployed website endpoint:
1. Check the deployed website endpoint:

```
```console
$ pulumi stack output Endpoint
https://app129968b8.azurewebsites.net/
$ curl "$(pulumi stack output Endpoint)"
Expand All @@ -100,7 +101,7 @@ To deploy your infrastructure, follow the below steps.
1. Once you've finished experimenting, tear down your stack's resources by destroying and removing it:

```bash
$ pulumi destroy --yes
$ pulumi stack rm --yes
pulumi destroy --yes
pulumi stack rm --yes
```

Loading
Loading