diff --git a/aws-py-appsync/README.md b/aws-py-appsync/README.md index d313714d3..06df6e706 100644 --- a/aws-py-appsync/README.md +++ b/aws-py-appsync/README.md @@ -6,31 +6,32 @@ This example shows how to setup a basic GraphQL endpoint in AWS AppSync. The end ## Deploying and running the Pulumi App -1. Create a new stack: +1. Create a new stack: ```bash $ pulumi stack init dev ``` -1. Set the AWS region: +1. Set the AWS region: - ``` + ```bash $ pulumi config set aws:region us-east-2 ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ```bash $ pulumi up Previewing update (dev): ... @@ -42,9 +43,9 @@ This example shows how to setup a basic GraphQL endpoint in AWS AppSync. The end Duration: 20s ``` -1. Check the deployed GraphQL endpoint: +1. Check the deployed GraphQL endpoint: - ``` + ```bash $ pulumi stack output endpoint https://***.appsync-api.us-east-2.amazonaws.com/graphql $ pulumi stack output key @@ -62,6 +63,6 @@ This example shows how to setup a basic GraphQL endpoint in AWS AppSync. The end ## Clean up -1. Run `pulumi destroy` to tear down all resources. +1. Run `pulumi destroy` to tear down all resources. -1. To delete the stack itself, run `pulumi stack rm`. Note that this command deletes all deployment history from the Pulumi Console. +1. To delete the stack itself, run `pulumi stack rm`. Note that this command deletes all deployment history from the Pulumi Console. diff --git a/aws-py-fargate/README.md b/aws-py-fargate/README.md index 5edbc72b1..f61336381 100644 --- a/aws-py-fargate/README.md +++ b/aws-py-fargate/README.md @@ -31,12 +31,12 @@ Next, to deploy the application and its infrastructure, follow these steps: $ pulumi config set aws:region us-east-1 # any valid AWS region will work ``` -3. Create a Python virtualenv, activate it, and install dependencies: +3. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` @@ -51,7 +51,7 @@ Next, to deploy the application and its infrastructure, follow these steps: After being prompted and selecting "yes", your deployment will begin. It'll complete in a few minutes: - ``` + ```bash Updating (dev): Type Name Status + pulumi:pulumi:Stack aws-py-fargate-dev created @@ -64,13 +64,13 @@ Next, to deploy the application and its infrastructure, follow these steps: + ├─ aws:lb:LoadBalancer app-lb created + ├─ aws:lb:Listener web created + └─ aws:ecs:Service app-svc created - + Outputs: url: "app-lb-ad43707-1433933240.us-west-2.elb.amazonaws.com" - + Resources: + 10 created - + Duration: 2m56s Permalink: https://app.pulumi.com/acmecorp/aws-python-fargate/dev/updates/1 @@ -78,7 +78,7 @@ Next, to deploy the application and its infrastructure, follow these steps: Notice that the automatically assigned load-balancer URL is printed as a stack output. -6. At this point, your app is running -- let's curl it. The CLI makes it easy to grab the URL: +5. At this point, your app is running -- let's curl it. The CLI makes it easy to grab the URL: ```bash $ curl http://$(pulumi stack output url) @@ -111,7 +111,7 @@ Next, to deploy the application and its infrastructure, follow these steps: **Please Note**: It may take a few minutes for the app to start up. Until that point, you may receive a 503 error response code. -7. Try making some changes, and rerunning `pulumi up`. For example, let's scale up to 3 instances: +6. Try making some changes, and rerunning `pulumi up`. For example, let's scale up to 3 instances: Running `pulumi up` will show you the delta and then, after confirming, will deploy just those changes: @@ -121,26 +121,26 @@ Next, to deploy the application and its infrastructure, follow these steps: Notice that `pulumi up` redeploys just the parts of the application/infrastructure that you've edited. - ``` + ```bash Updating (dev): - + Type Name Status Info pulumi:pulumi:Stack aws-py-fargate-dev ~ └─ aws:ecs:Service app-svc updated [diff: ~desiredCount] - + Outputs: url: "app-lb-ad43707-1433933240.us-west-2.elb.amazonaws.com" - + Resources: ~ 1 updated 9 unchanged - + Duration: 14s Permalink: https://app.pulumi.com/acmecorp/aws-python-fargate/dev/updates/2 ``` -8. Once you are done, you can destroy all of the resources, and the stack: +7. Once you are done, you can destroy all of the resources, and the stack: ```bash $ pulumi destroy diff --git a/aws-py-resources/README.md b/aws-py-resources/README.md index c96f6d5f8..3d97ac3c1 100644 --- a/aws-py-resources/README.md +++ b/aws-py-resources/README.md @@ -10,7 +10,7 @@ $ pulumi stack init dev $ pulumi config set aws:region us-east-2 # Install dependencies -$ virtualenv -p python3 venv +$ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt diff --git a/aws-py-s3-folder/README.md b/aws-py-s3-folder/README.md index d0d14e882..503187f78 100644 --- a/aws-py-s3-folder/README.md +++ b/aws-py-s3-folder/README.md @@ -10,27 +10,29 @@ For a detailed walkthrough of this example, see the tutorial [Static Website on Note: some values in this example will be different from run to run. These values are indicated with `***`. -1. Create a new stack: +1. Create a new stack: ```bash $ pulumi stack init website-testing ``` -1. Set the AWS region: +1. Set the AWS region: - ``` + ```bash $ pulumi config set aws:region us-west-2 ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: - ``` - $ virtualenv -p python3 venv + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. + + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Run `pulumi up` to preview and deploy changes. After the preview is shown you will be +1. Run `pulumi up` to preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not. ```bash @@ -44,7 +46,7 @@ with `***`. + ├─ aws:s3:BucketObject python.png create + ├─ aws:s3:BucketObject favicon.png create + └─ aws:s3:BucketPolicy bucket-policy create - + Resources: + 6 to create @@ -54,7 +56,7 @@ with `***`. details ``` -1. To see the resources that were created, run `pulumi stack output`: +1. To see the resources that were created, run `pulumi stack output`: ```bash $ pulumi stack output @@ -64,7 +66,7 @@ with `***`. website_url ***.s3-website-us-west-2.amazonaws.com ``` -1. To see that the S3 objects exist, you can either use the AWS Console or the AWS CLI: +1. To see that the S3 objects exist, you can either use the AWS Console or the AWS CLI: ```bash $ aws s3 ls $(pulumi stack output bucket_name) @@ -72,11 +74,11 @@ with `***`. 2018-04-17 15:40:48 249 index.html ``` -1. Open the site URL in a browser to see both the rendered HTML, the favicon, and Python splash image: +1. Open the site URL in a browser to see both the rendered HTML, the favicon, and Python splash image: ```bash $ pulumi stack output website_url ***.s3-website-us-west-2.amazonaws.com ``` -1. To clean up resources, run `pulumi destroy` and answer the confirmation question at the prompt. +1. To clean up resources, run `pulumi destroy` and answer the confirmation question at the prompt. diff --git a/aws-py-stackreference/README.md b/aws-py-stackreference/README.md index 2f03b9f1c..d90c55b45 100644 --- a/aws-py-stackreference/README.md +++ b/aws-py-stackreference/README.md @@ -3,7 +3,7 @@ This example creates a "team" EC2 Instance with tags set from _upstream_ "company" and "department" stacks via [StackReference](https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/#inter-stack-dependencies). -``` +```sh /** * company * └─ department @@ -18,14 +18,16 @@ stacks via [StackReference](https://www.pulumi.com/docs/intro/concepts/organizin ```bash $ cd company ```` - + 1. Create a Python virtualenv, activate it, and install dependencies: - ``` - $ virtualenv -p python3 venv - $ source venv/bin/activate - $ pip3 install -r requirements.txt - ``` + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. + + ```bash + $ python3 -m venv venv + $ source venv/bin/activate + $ pip3 install -r requirements.txt + ``` 1. Create a new stack: @@ -76,7 +78,7 @@ stacks via [StackReference](https://www.pulumi.com/docs/intro/concepts/organizin 1. Create a Python virtualenv, activate it, and install dependencies: - ``` + ```bash $ virtualenv -p python3 venv $ source venv/bin/activate $ pip3 install -r requirements.txt diff --git a/aws-py-static-website/README.md b/aws-py-static-website/README.md index a0abe2c7d..1fbe586d7 100644 --- a/aws-py-static-website/README.md +++ b/aws-py-static-website/README.md @@ -26,27 +26,29 @@ set: Note: some values in this example will be different from run to run. These values are indicated with `***`. -1. Create a new stack: +1. Create a new stack: ```bash $ pulumi stack init website-testing ``` -1. Set the AWS region: +1. Set the AWS region: ```bash $ pulumi config set aws:region us-west-2 ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: + + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. ```bash - $ virtualenv -p python3 venv + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Run `pulumi up` to preview and deploy changes. After the preview is shown you will be +1. Run `pulumi up` to preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not. ```bash @@ -66,7 +68,7 @@ with `***`. + └─ aws:route53:Record *** create ``` -1. To see the resources that were created, run `pulumi stack output`: +1. To see the resources that were created, run `pulumi stack output`: ```bash $ pulumi stack output @@ -78,7 +80,7 @@ with `***`. target_domain_endpoint https://***/ ``` -1. To see that the S3 objects exist, you can either use the AWS Console or the AWS CLI: +1. To see that the S3 objects exist, you can either use the AWS Console or the AWS CLI: ```bash $ aws s3 ls $(pulumi stack output content_bucket_url) @@ -86,9 +88,9 @@ with `***`. 2020-02-21 16:58:48 394 index.html ``` -1. Open a browser to the target domain endpoint from above to see your beautiful static website. (Since we don't wait for the CloudFront distribution to completely sync, you may have to wait a few minutes) +1. Open a browser to the target domain endpoint from above to see your beautiful static website. (Since we don't wait for the CloudFront distribution to completely sync, you may have to wait a few minutes) -1. To clean up resources, run `pulumi destroy` and answer the confirmation question at the prompt. +1. To clean up resources, run `pulumi destroy` and answer the confirmation question at the prompt. ## Troubleshooting @@ -114,18 +116,18 @@ This is caused by CloudFront confirming the ETag of the resource before applying ETag is essentially a "version", and AWS is rejecting any requests that are trying to update any version but the "latest". -This error will occurr when the state of the ETag get out of sync between the Pulumi Service +This error will occur when the state of the ETag gets out of sync between the Pulumi Service and AWS. (Which can happen when inspecting the CloudFront distribution in the AWS console.) You can fix this by running `pulumi refresh` to pickup the newer ETag values. ## Deployment Speed -This example creates a `aws.S3.BucketObject` for every file served from the website. When deploying +This example creates an `aws.S3.BucketObject` for every file served from the website. When deploying large websites, that can lead to very long updates as every individual file is checked for any changes. -It may be more efficient to not manage individual files using Pulumi and and instead just use the +It may be more efficient to not manage individual files using Pulumi and instead just use the AWS CLI to sync local files with the S3 bucket directly. Remove the call to `crawlDirectory` and run `pulumi up`. Pulumi will then delete the contents diff --git a/aws-py-stepfunctions/README.md b/aws-py-stepfunctions/README.md index facad8114..e7ad50384 100644 --- a/aws-py-stepfunctions/README.md +++ b/aws-py-stepfunctions/README.md @@ -4,20 +4,22 @@ A basic example that demonstrates using AWS Step Functions with a Lambda function, written in Python. -``` -# Install dependencies -$ pip install -r ./requirements.txt +```bash +# Create virtual environment and install dependencies +python3 -m venv venv +source venv/bin/activate +pip install -r ./requirements.txt # Create and configure a new stack -$ pulumi stack init stepfunctions-dev -$ pulumi config set aws:region us-east-2 +pulumi stack init stepfunctions-dev +pulumi config set aws:region us-east-2 # Preview and run the deployment -$ pulumi up +pulumi up # Start execution using the AWS CLI (or from the console at https://console.aws.amazon.com/states) -$ aws stepfunctions start-execution --state-machine-arn $(pulumi stack output state_machine_arn) +aws stepfunctions start-execution --state-machine-arn $(pulumi stack output state_machine_arn) # Remove the app and its stack -$ pulumi destroy && pulumi stack rm -y +pulumi destroy && pulumi stack rm -y ``` diff --git a/aws-py-webserver/README.md b/aws-py-webserver/README.md index 216b6f51b..04998f19f 100644 --- a/aws-py-webserver/README.md +++ b/aws-py-webserver/README.md @@ -15,25 +15,35 @@ http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applicat 1. Install dependencies (a `virtualenv` is recommended - see [Pulumi Python docs](https://www.pulumi.com/docs/intro/languages/python/)): - ``` + ```bash $ pip install -r requirements.txt ``` -1. Create a new stack: +1. Create a new stack: - ``` + ```bash $ pulumi stack init python-webserver-testing ``` -1. Set the AWS region: +1. Set the AWS region: - ``` + ```bash $ pulumi config set aws:region us-west-2 ``` -1. Run `pulumi up` to preview and deploy changes: +1. Create a Python virtualenv, activate it, and install dependencies: + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. + + ```bash + $ python3 -m venv venv + $ source venv/bin/activate + $ pip3 install -r requirements.txt ``` + +1. Run `pulumi up` to preview and deploy changes: + + ```bash $ pulumi up Previewing stack 'python-webserver-testing' Previewing changes: @@ -47,7 +57,7 @@ http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applicat 1: pulumi:pulumi:Stack webserver-py-python-webserver-testing + created 2: aws:ec2:SecurityGroup web-secgrp + created 3: aws:ec2:Instance web-server-www + created - + info: 3 changes performed: + 3 resources created Update duration: 26.470339302s @@ -55,15 +65,15 @@ http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applicat Permalink: https://pulumi.com/lindydonna/examples/webserver-py/python-webserver-testing/updates/1 ``` -1. View the host name and IP address of the instance via `stack output`: +1. View the host name and IP address of the instance via `stack output`: - ``` + ```bash $ pulumi stack output Current stack outputs (2): OUTPUT VALUE public_dns ec2-34-217-176-141.us-west-2.compute.amazonaws.com public_ip 34.217.176.141 - ``` + ``` 1. Verify that the EC2 instance exists, by either using the AWS Console or running `aws ec2 describe-instances`. diff --git a/azure-py-aks-multicluster/README.md b/azure-py-aks-multicluster/README.md index 4b148b6b4..574567435 100644 --- a/azure-py-aks-multicluster/README.md +++ b/azure-py-aks-multicluster/README.md @@ -33,7 +33,7 @@ After cloning this repo, `cd` into it and run these commands. This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. ``` - $ virtualenv -p python3 venv + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` diff --git a/azure-py-aks/README.md b/azure-py-aks/README.md index c291e378e..df5d99f36 100644 --- a/azure-py-aks/README.md +++ b/azure-py-aks/README.md @@ -2,7 +2,7 @@ # Azure Kubernetes Service (AKS) Cluster -This example deploys an AKS cluster, virtual network and Azure Container Registry and grants AKS permissions to access and manage those. +This example deploys an AKS cluster, a virtual network, and an Azure Container Registry and grants AKS permissions to access and manage those. ## Deploying the App @@ -11,7 +11,7 @@ To deploy your infrastructure, follow the below steps. ### Prerequisites 1. [Install Pulumi](https://www.pulumi.com/docs/get-started/install/) -2. [Install Python 3.6](https://www.python.org/downloads/) +2. [Install Python 3.6 or higher](https://www.python.org/downloads/) 3. [Configure Azure Credentials](https://www.pulumi.com/docs/intro/cloud-providers/azure/setup/) 4. [Generate SSH Key](https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key) @@ -19,19 +19,23 @@ To deploy your infrastructure, follow the below steps. After cloning this repo, from this working directory, run these commands: -1. Install the required Python packages packages: +1. Create a new stack, which is an isolated deployment target for this example: ```bash - $ pip install -r requirements.txt + $ pulumi stack init ``` -2. Create a new stack, which is an isolated deployment target for this example: +1. Create a Python virtualenv, activate it, and install dependencies: + + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. ```bash - $ pulumi stack init + $ python3 -m venv venv + $ source venv/bin/activate + $ pip3 install -r requirements.txt ``` -3. Set the configuration variables for this program: +1. Set the configuration variables for this program: ```bash $ pulumi config set password service_principal_password @@ -40,7 +44,7 @@ After cloning this repo, from this working directory, run these commands: $ pulumi config set azure:location westus2 ``` -4. Stand up the AKS cluster: +1. Stand up the AKS cluster: > **Note**: Due to an [issue](https://github.com/terraform-providers/terraform-provider-azuread/issues/156) in Azure Terraform Provider, the > creation of an Azure Service Principal, which is needed to create the Kubernetes cluster, is delayed and may not @@ -53,7 +57,7 @@ After cloning this repo, from this working directory, run these commands: $ pulumi up ``` -5. After 10-15 minutes, your cluster will be ready, and the kubeconfig YAML you'll use to connect to the cluster will be available as an output. You can save this kubeconfig to a file like so: +1. After 10-15 minutes, your cluster will be ready, and the kubeconfig YAML you'll use to connect to the cluster will be available as an output. You can save this kubeconfig to a file like so: ```bash $ pulumi stack output kubeconfig > kubeconfig.yaml @@ -64,9 +68,9 @@ After cloning this repo, from this working directory, run these commands: ```bash $ KUBECONFIG=./kubeconfig.yaml kubectl get nodes ``` -6. From there, feel free to experiment. Simply making edits and running `pulumi up` will incrementally update your stack. +1. From there, feel free to experiment. Simply making edits and running `pulumi up` will incrementally update your stack. -7. Once you've finished experimenting, tear down your stack's resources by destroying and removing it: +1. Once you've finished experimenting, tear down your stack's resources by destroying and removing it: ```bash $ pulumi destroy --yes diff --git a/azure-py-appservice-docker/README.md b/azure-py-appservice-docker/README.md index ec84b3b42..1045d88bb 100644 --- a/azure-py-appservice-docker/README.md +++ b/azure-py-appservice-docker/README.md @@ -2,37 +2,37 @@ # Azure App Service Cunning Docker Containers on Linux -Starting point for building web application hosted in Azure App Service from Docker images. +Starting point for building a web application hosted in Azure App Service from Docker images. The example deploys an existing image from Docker Hub ## Running the App -1. Create a new stack: +1. Create a new stack: - ``` + ```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): - ``` + ```bash $ az login ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ```bash $ pulumi up Previewing changes: ... @@ -45,12 +45,12 @@ The example deploys an existing image from Docker Hub Duration: 4m56s ``` -1. Check the deployed endpoints: +1. Check the deployed endpoints: - ``` + ```bash $ pulumi stack output hello_endpoint http://hello-app91dfea21.azurewebsites.net/hello $ curl "$(pulumi stack output hello_endpoint)" Hello, world! - ``` + diff --git a/azure-py-appservice/README.md b/azure-py-appservice/README.md index 869cffaf2..fd41c8c67 100644 --- a/azure-py-appservice/README.md +++ b/azure-py-appservice/README.md @@ -9,37 +9,37 @@ with App Service. ## Running the App -1. Create a new stack: +1. Create a new stack: - ``` + ```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): - ``` + ```bash $ az login ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` 1. Define SQL Server password (make it complex enough to satisfy Azure policy): - ``` + ```bash pulumi config set --secret sqlPassword ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ``` bash $ pulumi up Previewing changes: ... @@ -51,9 +51,9 @@ with App Service. Update duration: 1m14.59910109s ``` -1. Check the deployed website endpoint: +1. Check the deployed website endpoint: - ``` + ```bash $ pulumi stack output endpoint https://azpulumi-as0ef47193.azurewebsites.net $ curl "$(pulumi stack output endpoint)" diff --git a/azure-py-functions-raw/README.md b/azure-py-functions-raw/README.md index 1a21e9ae6..58551e76b 100644 --- a/azure-py-functions-raw/README.md +++ b/azure-py-functions-raw/README.md @@ -4,7 +4,7 @@ Azure Functions created from raw deployment packages in C#. -C# is a precompiled language, and the deployment artifact contains compiled binaries. You will need the following tool to build this projects: +C# is a precompiled language, and the deployment artifact contains compiled binaries. You will need the following tool to build this project: - [.NET Core SDK](https://dotnet.microsoft.com/download) for the .NET Function App @@ -12,43 +12,43 @@ Please remove the corresponding resources from the program in case you don't nee ## Running the App -1. Build and publish the .NET Function App project: +1. Build and publish the .NET Function App project: - ``` + ```bash $ dotnet publish dotnet ``` -1. Create a new stack: +1. Create a new stack: - ``` + ```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): - ``` + ```bash $ az login ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Configure the location to deploy the resources to: +1. Configure the location to deploy the resources to: - ``` + ```bash $ pulumi config set azure:location ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ```bash $ pulumi up Previewing update (dev): ... @@ -60,9 +60,9 @@ Please remove the corresponding resources from the program in case you don't nee Duration: 2m42s ``` -1. Check the deployed function endpoints: +1. Check the deployed function endpoints: - ``` + ```bash $ pulumi stack output dotnet_endpoint https://http-dotnet1a2d3e4d.azurewebsites.net/api/HelloDotnet?name=Pulumi $ curl "$(pulumi stack output dotnet_endpoint)" diff --git a/azure-py-hdinsight-spark/README.md b/azure-py-hdinsight-spark/README.md index edec64705..a43eeb34b 100644 --- a/azure-py-hdinsight-spark/README.md +++ b/azure-py-hdinsight-spark/README.md @@ -6,31 +6,31 @@ An example Pulumi component that deploys a Spark cluster on Azure HDInsight. ## Running the App -1. Create a new stack: +1. Create a new stack: - ``` + ```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): - ``` + ```bash $ az login ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ``` bash $ pulumi up Previewing changes: ... @@ -42,12 +42,12 @@ An example Pulumi component that deploys a Spark cluster on Azure HDInsight. Update duration: 15m6s ``` -1. Check the deployed Spark endpoint: +1. Check the deployed Spark endpoint: - ``` + ```bash $ pulumi stack output endpoint https://myspark1234abcd.azurehdinsight.net/ - + # For instance, Jupyter notebooks are available at https://myspark1234abcd.azurehdinsight.net/jupyter/ # Follow https://docs.microsoft.com/en-us/azure/hdinsight/spark/apache-spark-load-data-run-query to test it out ``` diff --git a/azure-py-msi-keyvault-rbac/README.md b/azure-py-msi-keyvault-rbac/README.md index 748cf6cb7..70aac29c1 100644 --- a/azure-py-msi-keyvault-rbac/README.md +++ b/azure-py-msi-keyvault-rbac/README.md @@ -16,43 +16,43 @@ The application consists of several parts: ## Running the App -1. Create a new stack: +1. Create a new stack: - ``` + ```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): - ``` + ```bash $ az login ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Build and publish the ASP.NET Core project: +1. Build and publish the ASP.NET Core project: - ``` + ```bash $ dotnet publish webapp ``` 1. Set an appropriate Azure location like: - ``` + ```bash $ pulumi config set azure:location westus ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ```bash $ pulumi up Previewing changes: ... @@ -64,9 +64,9 @@ The application consists of several parts: Update duration: 4m16s ``` -1. Check the deployed website endpoint: +1. Check the deployed website endpoint: - ``` + ```bash $ pulumi stack output endpoint https://app129968b8.azurewebsites.net/ $ curl "$(pulumi stack output endpoint)" diff --git a/azure-py-vm-scaleset/README.md b/azure-py-vm-scaleset/README.md index c868763db..fe5f3ba8e 100644 --- a/azure-py-vm-scaleset/README.md +++ b/azure-py-vm-scaleset/README.md @@ -13,46 +13,46 @@ This example provisions a Scale Set of Linux web servers with nginx deployed, co ## Running the App -1. Create a new stack: +1. Create a new stack: - ``` + ```bash $ pulumi stack init dev ``` -1. Configure the app deployment. +1. Configure the app deployment. - ``` + ```bash $ pulumi config set azure:location westus # any valid Azure region will do ``` Optionally, configure the username and password for the admin user. Otherwise, they will be auto-generated. - ``` + ```bash $ pulumi config set adminUser webmaster $ pulumi config set adminPassword --secret ``` Note that `--secret` ensures your password is encrypted safely. -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): - ``` + ```bash $ az login ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ```bash $ pulumi up Previewing update: ... @@ -64,9 +64,9 @@ This example provisions a Scale Set of Linux web servers with nginx deployed, co Update duration: 2m19s ``` -1. Check the domain name of the PIP: +1. Check the domain name of the PIP: - ``` + ```bash $ pulumi stack output publicAddress dsuv3vqbgi.westeurope.cloudapp.azure.com $ curl http://$(pulumi stack output publicAddress) diff --git a/azure-py-webserver-component/README.md b/azure-py-webserver-component/README.md index a09c0ec13..aa0de1e74 100644 --- a/azure-py-webserver-component/README.md +++ b/azure-py-webserver-component/README.md @@ -18,40 +18,40 @@ can be composed into a higher-level, reusable abstraction. 1. Set up a virtual Python environment and install dependencies - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip install -r requirements.txt ``` 1. Create a new stack: - ``` + ```bash $ pulumi stack init ``` 1. Set the Azure environment: - ``` + ```bash $ pulumi config set azure:environment public ``` 1. Set the required configuration for this example. This example requires you to supply a username and password to the virtual machine that we are going to create. - ``` + ```bash $ pulumi config set username myusername ``` The password is a secret, so we can ask Pulumi to encrypt the configuration: - ``` + ```bash $ pulumi config set --secret password Hunter2hunter2 ``` 1. Run `pulumi up` to preview and deploy the changes: - ``` + ```bash $ pulumi up Previewing update (dev): @@ -94,21 +94,21 @@ the virtual machine that we are going to create. 1. Get the IP address of the newly-created instance from the stack's outputs: - ``` + ```bash $ pulumi stack output public_ip 13.64.196.146 ``` 1. Check to see that your server is now running: - ``` + ```bash $ curl http://$(pulumi stack output public_ip) Hello, World! ``` 1. Destroy the stack: - ``` + ```bash $ pulumi destroy -y Previewing destroy (dev): diff --git a/azure-py-webserver/README.md b/azure-py-webserver/README.md index c8687b7ea..4f923e490 100644 --- a/azure-py-webserver/README.md +++ b/azure-py-webserver/README.md @@ -2,7 +2,7 @@ # Web Server Using Azure Virtual Machine -This example deploys an Azure Virtual Machine and starts a HTTP server on it. +This example deploys an Azure Virtual Machine and starts an HTTP server on it. ## Prerequisites @@ -14,40 +14,40 @@ This example deploys an Azure Virtual Machine and starts a HTTP server on it. 1. Set up a virtual Python environment and install dependencies - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip install -r requirements.txt ``` 1. Create a new stack: - ``` + ```bash $ pulumi stack init azure-py-webserver ``` 1. Set the Azure environment: - ``` + ```bash $ pulumi config set azure:environment public ``` 1. Set the required configuration for this example. This example requires you to supply a username and password to the virtual machine that we are going to create. - ``` + ```bash $ pulumi config set azure-web:username myusername ``` The password is a secret, so we can ask Pulumi to encrypt the configuration: - ``` + ```bash $ pulumi config set --secret azure-web:password Hunter2hunter2 ``` 1. Run `pulumi up` to preview and deploy the changes: - ``` + ```bash $ pulumi update Previewing update (azuredev): @@ -59,7 +59,7 @@ the virtual machine that we are going to create. + ├─ azure:network:Subnet server-subnet create + ├─ azure:network:NetworkInterface server-nic create + └─ azure:compute:VirtualMachine server-vm create - + Resources: + 7 to create @@ -74,7 +74,7 @@ the virtual machine that we are going to create. + ├─ azure:network:Subnet server-subnet created + ├─ azure:network:NetworkInterface server-nic created + └─ azure:compute:VirtualMachine server-vm created - + Outputs: public_ip: "137.117.15.111" @@ -88,21 +88,21 @@ the virtual machine that we are going to create. 1. Get the IP address of the newly-created instance from the stack's outputs: - ``` + ```bash $ pulumi stack output public_ip 137.117.15.111 ``` 1. Check to see that your server is now running: - ``` + ```bash $ curl http://$(pulumi stack output public_ip) Hello, World! ``` 1. Destroy the stack: - ``` + ```bash ▶ pulumi destroy --yes Previewing destroy (azuredev): @@ -114,7 +114,7 @@ the virtual machine that we are going to create. - ├─ azure:network:PublicIp server-ip delete - ├─ azure:network:VirtualNetwork server-network delete - └─ azure:core:ResourceGroup server delete - + Resources: - 7 to delete @@ -129,7 +129,7 @@ the virtual machine that we are going to create. - ├─ azure:network:PublicIp server-ip deleted - └─ azure:core:ResourceGroup server deleted - Resources: + s: - 7 deleted Duration: 3m49s diff --git a/digitalocean-py-k8s/README.md b/digitalocean-py-k8s/README.md index 61632f447..92a9718b9 100644 --- a/digitalocean-py-k8s/README.md +++ b/digitalocean-py-k8s/README.md @@ -28,13 +28,13 @@ After cloning this repo, from this working directory, run these commands:``` ```bash $ pulumi stack init dev ``` - -1. Create a Python virtualenv, activate it, and install dependencies: + +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` @@ -53,8 +53,7 @@ After cloning this repo, from this working directory, run these commands:``` 1. Deploy your cluster, application, and optional DNS records by running `pulumi up`. - This command shows a preview of the resources that will be created and asks you - whether to proceed with the deployment. Select "yes" to perform the deployment. + This command shows a preview of the resources that will be created, and asks you whether to proceed with the deployment. Select "yes" to perform the deployment. ```bash $ pulumi up diff --git a/digitalocean-py-loadbalanced-droplets/README.md b/digitalocean-py-loadbalanced-droplets/README.md index 914d7f74b..05e65a31c 100644 --- a/digitalocean-py-loadbalanced-droplets/README.md +++ b/digitalocean-py-loadbalanced-droplets/README.md @@ -8,36 +8,36 @@ Starting point for building a Pulumi sample architecture on DigitalOcean. 1. Create a new stack: - ``` + ```bash $ pulumi stack init digitalocean-ts-loadbalanced-droplets ``` -1. Configure the project: +1. Configure the project: - ``` + ```bash $ pulumi config set --secret digitalocean:token YOURDIGITALOCEANTOKEN ``` -1. Create a Python virtualenv, activate it, and install dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ``` - $ virtualenv -p python3 venv + ```bash + $ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt ``` -1. Run `pulumi up` to preview and deploy changes: +1. Run `pulumi up` to preview and deploy changes: - ``` + ```bash $ pulumi up Previewing update (digitalocean-ts-loadbalanced-droplets): ... Updating (digitalocean-ts-loadbalanced-droplets): - Type Name Status + Type Name Status + pulumi:pulumi:Stack digitalocean-ts-loadbalanced-droplets-digitalocean-ts-loadbalanced-droplets created + ├─ digitalocean:index:Tag demo-app created + ├─ digitalocean:index:Tag web-2 created @@ -57,15 +57,15 @@ Resources: Duration: 3m2s ``` -1. Curl the HTTP server: +1. Curl the HTTP server: - ``` + ```bash curl "$(pulumi stack output endpoint)" ``` 1. Cleanup - ``` + ```bash $ pulumi destroy $ pulumi stack rm ``` diff --git a/gcp-py-functions/README.md b/gcp-py-functions/README.md index 3e6333a6a..77ddc0960 100644 --- a/gcp-py-functions/README.md +++ b/gcp-py-functions/README.md @@ -24,14 +24,15 @@ use Pulumi to provision the Google Cloud Platform resources. pulumi config set gcp:region ``` -1. Download dependencies: +1. Create a Python virtualenv, activate it, and install dependencies: + + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. - ```bash - # (Optional) Create a virtualenv environment. - virtualenv -p python3 venv - source venv/bin/activate - pip3 install -r requirements.txt + ```bash + $ python3 -m venv venv + $ source venv/bin/activate + $ pip3 install -r requirements.txt ``` 1. Run `pulumi up` to preview and deploy changes: @@ -48,8 +49,7 @@ use Pulumi to provision the Google Cloud Platform resources. Duration: 1m2s ``` -Once the application is deployed, you can start accessing the Google Cloud Function by making an -HTTP request to the function's endpoint. It is exported from the stack's as `fxn_url`. +Once the application is deployed, you can start accessing the Google Cloud Function by making an HTTP request to the function's endpoint. It is exported from the stack's as `fxn_url`. ```bash $ pulumi stack output fxn_url diff --git a/gcp-py-instance-nginx/README.md b/gcp-py-instance-nginx/README.md index a49c080e8..36f993d1f 100644 --- a/gcp-py-instance-nginx/README.md +++ b/gcp-py-instance-nginx/README.md @@ -6,29 +6,33 @@ Starting point for building the Pulumi nginx server sample in Google Cloud Platf ## Running the App -1. Create a new stack: +1. Create a new stack: - ``` + ```bash $ pulumi stack init gcp-instance-nginx ``` -2. Configure Python environment: - ``` - virtualenv -p python3 venv - source venv/bin/activate - pip install pulumi_gcp - ``` +2. Create a Python virtualenv, activate it, and install dependencies: -3. Configure the project: + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. + + ```bash + $ python3 -m venv venv + $ source venv/bin/activate + $ pip3 install -r requirements.txt ``` + +3. Configure the project: + + ```bash $ export GOOGLE_PROJECT=cncf-230209; export GOOGLE_REGION=asia-east1; export GOOGLE_ZONE=asia-east1-a; $ export GOOGLE_CREDENTIALS=YOURGCPCREDENTIALS ``` -4. Run `pulumi up` to preview and deploy changes: +4. Run `pulumi up` to preview and deploy changes: - ``` + ```bash Previewing update (gcp-instance-nginx): Type Name Plan @@ -80,9 +84,9 @@ Starting point for building the Pulumi nginx server sample in Google Cloud Platf Duration: 51s ``` -5. Curl the HTTP server: +5. Curl the HTTP server: - ``` + ```bash $ curl $(pulumi stack output external_ip) @@ -204,7 +208,7 @@ Starting point for building the Pulumi nginx server sample in Google Cloud Platf 6. Destroy the created resources: - ``` + ```bash $ pulumi destroy Previewing destroy (gcp-instance-nginx): @@ -236,7 +240,7 @@ Starting point for building the Pulumi nginx server sample in Google Cloud Platf 7. Destroy the stack: - ``` + ```bash $ pulumi stack rm This will permanently remove the 'gcp-instance-nginx' stack! Please confirm that this is what you'd like to do by typing ("gcp-instance-nginx"): gcp-instance-nginx diff --git a/gcp-py-network-component/README.md b/gcp-py-network-component/README.md index aace475f4..2eeff0406 100644 --- a/gcp-py-network-component/README.md +++ b/gcp-py-network-component/README.md @@ -16,30 +16,33 @@ can be composed into a higher-level, reusable abstraction. ## Deploying and running the program -1. Set up a virtual Python environment and install dependencies +1. Create a Python virtualenv, activate it, and install dependencies: - ``` - $ virtualenv -p python3 venv + This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. + + + ```bash + $ python3 -m venv venv $ source venv/bin/activate - $ pip install -r requirements.txt + $ pip3 install -r requirements.txt ``` 1. Create a new stack: - ``` + ```bash $ pulumi stack init ``` 1. Set the Google Cloud project and region - ``` + ```bash $ pulumi config set gcp:project proj-123456 $ pulumi config set gcp:region us-central1 ``` 1. Run `pulumi up` to preview and deploy the changes: - ``` + ```bash $ pulumi up -y Previewing update (dev): @@ -88,21 +91,21 @@ can be composed into a higher-level, reusable abstraction. 1. Get the IP address of the newly-created instance from the stack's outputs: - ``` + ```bash $ pulumi stack output public_ip 13.64.196.146 ``` 1. Check to see that your server is now running: - ``` + ```bash $ curl http://$(pulumi stack output public_ip) Powered by Pulumi! ``` 1. Destroy the stack: - ``` + ```bash $ pulumi destroy -y Previewing destroy (dev): diff --git a/gcp-py-serverless-raw/README.md b/gcp-py-serverless-raw/README.md index 4ae4d4b9b..7c017e19d 100644 --- a/gcp-py-serverless-raw/README.md +++ b/gcp-py-serverless-raw/README.md @@ -12,7 +12,7 @@ $ pulumi config set gcp:region # This installs the dependent packages [needed](https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/) for our Pulumi program. -$ virtualenv -p python3 venv +$ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt