Skip to content

Commit

Permalink
Update tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
pulumi-bot committed Oct 7, 2024
1 parent cacd6a9 commit 2c32ff3
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 24 deletions.
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

0 comments on commit 2c32ff3

Please sign in to comment.