Skip to content

Commit

Permalink
Remove docs pointing to the old pulumi-cloud project. (#13530)
Browse files Browse the repository at this point in the history
As part of our plan to [Sunset pulumi-cloud project](https://docs.google.com/document/d/1dS8SHjQjxVTxSVRpcjhQM657rRg7HpttqBXh4qQZq4k/edit?tab=t.0#heading=h.vmiybe9heukw)
we need to remove the olds docs for this project. 

I've removed both the "iac/clouds/aws/cloudfx/*" docs and the API reference that was in "static-prebuilt/docs/reference/pkg/nodejs/pulumi/cloud"

I adjusted a few places that the cloudfx docs pages were linked to just be links to the pulumi-cloud repo (which now has a warning about being archived) and removed the special case for this path from [infrastructure/cloudfrontLambdaAssociations.ts](https://github.com/pulumi/docs/compare/kill_pulumi_cloud?expand=1#diff-2b81c45bf2344533fee806b23c44b98d02e167ec781d524bd789fde9a2abec08)
  • Loading branch information
mjeffryes authored Dec 10, 2024
1 parent f5ba517 commit 8fb905e
Show file tree
Hide file tree
Showing 84 changed files with 8 additions and 2,881 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ We build and host language-specific SDK documentation for the following Pulumi p

* [pulumi](https://github.com/pulumi/pulumi)
* [pulumi-awsx](https://github.com/pulumi/pulumi-awsx)
* [pulumi-cloud](https://github.com/pulumi/pulumi-cloud)
* [pulumi-kubernetesx](https://github.com/pulumi/pulumi-kubernetesx)
* [pulumi-policy](https://github.com/pulumi/pulumi-policy)
* [pulumi-terraform](https://github.com/pulumi/pulumi-terraform)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ First, we're just defining two simple resources: 1) an `s3.Bucket`,
where we expect new video files to be uploaded to, and 2) a
`cloud.Topic` that will inform interested parties when new videos are
uploaded. (The full surface area of AWS is available in [the aws package](/docs/iac/get-started/aws/), and
[the cloud package](/docs/tutorials/cloudfx/) offers
[the cloud package](https://github.com/pulumi/pulumi-cloud) offers
multi-cloud abstractions that work at a higher level of abstraction.)
Right after defining the resources, we start creating our first FaaS
resources. `videoBucket` has an `onObjectCreated` event subscription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,6 @@ the cloud at runtime! That magic, along with powerful components like
the new HttpServer API can help make cloud applications dramatically
simpler to write and maintain. Happy coding!

You can dig in to [serverless coding with Pulumi here](/docs/tutorials/cloudfx/rest-api/),
You can dig in to [serverless coding with Pulumi here](https://github.com/pulumi/pulumi-cloud/),
and join us on Wednesday 3rd October at 11am PDT to hear more about
[serverless programming with Pulumi on our YouTube live stream](https://www.youtube.com/watch?v=k8ceyQuJiVM).
98 changes: 1 addition & 97 deletions content/docs/iac/clouds/aws/cloudfx/_index.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,3 @@
---
title_tag: "Pulumi Cloud Framework Overview"
title: "Cloud Framework"
meta_desc: "The Pulumi Cloud Framework lets you program infrastructure and application logic using high-level, cloud-agnostic building blocks.Get started here."
aliases:
- /docs/quickstart/cloudfx/
- /docs/tutorials/cloudfx
- /docs/clouds/aws/cloudfx/
redirect_to: /docs/iac/get-started/
---

<img src="/images/docs/quickstart/cloudfx-purple.png" align="right">

The Cloud Framework for Pulumi lets you program infrastructure and application logic, side by side, using simple, high-level, cloud-agnostic building blocks.

The Cloud Framework must be configured with credentials to deploy and update resources in the target cloud platform.

See the [full API documentation](/docs/reference/pkg/nodejs/pulumi/cloud/) for complete details of the available Cloud Framework APIs.

For AWS-specific use cases, see also the [awsx](/docs/reference/pkg/nodejs/pulumi/awsx/) library which provides higher-level libraries for working with many AWS services.

## Getting Started

The easiest way to start with the Cloud Framework is to follow one of the tutorials:

* [A simple serverless REST API](/docs/tutorials/cloudfx/rest-api/): Deploy cloud-agnostic managed REST API
* [A simple containerized app](/docs/tutorials/cloudfx/service/): Deploy cloud-agnostic containerized services
* [Serverless + Containers + Infrastructure](/docs/tutorials/cloudfx/thumbnailer): Deploy a complete cloud-agnostic application using a combination of buckets, serverless functions and containers.

In addition to the tutorials, several interesting examples are available with instructions:

* [HTTP API](https://github.com/pulumi/examples/tree/master/cloud-js-api)
* [Containers](https://github.com/pulumi/examples/tree/master/cloud-js-containers)
* [Thumbnailer (buckets, containers, functions)](https://github.com/pulumi/examples/tree/master/cloud-js-thumbnailer)
* [URL Shortener (table, API)](https://github.com/pulumi/examples/tree/master/cloud-ts-url-shortener)
* [Voting App (table, API)](https://github.com/pulumi/examples/tree/master/cloud-ts-voting-app)

## Example

```javascript
const cloud = require("@pulumi/cloud");
const api = new cloud.API("my-api");

api.get("/hello", (req, res) => {
res.json({ message: "Hi, world!" });
});

exports.url = api.publish().url;
```

## Libraries

The following packages are available in package managers:

* JavaScript/TypeScript: [https://www.npmjs.com/package/@pulumi/cloud](https://www.npmjs.com/package/@pulumi/cloud)

The provider-specific implementations of this library are also available for use directly when writing code that does not need to be portable:

* JavaScript/TypeScript: [https://www.npmjs.com/package/@pulumi/cloud-aws](https://www.npmjs.com/package/@pulumi/cloud-aws)

The Cloud Framework is open source and available in the [pulumi/pulumi-cloud](https://github.com/pulumi/pulumi-cloud) repo.

## Authentication

Authentication options must be set for the target cloud provider. See the [AWS setup page](/registry/packages/aws/installation-configuration/) for details (more providers for the Cloud Framework coming soon).

## Configuration

The Cloud Framework accepts the following configuration settings. These can be provided via `pulumi config set cloud:<option>`.

* `provider`: (Required) The provider to deploy cloud resources into. Currently only `aws` is supported.

The AWS implementation of the Cloud Framework accepts the following configuration settings. These can be provided via `pulumi config set cloud-aws:<option>`.

* `functionMemorySize`: (Optional) Override the Lambda function memory size for all functions.
* `functionIncludePaths`: (Optional) Comma-separated list of additional paths (relative to the project root) to include in Lambda zip uploads for JavaScript callbacks. E.g `./img.png,app/`.
* `functionIncludePackages`: (Optional) Comma-separated list of additional packages (relative to the project root) to include in Lambda zip uploads for JavaScript callbacks. E.g `body-parser,typescript`.
* `computeIAMRolePolicyARNs`: (Optional) Set the IAM role policies to apply to compute (both Lambda and ECS) within this Pulumi program. The default is: `arn:aws:iam::aws:policy/AWSLambda_FullAccess,arn:aws:iam::aws:policy/AmazonECS_FullAccess`.
* `acmCertificateARN`: (Optional) ACM certificate ARN to support services HTTPS traffic.
* `ecsClusterARN`: (Optional) ECS cluster ARN. One of `useFargate`, `ecsClusterARN`, or `ecsAutoCluster` must be provided to use container-based resources like `cloud.Service` and `cloud.Task`.
* `ecsClusterSecurityGroup`: (Optional) ECS cluster security group that all ALBs for services within the cluster will use.
* `ecsClusterEfsMountPath`: (Optional) EFS mount path on the cluster hosts. If not provided, `Volumes` cannot be used in `cloud.Service` and `cloud.Task`.
* `usePrivateNetwork`: (Optional) Put all compute in a private network.
* `externalVpcId`: (Optional) Use an existing VPC. If both `usePrivateNetwork` and `externalVpcId` are provided, the VPC must be configured to run all compute in private subnets with Internet egress enabled via NAT Gateways.
* `externalSubnets`: (Optional) Provide subnets ids for the VPC as a comma-separated string. Required if using an existing VPC.
* `externalPublicSubnets`: (Optional) Provide public subnets ids for the VPC as a comma-separated string. Required if using an existing VPC.
* `externalSecurityGroups`: (Optional) Provide securityGroup ids for the VPC as a comma-separated string. Required if using an existing VPC.
* `useFargate`: (Optional) Wse Fargate-based container compute. All tasks must be Fargate-compatible. One of `useFargate`, `ecsClusterARN`, or `ecsAutoCluster` must be provided to use container-based resources like `cloud.Service` and `cloud.Task.
* `ecsAutoCluster`: (Optional) Auto-provision an ECS Cluster. If set to true, parameters for the cluster can be provided via the other "ecsAutoCluster*" configuration variables. One of `useFargate`, `ecsClusterARN`, or `ecsAutoCluster` must be provided to use container-based resources like `cloud.Service` and `cloud.Task.
* `ecsAutoClusterNumberOfAZs`: (Optional) The number of AZs to create subnets in as part of the cluster. Defaults to `2`.
* `ecsAutoClusterInstanceType`: (Optional) The EC2 instance type to use for the cluster. Defaults to `t2.micro`.
* `ecsAutoClusterInstanceRolePolicyARNs`: (Optional) The EC2 instance role policy ARN to use for the cluster. Defaults to `arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role,arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess`.
* `ecsAutoClusterInstanceRootVolumeSize`: (Optional) The size (in GiB) of the EBS volume to attach to each instance as the root volume. Defaults to `8` GiB.
* `ecsAutoClusterInstanceDockerImageVolumeSize`: (Optional) The size (in GiB) of the EBS volume to attach to each instance as Docker Image volume. Defaults to `50` GiB.
* `ecsAutoClusterInstanceSwapVolumeSize`: (Optional) The size (in GiB) of the EBS volume to attach to each instance as the swap volume. Defaults to `5` GiB.
* `ecsAutoClusterMinSize`: (Optional) The minimum size of the cluster. Defaults to `2`.
* `ecsAutoClusterMaxSize`: (Optional) The maximum size of the cluster. Defaults to `100`.
* `ecsAutoClusterPublicKey`: (Optional) Public key material for SSH access to the cluster. See [allowed formats](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html). If not provided, no SSH access is enabled on VMs.
* `ecsAutoClusterECSOptimizedAMIName`: (Optional) The name of the ECS-optimzed AMI to use for the Container Instances in this cluster, e.g. `amzn-ami-2017.09.l-amazon-ecs-optimized`. See [valid values](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html).
* `ecsAutoClusterUseEFS`: (Optional) Optionally auto-provision an Elastic File System for the Cluster. Defaults to `false`.
116 changes: 1 addition & 115 deletions content/docs/iac/clouds/aws/cloudfx/rest-api.md
Original file line number Diff line number Diff line change
@@ -1,117 +1,3 @@
---
title: "Serverless REST API"
title_tag: "Build a Serverless REST API"
meta_desc: "This tutorial will teach you how to build and deploy a Serverless REST API with DynamoDB on AWS that counts the number of times a route has hit."
aliases:
- /docs/quickstart/cloudfx/tutorial-rest-api/
- /docs/tutorials/cloudfx/rest-api/
- /docs/clouds/aws/cloudfx/rest-api/
redirect_to: /docs/iac/clouds/aws/guides/api-gateway/
---

With Pulumi, you can combine infrastructure definitions and application code in one program. The [@pulumi/cloud] library is a set of Pulumi [components](/docs/concepts/resources/components/) that provide a higher-level abstraction over AWS. So, instead of provisioning an API Gateway instance, Lambda functions, and setting up IAM roles, you can use [cloud.API] and define application code at the same time as the infrastructure it depends on.

In this tutorial, we'll show how to create a simple REST API that counts the number of times a route has been hit. To implement this API, we need a key-value store, an API endpoint, and a Lambda function.

{{< aws-js-prereqs >}}

## Create a simple REST API

1. Run `pulumi new`:

```bash
$ mkdir hello-http && cd hello-http
$ pulumi new aws-javascript
```

1. Replace the contents of `index.js` with the following:

```javascript
const cloud = require("@pulumi/cloud-aws");
// Create a mapping from 'route' to a count
let counterTable = new cloud.Table("counterTable", "route");
// Create an API endpoint
let endpoint = new cloud.API("hello-world");
endpoint.get("/{route+}", (req, res) => {
let route = req.params["route"];
console.log(`Getting count for '${route}'`);
// get previous value and increment
// reference outer `counterTable` object
counterTable.get({ route }).then(value => {
let count = (value && value.count) || 0;
counterTable.insert({ route, count: ++count }).then(() => {
res.status(200).json({ route, count });
console.log(`Got count ${count} for '${route}'`);
});
});
});
exports.endpoint = endpoint.publish().url;
```
The definition for `counterTable` stores a counter for each route, using [cloud.Table]. On AWS, this provisions a DynamoDB instance. To create a new API Gateway instance, we create an instance of [cloud.API]. New routes can be added to this endpoint using methods like `get`, `post`, `put` etc.
The function passed to `get` is the interesting part: this becomes the body of a new AWS Lambda function that is called on a GET request to the API Gateway. The body of this function can use variables defined in the main program, such as `counterTable`. This is translated to a lookup on the provisioned DynamoDB instance; there is no need to store its ARN in an environment variable.
1. Add and install the NPM dependencies:
```bash
$ npm install --save @pulumi/cloud @pulumi/cloud-aws
```
1. Preview and deploy changes via `pulumi up`:
```
$ pulumi up
Previewing update of stack 'hello-http'
...
Updating stack 'hello-http'
...
info: 14 changes performed:
+ 14 resources created
```
1. View the endpoint URL and curl a few routes:
```bash
$ pulumi stack output
Current stack outputs (1):
OUTPUT VALUE
endpoint https://5e8xrktey3.execute-api.us-west-2.amazonaws.com/stage/
$ curl $(pulumi stack output endpoint)/hello
{"route":"hello","count":1}
$ curl $(pulumi stack output endpoint)/woohoo
{"route":"woohoo","count":1}
```
1. To view the runtime logs of the Lambda function, use the `pulumi logs` command. To get a log stream, use `pulumi logs --follow`.
```
$ pulumi logs --follow
Collecting logs since 2018-05-01T21:22:59.000-07:00.
2018-05-01T22:25:05.040-07:00[ hello-world4fcc7b60] Getting count for 'hello'
2018-05-01T22:25:05.188-07:00[ hello-world4fcc7b60] Got count 1 for 'hello'
2018-05-01T22:25:13.562-07:00[ hello-world4fcc7b60] Getting count for 'woohoo'
2018-05-01T22:25:13.704-07:00[ hello-world4fcc7b60] Got count 1 for 'woohoo'
```
## Clean up
{{< cleanup >}}
## Next steps
For an end-to-end application with a frontend, see the [URL shortener sample](https://github.com/pulumi/examples/tree/master/cloud-ts-url-shortener).
<!-- LINKS -->
[@pulumi/cloud]: ./
[cloud.API]: /docs/reference/pkg/nodejs/pulumi/cloud/#API
[cloud.Table]: /docs/reference/pkg/nodejs/pulumi/cloud/#Table
<!-- END LINKS -->
Loading

0 comments on commit 8fb905e

Please sign in to comment.