diff --git a/content/start-now-1/_index.md b/content/start-now-1/_index.md new file mode 100644 index 000000000000..50eb462d715b --- /dev/null +++ b/content/start-now-1/_index.md @@ -0,0 +1,26 @@ +--- +title: Getting Started with Pulumi +meta_desc: Step-by-step guides for provisioning your first cloud resources and mastering the basics of Pulumi +type: page +layout: start-now-unified +no_on_this_page: true +subtitle: Step-by-step guides for provisioning your first cloud resources and mastering the basics of Pulumi + +cloud_providers: + items: + - name: Amazon Web Services + logo: /logos/pkg/aws.svg + link: /start-now-1/aws/ + - name: Microsoft Azure + logo: /logos/pkg/azure.svg + link: /start-now-1/azure/ + - name: Google Cloud + logo: /logos/pkg/gcp.svg + link: /start-now-1/gcp/ + - name: Kubernetes + logo: /logos/pkg/kubernetes.svg + link: /start-now-1/kubernetes/ + - name: Oracle Cloud + logo: /logos/pkg/oci.svg + link: /start-now-1/oci/ +--- diff --git a/content/start-now-1/aws/_index.md b/content/start-now-1/aws/_index.md new file mode 100644 index 000000000000..c295a5860803 --- /dev/null +++ b/content/start-now-1/aws/_index.md @@ -0,0 +1,333 @@ +--- +title: Get Started with Pulumi and AWS +meta_desc: Deploy your first AWS resources with Pulumi in under 5 minutes +type: page +layout: cloud-unified +no_on_this_page: true + +cloud_name: AWS +subtitle: Deploy your first AWS resources in under 5 minutes +--- + +## Quick Setup + +### 1. Sign up for Pulumi (Free) + +Get started with Pulumi Cloud for free. Includes state management, secrets, and more. + +Create Free Account + +### 2. Install Pulumi CLI + +{{< chooser os "macos,linux,windows" >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} + +{{< /chooser >}} + +### 3. Configure AWS Credentials + +```bash +aws configure +``` + +Or set environment variables: + +```bash +export AWS_ACCESS_KEY_ID= +export AWS_SECRET_ACCESS_KEY= +``` + +### 4. Deploy Your First Resource + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +Create a new project: + +```bash +mkdir my-aws-app && cd my-aws-app +pulumi new aws-typescript +``` + +Example: Create an S3 bucket + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as aws from "@pulumi/aws"; + +// Create an S3 bucket +const bucket = new aws.s3.Bucket("my-bucket", { + website: { + indexDocument: "index.html", + }, +}); + +// Export the bucket name and URL +export const bucketName = bucket.id; +export const bucketUrl = pulumi.interpolate`http://${bucket.websiteEndpoint}`; +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +Create a new project: + +```bash +mkdir my-aws-app && cd my-aws-app +pulumi new aws-python +``` + +Example: Create an S3 bucket + +```python +import pulumi +import pulumi_aws as aws + +# Create an S3 bucket +bucket = aws.s3.Bucket("my-bucket", + website=aws.s3.BucketWebsiteArgs( + index_document="index.html" + )) + +# Export the bucket name and URL +pulumi.export("bucket_name", bucket.id) +pulumi.export("bucket_url", pulumi.Output.concat("http://", bucket.website_endpoint)) +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +Create a new project: + +```bash +mkdir my-aws-app && cd my-aws-app +pulumi new aws-go +``` + +Example: Create an S3 bucket + +```go +package main + +import ( + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create an S3 bucket + bucket, err := s3.NewBucket(ctx, "my-bucket", &s3.BucketArgs{ + Website: &s3.BucketWebsiteArgs{ + IndexDocument: pulumi.String("index.html"), + }, + }) + if err != nil { + return err + } + + // Export the bucket name and URL + ctx.Export("bucketName", bucket.ID()) + ctx.Export("bucketUrl", pulumi.Sprintf("http://%s", bucket.WebsiteEndpoint)) + return nil + }) +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +Create a new project: + +```bash +mkdir my-aws-app && cd my-aws-app +pulumi new aws-csharp +``` + +Example: Create an S3 bucket + +```csharp +using Pulumi; +using Pulumi.Aws.S3; + +class MyStack : Stack +{ + public MyStack() + { + // Create an S3 bucket + var bucket = new Bucket("my-bucket", new BucketArgs + { + Website = new BucketWebsiteArgs + { + IndexDocument = "index.html" + } + }); + + // Export the bucket name and URL + this.BucketName = bucket.Id; + this.BucketUrl = Output.Format($"http://{bucket.WebsiteEndpoint}"); + } + + [Output] + public Output BucketName { get; set; } + + [Output] + public Output BucketUrl { get; set; } +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +Create a new project: + +```bash +mkdir my-aws-app && cd my-aws-app +pulumi new aws-java +``` + +Example: Create an S3 bucket + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.aws.s3.Bucket; +import com.pulumi.aws.s3.BucketArgs; +import com.pulumi.aws.s3.inputs.BucketWebsiteArgs; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Create an S3 bucket + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .website(BucketWebsiteArgs.builder() + .indexDocument("index.html") + .build()) + .build()); + + // Export the bucket name and URL + ctx.export("bucketName", bucket.id()); + ctx.export("bucketUrl", bucket.websiteEndpoint() + .applyValue(endpoint -> String.format("http://%s", endpoint))); + } +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +Create a new project: + +```bash +mkdir my-aws-app && cd my-aws-app +pulumi new aws-yaml +``` + +Example: Create an S3 bucket + +```yaml +name: my-aws-app +runtime: yaml + +resources: + # Create an S3 bucket + my-bucket: + type: aws:s3:Bucket + properties: + website: + indexDocument: index.html + +outputs: + # Export the bucket name and URL + bucketName: ${my-bucket.id} + bucketUrl: http://${my-bucket.websiteEndpoint} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +## What's next? + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure + +- [**Follow the complete AWS tutorial →**](/docs/iac/get-started/aws/) + Learn how to build a static website on AWS with S3 and CloudFront + +- [**Explore AWS examples →**](https://github.com/pulumi/examples#aws) + Browse production-ready examples for common AWS architectures + +- [**Learn Pulumi concepts →**](/docs/iac/concepts/) + Understand stacks, state, configuration, and more + +- [**Join the community →**](https://slack.pulumi.com) + Get help and share knowledge with other Pulumi users diff --git a/content/start-now-1/azure/_index.md b/content/start-now-1/azure/_index.md new file mode 100644 index 000000000000..99c031296a84 --- /dev/null +++ b/content/start-now-1/azure/_index.md @@ -0,0 +1,369 @@ +--- +title: Get Started with Pulumi and Azure +meta_desc: Deploy your first Azure resources with Pulumi in under 5 minutes +type: page +layout: cloud-unified +no_on_this_page: true + +cloud_name: Azure +subtitle: Deploy your first Azure resources in under 5 minutes +--- + +## Quick Setup + +### 1. Sign up for Pulumi (Free) + +Get started with Pulumi Cloud for free. Includes state management, secrets, and more. + +Create Free Account + +### 2. Install Pulumi CLI + +{{< chooser os "macos,linux,windows" >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} + +{{< /chooser >}} + +### 3. Configure Azure Credentials + +```bash +az login +``` + +Or use a service principal: + +```bash +export ARM_CLIENT_ID= +export ARM_CLIENT_SECRET= +export ARM_TENANT_ID= +export ARM_SUBSCRIPTION_ID= +``` + +### 4. Deploy Your First Resource + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +Create a new project: + +```bash +mkdir my-azure-app && cd my-azure-app +pulumi new azure-typescript +``` + +Example: Create a Storage Account + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as azure from "@pulumi/azure-native"; + +// Create a Resource Group +const resourceGroup = new azure.resources.ResourceGroup("myResourceGroup"); + +// Create a Storage Account +const storageAccount = new azure.storage.StorageAccount("mystorageacct", { + resourceGroupName: resourceGroup.name, + sku: { + name: azure.storage.SkuName.Standard_LRS, + }, + kind: azure.storage.Kind.StorageV2, +}); + +// Export the primary storage key +export const primaryStorageKey = pulumi.secret(storageAccount.primaryAccessKey); +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +Create a new project: + +```bash +mkdir my-azure-app && cd my-azure-app +pulumi new azure-python +``` + +Example: Create a Storage Account + +```python +import pulumi +from pulumi_azure_native import resources, storage + +# Create a Resource Group +resource_group = resources.ResourceGroup("myResourceGroup") + +# Create a Storage Account +storage_account = storage.StorageAccount( + "mystorageacct", + resource_group_name=resource_group.name, + sku=storage.SkuArgs( + name=storage.SkuName.STANDARD_LRS + ), + kind=storage.Kind.STORAGE_V2 +) + +# Export the primary storage key +pulumi.export("primary_storage_key", + pulumi.Output.secret(storage_account.primary_access_key)) +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +Create a new project: + +```bash +mkdir my-azure-app && cd my-azure-app +pulumi new azure-go +``` + +Example: Create a Storage Account + +```go +package main + +import ( + "github.com/pulumi/pulumi-azure-native/sdk/v2/go/azure/resources" + "github.com/pulumi/pulumi-azure-native/sdk/v2/go/azure/storage" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create a Resource Group + resourceGroup, err := resources.NewResourceGroup(ctx, "myResourceGroup", nil) + if err != nil { + return err + } + + // Create a Storage Account + storageAccount, err := storage.NewStorageAccount(ctx, "mystorageacct", &storage.StorageAccountArgs{ + ResourceGroupName: resourceGroup.Name, + Sku: &storage.SkuArgs{ + Name: pulumi.String("Standard_LRS"), + }, + Kind: pulumi.String("StorageV2"), + }) + if err != nil { + return err + } + + // Export the primary storage key + ctx.Export("primaryStorageKey", pulumi.ToSecret(storageAccount.PrimaryAccessKey)) + return nil + }) +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +Create a new project: + +```bash +mkdir my-azure-app && cd my-azure-app +pulumi new azure-csharp +``` + +Example: Create a Storage Account + +```csharp +using Pulumi; +using Pulumi.AzureNative.Resources; +using Pulumi.AzureNative.Storage; +using Pulumi.AzureNative.Storage.Inputs; + +class MyStack : Stack +{ + public MyStack() + { + // Create a Resource Group + var resourceGroup = new ResourceGroup("myResourceGroup"); + + // Create a Storage Account + var storageAccount = new StorageAccount("mystorageacct", new StorageAccountArgs + { + ResourceGroupName = resourceGroup.Name, + Sku = new SkuArgs + { + Name = SkuName.Standard_LRS + }, + Kind = Kind.StorageV2 + }); + + // Export the primary storage key + this.PrimaryStorageKey = Output.CreateSecret(storageAccount.PrimaryAccessKey); + } + + [Output] + public Output PrimaryStorageKey { get; set; } +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +Create a new project: + +```bash +mkdir my-azure-app && cd my-azure-app +pulumi new azure-java +``` + +Example: Create a Storage Account + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.azurenative.resources.ResourceGroup; +import com.pulumi.azurenative.storage.StorageAccount; +import com.pulumi.azurenative.storage.StorageAccountArgs; +import com.pulumi.azurenative.storage.inputs.SkuArgs; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Create a Resource Group + var resourceGroup = new ResourceGroup("myResourceGroup"); + + // Create a Storage Account + var storageAccount = new StorageAccount("mystorageacct", StorageAccountArgs.builder() + .resourceGroupName(resourceGroup.name()) + .sku(SkuArgs.builder() + .name("Standard_LRS") + .build()) + .kind("StorageV2") + .build()); + + // Export the primary storage key + ctx.export("primaryStorageKey", + storageAccount.primaryAccessKey().applyValue(key -> key)); + } +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +Create a new project: + +```bash +mkdir my-azure-app && cd my-azure-app +pulumi new azure-yaml +``` + +Example: Create a Storage Account + +```yaml +name: my-azure-app +runtime: yaml + +resources: + # Create a Resource Group + myResourceGroup: + type: azure-native:resources:ResourceGroup + + # Create a Storage Account + myStorageAccount: + type: azure-native:storage:StorageAccount + properties: + resourceGroupName: ${myResourceGroup.name} + sku: + name: Standard_LRS + kind: StorageV2 + +outputs: + # Export the primary storage key + primaryStorageKey: + value: ${myStorageAccount.primaryAccessKey} + secret: true +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +## What's next? + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure + +- [**Follow the complete Azure tutorial →**](/docs/iac/get-started/azure/) + Learn how to build and deploy applications on Azure + +- [**Explore Azure examples →**](https://github.com/pulumi/examples#azure) + Browse production-ready examples for common Azure architectures + +- [**Learn Pulumi concepts →**](/docs/iac/concepts/) + Understand stacks, state, configuration, and more + +- [**Join the community →**](https://slack.pulumi.com) + Get help and share knowledge with other Pulumi users diff --git a/content/start-now-1/gcp/_index.md b/content/start-now-1/gcp/_index.md new file mode 100644 index 000000000000..16194e718e01 --- /dev/null +++ b/content/start-now-1/gcp/_index.md @@ -0,0 +1,338 @@ +--- +title: Get Started with Pulumi and Google Cloud +meta_desc: Deploy your first Google Cloud resources with Pulumi in under 5 minutes +type: page +layout: cloud-unified +no_on_this_page: true + +cloud_name: Google Cloud +subtitle: Deploy your first Google Cloud resources in under 5 minutes +--- + +## Quick Setup + +### 1. Sign up for Pulumi (Free) + +Get started with Pulumi Cloud for free. Includes state management, secrets, and more. + +Create Free Account + +### 2. Install Pulumi CLI + +{{< chooser os "macos,linux,windows" >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} + +{{< /chooser >}} + +### 3. Configure Google Cloud Credentials + +```bash +gcloud auth application-default login +``` + +Or use a service account: + +```bash +export GOOGLE_CREDENTIALS=/path/to/service-account-key.json +``` + +### 4. Deploy Your First Resource + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +Create a new project: + +```bash +mkdir my-gcp-app && cd my-gcp-app +pulumi new gcp-typescript +``` + +Example: Create a Storage Bucket + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as gcp from "@pulumi/gcp"; + +// Create a GCP Storage bucket +const bucket = new gcp.storage.Bucket("my-bucket", { + location: "US", + website: { + mainPageSuffix: "index.html", + }, +}); + +// Export the bucket URL +export const bucketName = bucket.name; +export const bucketUrl = pulumi.interpolate`gs://${bucket.name}`; +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +Create a new project: + +```bash +mkdir my-gcp-app && cd my-gcp-app +pulumi new gcp-python +``` + +Example: Create a Storage Bucket + +```python +import pulumi +import pulumi_gcp as gcp + +# Create a GCP Storage bucket +bucket = gcp.storage.Bucket("my-bucket", + location="US", + website=gcp.storage.BucketWebsiteArgs( + main_page_suffix="index.html" + )) + +# Export the bucket URL +pulumi.export("bucket_name", bucket.name) +pulumi.export("bucket_url", pulumi.Output.concat("gs://", bucket.name)) +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +Create a new project: + +```bash +mkdir my-gcp-app && cd my-gcp-app +pulumi new gcp-go +``` + +Example: Create a Storage Bucket + +```go +package main + +import ( + "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create a GCP Storage bucket + bucket, err := storage.NewBucket(ctx, "my-bucket", &storage.BucketArgs{ + Location: pulumi.String("US"), + Website: &storage.BucketWebsiteArgs{ + MainPageSuffix: pulumi.String("index.html"), + }, + }) + if err != nil { + return err + } + + // Export the bucket URL + ctx.Export("bucketName", bucket.Name) + ctx.Export("bucketUrl", pulumi.Sprintf("gs://%s", bucket.Name)) + return nil + }) +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +Create a new project: + +```bash +mkdir my-gcp-app && cd my-gcp-app +pulumi new gcp-csharp +``` + +Example: Create a Storage Bucket + +```csharp +using Pulumi; +using Pulumi.Gcp.Storage; + +class MyStack : Stack +{ + public MyStack() + { + // Create a GCP Storage bucket + var bucket = new Bucket("my-bucket", new BucketArgs + { + Location = "US", + Website = new BucketWebsiteArgs + { + MainPageSuffix = "index.html" + } + }); + + // Export the bucket URL + this.BucketName = bucket.Name; + this.BucketUrl = Output.Format($"gs://{bucket.Name}"); + } + + [Output] + public Output BucketName { get; set; } + + [Output] + public Output BucketUrl { get; set; } +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +Create a new project: + +```bash +mkdir my-gcp-app && cd my-gcp-app +pulumi new gcp-java +``` + +Example: Create a Storage Bucket + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.gcp.storage.Bucket; +import com.pulumi.gcp.storage.BucketArgs; +import com.pulumi.gcp.storage.inputs.BucketWebsiteArgs; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Create a GCP Storage bucket + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .location("US") + .website(BucketWebsiteArgs.builder() + .mainPageSuffix("index.html") + .build()) + .build()); + + // Export the bucket URL + ctx.export("bucketName", bucket.name()); + ctx.export("bucketUrl", bucket.name() + .applyValue(name -> String.format("gs://%s", name))); + } +} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +Create a new project: + +```bash +mkdir my-gcp-app && cd my-gcp-app +pulumi new gcp-yaml +``` + +Example: Create a Storage Bucket + +```yaml +name: my-gcp-app +runtime: yaml + +resources: + # Create a GCP Storage bucket + my-bucket: + type: gcp:storage:Bucket + properties: + location: US + website: + mainPageSuffix: index.html + +outputs: + # Export the bucket URL + bucketName: ${my-bucket.name} + bucketUrl: gs://${my-bucket.name} +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +## What's next? + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure + +- [**Follow the complete GCP tutorial →**](/docs/iac/get-started/gcp/) + Learn how to build and deploy applications on Google Cloud + +- [**Explore GCP examples →**](https://github.com/pulumi/examples#gcp) + Browse production-ready examples for common GCP architectures + +- [**Learn Pulumi concepts →**](/docs/iac/concepts/) + Understand stacks, state, configuration, and more + +- [**Join the community →**](https://slack.pulumi.com) + Get help and share knowledge with other Pulumi users diff --git a/content/start-now-1/kubernetes/_index.md b/content/start-now-1/kubernetes/_index.md new file mode 100644 index 000000000000..5a8021d31034 --- /dev/null +++ b/content/start-now-1/kubernetes/_index.md @@ -0,0 +1,526 @@ +--- +title: Get Started with Pulumi and Kubernetes +meta_desc: Deploy your first Kubernetes applications with Pulumi in under 5 minutes +type: page +layout: cloud-unified +no_on_this_page: true + +cloud_name: Kubernetes +subtitle: Deploy your first Kubernetes applications in under 5 minutes +--- + +## Quick Setup + +### 1. Sign up for Pulumi (Free) + +Get started with Pulumi Cloud for free. Includes state management, secrets, and more. + +Create Free Account + +### 2. Install Pulumi CLI + +{{< chooser os "macos,linux,windows" >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} + +{{< /chooser >}} + +### 3. Configure Kubernetes Access + +Ensure you have `kubectl` configured to connect to your cluster: + +```bash +kubectl cluster-info +``` + +Pulumi uses the same configuration as `kubectl` from `~/.kube/config`. + +### 4. Deploy Your First Application + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +Create a new project: + +```bash +mkdir my-k8s-app && cd my-k8s-app +pulumi new kubernetes-typescript +``` + +Example: Deploy an NGINX application + +```typescript +import * as k8s from "@pulumi/kubernetes"; + +// Create a Kubernetes Deployment +const appLabels = { app: "nginx" }; +const deployment = new k8s.apps.v1.Deployment("nginx-deployment", { + spec: { + selector: { matchLabels: appLabels }, + replicas: 2, + template: { + metadata: { labels: appLabels }, + spec: { + containers: [{ + name: "nginx", + image: "nginx:latest", + ports: [{ containerPort: 80 }], + }], + }, + }, + }, +}); + +// Create a Service +const service = new k8s.core.v1.Service("nginx-service", { + spec: { + selector: appLabels, + ports: [{ port: 80 }], + type: "LoadBalancer", + }, +}); + +// Export the Service endpoint +export const url = service.status.loadBalancer.ingress[0].hostname; +``` + +Deploy your application: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +Create a new project: + +```bash +mkdir my-k8s-app && cd my-k8s-app +pulumi new kubernetes-python +``` + +Example: Deploy an NGINX application + +```python +import pulumi +import pulumi_kubernetes as kubernetes + +# Create a Kubernetes Deployment +app_labels = {"app": "nginx"} +deployment = kubernetes.apps.v1.Deployment( + "nginx-deployment", + spec=kubernetes.apps.v1.DeploymentSpecArgs( + selector=kubernetes.meta.v1.LabelSelectorArgs( + match_labels=app_labels + ), + replicas=2, + template=kubernetes.core.v1.PodTemplateSpecArgs( + metadata=kubernetes.meta.v1.ObjectMetaArgs( + labels=app_labels + ), + spec=kubernetes.core.v1.PodSpecArgs( + containers=[kubernetes.core.v1.ContainerArgs( + name="nginx", + image="nginx:latest", + ports=[kubernetes.core.v1.ContainerPortArgs( + container_port=80 + )], + )], + ), + ), + ), +) + +# Create a Service +service = kubernetes.core.v1.Service( + "nginx-service", + spec=kubernetes.core.v1.ServiceSpecArgs( + selector=app_labels, + ports=[kubernetes.core.v1.ServicePortArgs(port=80)], + type="LoadBalancer", + ), +) + +# Export the Service endpoint +pulumi.export("url", service.status.load_balancer.ingress[0].hostname) +``` + +Deploy your application: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +Create a new project: + +```bash +mkdir my-k8s-app && cd my-k8s-app +pulumi new kubernetes-go +``` + +Example: Deploy an NGINX application + +```go +package main + +import ( + appsv1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/apps/v1" + corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1" + metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create a Kubernetes Deployment + appLabels := pulumi.StringMap{ + "app": pulumi.String("nginx"), + } + + deployment, err := appsv1.NewDeployment(ctx, "nginx-deployment", &appsv1.DeploymentArgs{ + Spec: &appsv1.DeploymentSpecArgs{ + Selector: &metav1.LabelSelectorArgs{ + MatchLabels: appLabels, + }, + Replicas: pulumi.Int(2), + Template: &corev1.PodTemplateSpecArgs{ + Metadata: &metav1.ObjectMetaArgs{ + Labels: appLabels, + }, + Spec: &corev1.PodSpecArgs{ + Containers: corev1.ContainerArray{ + &corev1.ContainerArgs{ + Name: pulumi.String("nginx"), + Image: pulumi.String("nginx:latest"), + Ports: corev1.ContainerPortArray{ + &corev1.ContainerPortArgs{ + ContainerPort: pulumi.Int(80), + }, + }, + }, + }, + }, + }, + }, + }) + if err != nil { + return err + } + + // Create a Service + service, err := corev1.NewService(ctx, "nginx-service", &corev1.ServiceArgs{ + Spec: &corev1.ServiceSpecArgs{ + Selector: appLabels, + Ports: corev1.ServicePortArray{ + &corev1.ServicePortArgs{ + Port: pulumi.Int(80), + }, + }, + Type: pulumi.String("LoadBalancer"), + }, + }) + if err != nil { + return err + } + + ctx.Export("name", deployment.Metadata.Name()) + ctx.Export("service", service.Metadata.Name()) + return nil + }) +} +``` + +Deploy your application: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +Create a new project: + +```bash +mkdir my-k8s-app && cd my-k8s-app +pulumi new kubernetes-csharp +``` + +Example: Deploy an NGINX application + +```csharp +using Pulumi; +using Pulumi.Kubernetes.Apps.V1; +using Pulumi.Kubernetes.Core.V1; +using Pulumi.Kubernetes.Types.Inputs.Apps.V1; +using Pulumi.Kubernetes.Types.Inputs.Core.V1; +using Pulumi.Kubernetes.Types.Inputs.Meta.V1; + +class MyStack : Stack +{ + public MyStack() + { + var appLabels = new InputMap + { + { "app", "nginx" } + }; + + // Create a Kubernetes Deployment + var deployment = new Deployment("nginx-deployment", new DeploymentArgs + { + Spec = new DeploymentSpecArgs + { + Selector = new LabelSelectorArgs + { + MatchLabels = appLabels + }, + Replicas = 2, + Template = new PodTemplateSpecArgs + { + Metadata = new ObjectMetaArgs + { + Labels = appLabels + }, + Spec = new PodSpecArgs + { + Containers = new[] + { + new ContainerArgs + { + Name = "nginx", + Image = "nginx:latest", + Ports = new[] + { + new ContainerPortArgs + { + ContainerPort = 80 + } + } + } + } + } + } + } + }); + + // Create a Service + var service = new Service("nginx-service", new ServiceArgs + { + Spec = new ServiceSpecArgs + { + Selector = appLabels, + Ports = new[] + { + new ServicePortArgs + { + Port = 80 + } + }, + Type = "LoadBalancer" + } + }); + + this.ServiceName = service.Metadata.Apply(m => m.Name); + } + + [Output] + public Output ServiceName { get; set; } +} +``` + +Deploy your application: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +Create a new project: + +```bash +mkdir my-k8s-app && cd my-k8s-app +pulumi new kubernetes-java +``` + +Example: Deploy an NGINX application + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.kubernetes.apps.v1.Deployment; +import com.pulumi.kubernetes.apps.v1.DeploymentArgs; +import com.pulumi.kubernetes.apps.v1.inputs.DeploymentSpecArgs; +import com.pulumi.kubernetes.core.v1.Service; +import com.pulumi.kubernetes.core.v1.ServiceArgs; +import com.pulumi.kubernetes.core.v1.inputs.*; +import com.pulumi.kubernetes.meta.v1.inputs.*; + +import java.util.Map; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var appLabels = Map.of("app", "nginx"); + + // Create a Kubernetes Deployment + var deployment = new Deployment("nginx-deployment", DeploymentArgs.builder() + .spec(DeploymentSpecArgs.builder() + .selector(LabelSelectorArgs.builder() + .matchLabels(appLabels) + .build()) + .replicas(2) + .template(PodTemplateSpecArgs.builder() + .metadata(ObjectMetaArgs.builder() + .labels(appLabels) + .build()) + .spec(PodSpecArgs.builder() + .containers(ContainerArgs.builder() + .name("nginx") + .image("nginx:latest") + .ports(ContainerPortArgs.builder() + .containerPort(80) + .build()) + .build()) + .build()) + .build()) + .build()) + .build()); + + // Create a Service + var service = new Service("nginx-service", ServiceArgs.builder() + .spec(ServiceSpecArgs.builder() + .selector(appLabels) + .ports(ServicePortArgs.builder() + .port(80) + .build()) + .type("LoadBalancer") + .build()) + .build()); + + ctx.export("serviceName", service.metadata() + .applyValue(metadata -> metadata.name().orElse(""))); + } +} +``` + +Deploy your application: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +Create a new project: + +```bash +mkdir my-k8s-app && cd my-k8s-app +pulumi new kubernetes-yaml +``` + +Example: Deploy an NGINX application + +```yaml +name: my-k8s-app +runtime: yaml + +resources: + # Create a Kubernetes Deployment + nginx-deployment: + type: kubernetes:apps/v1:Deployment + properties: + spec: + selector: + matchLabels: + app: nginx + replicas: 2 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 + + # Create a Service + nginx-service: + type: kubernetes:core/v1:Service + properties: + spec: + selector: + app: nginx + ports: + - port: 80 + type: LoadBalancer + +outputs: + serviceName: ${nginx-service.metadata.name} +``` + +Deploy your application: + +```bash +pulumi up +``` + +{{% /choosable %}} + +## What's next? + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure + +- [**Follow the complete Kubernetes tutorial →**](/docs/iac/get-started/kubernetes/) + Learn how to deploy and manage applications on Kubernetes + +- [**Explore Kubernetes examples →**](https://github.com/pulumi/examples#kubernetes) + Browse production-ready examples for Kubernetes workloads + +- [**Learn about Helm integration →**](/docs/iac/concepts/using-pulumi/adopting-pulumi/migrating-to-pulumi/from-kubernetes/#helm-charts) + Deploy existing Helm charts with Pulumi + +- [**Join the community →**](https://slack.pulumi.com) + Get help and share knowledge with other Pulumi users diff --git a/content/start-now-1/oci/_index.md b/content/start-now-1/oci/_index.md new file mode 100644 index 000000000000..479c69287464 --- /dev/null +++ b/content/start-now-1/oci/_index.md @@ -0,0 +1,529 @@ +--- +title: Get Started with Pulumi and Oracle Cloud +meta_desc: Create, deploy, and manage infrastructure on Oracle Cloud Infrastructure using Pulumi - unified guide with examples in multiple languages +type: page +layout: cloud-unified +no_on_this_page: true + +cloud_name: Oracle Cloud +subtitle: Deploy your first Oracle Cloud resources in under 5 minutes +--- + +## Quick Setup + +### 1. Sign up for Pulumi (Free) + +Get started with Pulumi Cloud for free. Includes state management, secrets, and more. + +Create Free Account + +### 2. Install Pulumi CLI + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} +Install with Homebrew: + +```bash +brew install pulumi/tap/pulumi +``` + +Or download the [macOS installer](https://get.pulumi.com/releases/sdk/pulumi-latest-darwin-x64.pkg). + +{{% /choosable %}} + +{{% choosable os linux %}} +Install with curl: + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +Or download a [Linux package](https://www.pulumi.com/docs/install/versions/). + +{{% /choosable %}} + +{{% choosable os windows %}} +Install with PowerShell: + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +Or download the [Windows installer](https://get.pulumi.com/releases/sdk/pulumi-latest-windows-x64.msi). + +{{% /choosable %}} + +Verify installation: + +```bash +pulumi version +``` + +### 3. Configure Oracle Cloud Credentials + +Configure your Oracle Cloud Infrastructure credentials using one of these methods: + +#### Option 1: OCI CLI Configuration (Recommended) + +First install and configure the OCI CLI: + +```bash +# Install OCI CLI +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" + +# Configure OCI CLI with your credentials +oci setup config +``` + +This will prompt you for: + +- User OCID +- Tenancy OCID +- Region +- Path to your API signing key + +#### Option 2: Environment Variables + +Set the required environment variables: + +```bash +export OCI_TENANCY_OCID="ocid1.tenancy.oc1..xxxxx" +export OCI_USER_OCID="ocid1.user.oc1..xxxxx" +export OCI_FINGERPRINT="xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" +export OCI_REGION="us-ashburn-1" +export OCI_PRIVATE_KEY_PATH="~/.oci/oci_api_key.pem" +``` + +Verify your configuration: + +```bash +oci iam region list +``` + +### 4. Deploy Your First Resource + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} +Create a new TypeScript project: + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-typescript +``` + +This creates a new Pulumi project with TypeScript configured for OCI. + +Deploy your first resource by modifying `index.ts`: + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as oci from "@pulumi/oci"; + +// Get the compartment OCID +const compartmentId = pulumi.config.require("compartmentId"); + +// Create a VCN (Virtual Cloud Network) +const vcn = new oci.core.Vcn("my-vcn", { + compartmentId: compartmentId, + cidrBlocks: ["10.0.0.0/16"], + displayName: "my-vcn", +}); + +// Create an Object Storage bucket +const bucket = new oci.objectstorage.Bucket("my-bucket", { + compartmentId: compartmentId, + namespace: oci.objectstorage.getNamespaceOutput().namespace, + name: "my-pulumi-bucket", + accessType: "NoPublicAccess", +}); + +// Export the VCN and bucket information +export const vcnId = vcn.id; +export const bucketName = bucket.name; +``` + +Set the compartment ID: + +```bash +pulumi config set compartmentId +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language python %}} +Create a new Python project: + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-python +``` + +This creates a new Pulumi project with Python configured for OCI. + +Deploy your first resource by modifying `__main__.py`: + +```python +import pulumi +import pulumi_oci as oci + +# Get the compartment OCID +config = pulumi.Config() +compartment_id = config.require("compartmentId") + +# Create a VCN (Virtual Cloud Network) +vcn = oci.core.Vcn("my-vcn", + compartment_id=compartment_id, + cidr_blocks=["10.0.0.0/16"], + display_name="my-vcn" +) + +# Get the namespace for Object Storage +namespace = oci.objectstorage.get_namespace() + +# Create an Object Storage bucket +bucket = oci.objectstorage.Bucket("my-bucket", + compartment_id=compartment_id, + namespace=namespace.namespace, + name="my-pulumi-bucket", + access_type="NoPublicAccess" +) + +# Export the VCN and bucket information +pulumi.export("vcnId", vcn.id) +pulumi.export("bucketName", bucket.name) +``` + +Set the compartment ID: + +```bash +pulumi config set compartmentId +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language go %}} +Create a new Go project: + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-go +``` + +This creates a new Pulumi project with Go configured for OCI. + +Deploy your first resource by modifying `main.go`: + +```go +package main + +import ( + "github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core" + "github.com/pulumi/pulumi-oci/sdk/v2/go/oci/objectstorage" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Get the compartment OCID + cfg := config.New(ctx, "") + compartmentId := cfg.Require("compartmentId") + + // Create a VCN (Virtual Cloud Network) + vcn, err := core.NewVcn(ctx, "my-vcn", &core.VcnArgs{ + CompartmentId: pulumi.String(compartmentId), + CidrBlocks: pulumi.StringArray{ + pulumi.String("10.0.0.0/16"), + }, + DisplayName: pulumi.String("my-vcn"), + }) + if err != nil { + return err + } + + // Get the namespace for Object Storage + namespace, err := objectstorage.GetNamespace(ctx, nil) + if err != nil { + return err + } + + // Create an Object Storage bucket + bucket, err := objectstorage.NewBucket(ctx, "my-bucket", &objectstorage.BucketArgs{ + CompartmentId: pulumi.String(compartmentId), + Namespace: pulumi.String(namespace.Namespace), + Name: pulumi.String("my-pulumi-bucket"), + AccessType: pulumi.String("NoPublicAccess"), + }) + if err != nil { + return err + } + + // Export the VCN and bucket information + ctx.Export("vcnId", vcn.ID()) + ctx.Export("bucketName", bucket.Name) + + return nil + }) +} +``` + +Set the compartment ID: + +```bash +pulumi config set compartmentId +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} +Create a new C# project: + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-csharp +``` + +This creates a new Pulumi project with C# configured for OCI. + +Deploy your first resource by modifying `Program.cs`: + +```csharp +using System.Threading.Tasks; +using Pulumi; +using Pulumi.Oci.Core; +using Pulumi.Oci.ObjectStorage; + +class Program +{ + static Task Main() => Deployment.RunAsync(); +} + +class MyStack : Stack +{ + public MyStack() + { + // Get the compartment OCID + var config = new Config(); + var compartmentId = config.Require("compartmentId"); + + // Create a VCN (Virtual Cloud Network) + var vcn = new Vcn("my-vcn", new VcnArgs + { + CompartmentId = compartmentId, + CidrBlocks = { "10.0.0.0/16" }, + DisplayName = "my-vcn", + }); + + // Get the namespace for Object Storage + var @namespace = GetNamespace.Invoke(); + + // Create an Object Storage bucket + var bucket = new Bucket("my-bucket", new BucketArgs + { + CompartmentId = compartmentId, + Namespace = @namespace.Apply(ns => ns.Namespace), + Name = "my-pulumi-bucket", + AccessType = "NoPublicAccess", + }); + + // Export the VCN and bucket information + this.VcnId = vcn.Id; + this.BucketName = bucket.Name; + } + + [Output] + public Output VcnId { get; set; } + + [Output] + public Output BucketName { get; set; } +} +``` + +Set the compartment ID: + +```bash +pulumi config set compartmentId +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language java %}} +Create a new Java project: + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-java +``` + +This creates a new Pulumi project with Java configured for OCI. + +Deploy your first resource by modifying `src/main/java/myproject/App.java`: + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.oci.core.Vcn; +import com.pulumi.oci.core.VcnArgs; +import com.pulumi.oci.objectstorage.Bucket; +import com.pulumi.oci.objectstorage.BucketArgs; +import com.pulumi.oci.objectstorage.ObjectstorageFunctions; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Get the compartment OCID + var config = ctx.config(); + var compartmentId = config.require("compartmentId"); + + // Create a VCN (Virtual Cloud Network) + var vcn = new Vcn("my-vcn", VcnArgs.builder() + .compartmentId(compartmentId) + .cidrBlocks("10.0.0.0/16") + .displayName("my-vcn") + .build()); + + // Get the namespace for Object Storage + var namespace = ObjectstorageFunctions.getNamespace(); + + // Create an Object Storage bucket + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .compartmentId(compartmentId) + .namespace(namespace.applyValue(ns -> ns.namespace())) + .name("my-pulumi-bucket") + .accessType("NoPublicAccess") + .build()); + + // Export the VCN and bucket information + ctx.export("vcnId", vcn.id()); + ctx.export("bucketName", bucket.name()); + } +} +``` + +Set the compartment ID: + +```bash +pulumi config set compartmentId +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} +Create a new YAML project: + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-yaml +``` + +This creates a new Pulumi project with YAML configured for OCI. + +Deploy your first resource by modifying `Pulumi.yaml`: + +```yaml +name: oci-quickstart +runtime: yaml +description: A minimal Oracle Cloud Infrastructure Pulumi YAML program + +config: + compartmentId: + type: string + +variables: + namespace: + fn::invoke: + function: oci:ObjectStorage:getNamespace + +resources: + # Create a VCN (Virtual Cloud Network) + my-vcn: + type: oci:Core:Vcn + properties: + compartmentId: ${compartmentId} + cidrBlocks: + - 10.0.0.0/16 + displayName: my-vcn + + # Create an Object Storage bucket + my-bucket: + type: oci:ObjectStorage:Bucket + properties: + compartmentId: ${compartmentId} + namespace: ${namespace.namespace} + name: my-pulumi-bucket + accessType: NoPublicAccess + +outputs: + # Export the VCN and bucket information + vcnId: ${my-vcn.id} + bucketName: ${my-bucket.name} +``` + +Set the compartment ID: + +```bash +pulumi config set compartmentId +``` + +Deploy your infrastructure: + +```bash +pulumi up +``` + +{{% /choosable %}} + +## What's next? + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure + +- [**Follow the complete OCI tutorial →**](/docs/iac/get-started/oci/) + Learn how to build more complex infrastructure on Oracle Cloud + +- [**Explore OCI examples →**](https://github.com/pulumi/examples#oracle-cloud-infrastructure) + Browse production-ready examples for common OCI architectures + +- [**Learn Pulumi concepts →**](/docs/iac/concepts/) + Understand stacks, state, configuration, and more + +- [**Join the community →**](https://slack.pulumi.com) + Get help and share knowledge with other Pulumi users diff --git a/content/start-now-2/_index.md b/content/start-now-2/_index.md new file mode 100644 index 000000000000..928e6569d014 --- /dev/null +++ b/content/start-now-2/_index.md @@ -0,0 +1,26 @@ +--- +title: Getting Started with Pulumi +meta_desc: Step-by-step guides for provisioning your first cloud resources and mastering the basics of Pulumi +type: page +layout: start-now-progressive +no_on_this_page: true +subtitle: Step-by-step guides for provisioning your first cloud resources and mastering the basics of Pulumi + +cloud_providers: + items: + - name: Amazon Web Services + logo: /logos/pkg/aws.svg + link: /start-now-2/aws/ + - name: Microsoft Azure + logo: /logos/pkg/azure.svg + link: /start-now-2/azure/ + - name: Google Cloud + logo: /logos/pkg/gcp.svg + link: /start-now-2/gcp/ + - name: Kubernetes + logo: /logos/pkg/kubernetes.svg + link: /start-now-2/kubernetes/ + - name: Oracle Cloud + logo: /logos/pkg/oci.svg + link: /start-now-2/oci/ +--- diff --git a/content/start-now-2/aws/_index.md b/content/start-now-2/aws/_index.md new file mode 100644 index 000000000000..9b0523093664 --- /dev/null +++ b/content/start-now-2/aws/_index.md @@ -0,0 +1,599 @@ +--- +title: Get Started with Pulumi and AWS +meta_desc: Deploy AWS infrastructure with Pulumi using your favorite programming language +type: page +layout: cloud-progressive +no_on_this_page: true + +cloud_name: AWS +subtitle: Choose your language and deploy AWS infrastructure in minutes +--- + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +## Get Started with TypeScript + +Build AWS infrastructure using TypeScript's type safety and modern JavaScript features. + +### Prerequisites + +- [Node.js](https://nodejs.org/) version 14 or later +- [AWS Account](https://aws.amazon.com/free/) +- AWS credentials configured + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir aws-quickstart && cd aws-quickstart +pulumi new aws-typescript +``` + +This creates a new Pulumi project with TypeScript configured for AWS. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as aws from "@pulumi/aws"; + +// Create an S3 bucket +const bucket = new aws.s3.Bucket("my-bucket", { + website: { + indexDocument: "index.html", + }, +}); + +// Export the bucket name and URL +export const bucketName = bucket.id; +export const bucketUrl = pulumi.interpolate`http://${bucket.websiteEndpoint}`; +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete AWS TypeScript Tutorial →](/docs/iac/get-started/aws/) +- [Browse AWS TypeScript Examples →](https://github.com/pulumi/examples#typescript) +- [Learn Pulumi TypeScript Concepts →](/docs/iac/concepts/languages/javascript/) + +{{% /choosable %}} + +{{% choosable language python %}} + +## Get Started with Python + +Build AWS infrastructure using Python's simplicity and extensive ecosystem. + +### Prerequisites + +- [Python](https://www.python.org/) 3.8 or later +- [AWS Account](https://aws.amazon.com/free/) +- AWS credentials configured + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir aws-quickstart && cd aws-quickstart +pulumi new aws-python +``` + +This creates a new Pulumi project with Python configured for AWS. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```python +import pulumi +import pulumi_aws as aws + +# Create an S3 bucket +bucket = aws.s3.Bucket("my-bucket", + website=aws.s3.BucketWebsiteArgs( + index_document="index.html" + )) + +# Export the bucket name and URL +pulumi.export("bucket_name", bucket.id) +pulumi.export("bucket_url", pulumi.Output.concat("http://", bucket.website_endpoint)) +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete AWS Python Tutorial →](/docs/iac/get-started/aws/) +- [Browse AWS Python Examples →](https://github.com/pulumi/examples#python) +- [Learn Pulumi Python Concepts →](/docs/iac/concepts/languages/python/) + +{{% /choosable %}} + +{{% choosable language go %}} + +## Get Started with Go + +Build AWS infrastructure using Go's performance and strong typing. + +### Prerequisites + +- [Go](https://golang.org/) 1.20 or later +- [AWS Account](https://aws.amazon.com/free/) +- AWS credentials configured + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir aws-quickstart && cd aws-quickstart +pulumi new aws-go +``` + +This creates a new Pulumi project with Go configured for AWS. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```go +package main + +import ( + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create an S3 bucket + bucket, err := s3.NewBucket(ctx, "my-bucket", &s3.BucketArgs{ + Website: &s3.BucketWebsiteArgs{ + IndexDocument: pulumi.String("index.html"), + }, + }) + if err != nil { + return err + } + + // Export the bucket name and URL + ctx.Export("bucketName", bucket.ID()) + ctx.Export("bucketUrl", pulumi.Sprintf("http://%s", bucket.WebsiteEndpoint)) + return nil + }) +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete AWS Go Tutorial →](/docs/iac/get-started/aws/) +- [Browse AWS Go Examples →](https://github.com/pulumi/examples#go) +- [Learn Pulumi Go Concepts →](/docs/iac/concepts/languages/go/) + +{{% /choosable %}} + +{{% choosable language csharp %}} + +## Get Started with C\# + +Build AWS infrastructure using C# and the .NET ecosystem. + +### Prerequisites + +- [.NET](https://dotnet.microsoft.com/) 6.0 or later +- [AWS Account](https://aws.amazon.com/free/) +- AWS credentials configured + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir aws-quickstart && cd aws-quickstart +pulumi new aws-csharp +``` + +This creates a new Pulumi project with C# configured for AWS. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```csharp +using Pulumi; +using Pulumi.Aws.S3; + +class MyStack : Stack +{ + public MyStack() + { + // Create an S3 bucket + var bucket = new Bucket("my-bucket", new BucketArgs + { + Website = new BucketWebsiteArgs + { + IndexDocument = "index.html" + } + }); + + // Export the bucket name and URL + this.BucketName = bucket.Id; + this.BucketUrl = Output.Format($"http://{bucket.WebsiteEndpoint}"); + } + + [Output] + public Output BucketName { get; set; } + + [Output] + public Output BucketUrl { get; set; } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete AWS C# Tutorial →](/docs/iac/get-started/aws/) +- [Browse AWS C# Examples →](https://github.com/pulumi/examples#dotnet) +- [Learn Pulumi C# Concepts →](/docs/iac/concepts/languages/dotnet/) + +{{% /choosable %}} + +{{% choosable language java %}} + +## Get Started with Java + +Build AWS infrastructure using Java's maturity and enterprise ecosystem. + +### Prerequisites + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later +- [AWS Account](https://aws.amazon.com/free/) +- AWS credentials configured + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir aws-quickstart && cd aws-quickstart +pulumi new aws-java +``` + +This creates a new Pulumi project with Java configured for AWS. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.aws.s3.Bucket; +import com.pulumi.aws.s3.BucketArgs; +import com.pulumi.aws.s3.inputs.BucketWebsiteArgs; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Create an S3 bucket + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .website(BucketWebsiteArgs.builder() + .indexDocument("index.html") + .build()) + .build()); + + // Export the bucket name and URL + ctx.export("bucketName", bucket.id()); + ctx.export("bucketUrl", bucket.websiteEndpoint() + .applyValue(endpoint -> String.format("http://%s", endpoint))); + } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete AWS Java Tutorial →](/docs/iac/get-started/aws/) +- [Browse AWS Java Examples →](https://github.com/pulumi/examples#java) +- [Learn Pulumi Java Concepts →](/docs/iac/concepts/languages/java/) + +{{% /choosable %}} + +{{% choosable language yaml %}} + +## Get Started with YAML + +Build AWS infrastructure using simple, declarative YAML configuration. + +### Prerequisites + +- [AWS Account](https://aws.amazon.com/free/) +- AWS credentials configured + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir aws-quickstart && cd aws-quickstart +pulumi new aws-yaml +``` + +This creates a new Pulumi project with YAML configured for AWS. + +#### 4. Deploy Infrastructure + +Your project includes example YAML to create an S3 bucket: + +```yaml +name: aws-quickstart +runtime: yaml + +resources: + # Create an S3 bucket + my-bucket: + type: aws:s3:Bucket + properties: + website: + indexDocument: index.html + +outputs: + # Export the bucket name and URL + bucketName: ${my-bucket.id} + bucketUrl: http://${my-bucket.websiteEndpoint} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete AWS YAML Tutorial →](/docs/iac/get-started/aws/) +- [Browse AWS YAML Examples →](https://github.com/pulumi/examples#yaml) +- [Learn Pulumi YAML Concepts →](/docs/iac/concepts/languages/yaml/) + +{{% /choosable %}} diff --git a/content/start-now-2/azure/_index.md b/content/start-now-2/azure/_index.md new file mode 100644 index 000000000000..6aa78595b2d6 --- /dev/null +++ b/content/start-now-2/azure/_index.md @@ -0,0 +1,633 @@ +--- +title: Get Started with Pulumi and Azure +meta_desc: Deploy Azure infrastructure with Pulumi using your favorite programming language +type: page +layout: cloud-progressive +no_on_this_page: true + +cloud_name: Azure +subtitle: Choose your language and deploy Azure infrastructure in minutes +--- + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +## Get Started with TypeScript + +Build Azure infrastructure using TypeScript's type safety and modern JavaScript features. + +### Prerequisites + +- [Node.js](https://nodejs.org/) version 14 or later +- [Azure Account](https://azure.microsoft.com/free/) +- Azure CLI configured (`az login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir azure-quickstart && cd azure-quickstart +pulumi new azure-typescript +``` + +This creates a new Pulumi project with TypeScript configured for Azure. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage Account: + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as azure from "@pulumi/azure-native"; + +// Create a Resource Group +const resourceGroup = new azure.resources.ResourceGroup("myResourceGroup"); + +// Create a Storage Account +const storageAccount = new azure.storage.StorageAccount("mystorageacct", { + resourceGroupName: resourceGroup.name, + sku: { + name: azure.storage.SkuName.Standard_LRS, + }, + kind: azure.storage.Kind.StorageV2, +}); + +// Export the primary storage key +export const primaryStorageKey = pulumi.secret(storageAccount.primaryAccessKey); +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Azure TypeScript Tutorial →](/docs/iac/get-started/azure/) +- [Browse Azure TypeScript Examples →](https://github.com/pulumi/examples#typescript) +- [Learn Pulumi TypeScript Concepts →](/docs/iac/concepts/languages/javascript/) + +{{% /choosable %}} + +{{% choosable language python %}} + +## Get Started with Python + +Build Azure infrastructure using Python's simplicity and extensive ecosystem. + +### Prerequisites + +- [Python](https://www.python.org/) 3.8 or later +- [Azure Account](https://azure.microsoft.com/free/) +- Azure CLI configured (`az login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir azure-quickstart && cd azure-quickstart +pulumi new azure-python +``` + +This creates a new Pulumi project with Python configured for Azure. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage Account: + +```python +import pulumi +from pulumi_azure_native import resources, storage + +# Create a Resource Group +resource_group = resources.ResourceGroup("myResourceGroup") + +# Create a Storage Account +storage_account = storage.StorageAccount( + "mystorageacct", + resource_group_name=resource_group.name, + sku=storage.SkuArgs( + name=storage.SkuName.STANDARD_LRS + ), + kind=storage.Kind.STORAGE_V2 +) + +# Export the primary storage key +pulumi.export("primary_storage_key", + pulumi.Output.secret(storage_account.primary_access_key)) +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Azure Python Tutorial →](/docs/iac/get-started/azure/) +- [Browse Azure Python Examples →](https://github.com/pulumi/examples#python) +- [Learn Pulumi Python Concepts →](/docs/iac/concepts/languages/python/) + +{{% /choosable %}} + +{{% choosable language go %}} + +## Get Started with Go + +Build Azure infrastructure using Go's performance and strong typing. + +### Prerequisites + +- [Go](https://golang.org/) 1.20 or later +- [Azure Account](https://azure.microsoft.com/free/) +- Azure CLI configured (`az login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir azure-quickstart && cd azure-quickstart +pulumi new azure-go +``` + +This creates a new Pulumi project with Go configured for Azure. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage Account: + +```go +package main + +import ( + "github.com/pulumi/pulumi-azure-native/sdk/v2/go/azure/resources" + "github.com/pulumi/pulumi-azure-native/sdk/v2/go/azure/storage" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create a Resource Group + resourceGroup, err := resources.NewResourceGroup(ctx, "myResourceGroup", nil) + if err != nil { + return err + } + + // Create a Storage Account + storageAccount, err := storage.NewStorageAccount(ctx, "mystorageacct", &storage.StorageAccountArgs{ + ResourceGroupName: resourceGroup.Name, + Sku: &storage.SkuArgs{ + Name: pulumi.String("Standard_LRS"), + }, + Kind: pulumi.String("StorageV2"), + }) + if err != nil { + return err + } + + // Export the primary storage key + ctx.Export("primaryStorageKey", pulumi.ToSecret(storageAccount.PrimaryAccessKey)) + return nil + }) +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Azure Go Tutorial →](/docs/iac/get-started/azure/) +- [Browse Azure Go Examples →](https://github.com/pulumi/examples#go) +- [Learn Pulumi Go Concepts →](/docs/iac/concepts/languages/go/) + +{{% /choosable %}} + +{{% choosable language csharp %}} + +## Get Started with C\# + +Build Azure infrastructure using C# and the .NET ecosystem. + +### Prerequisites + +- [.NET](https://dotnet.microsoft.com/) 6.0 or later +- [Azure Account](https://azure.microsoft.com/free/) +- Azure CLI configured (`az login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir azure-quickstart && cd azure-quickstart +pulumi new azure-csharp +``` + +This creates a new Pulumi project with C# configured for Azure. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage Account: + +```csharp +using Pulumi; +using Pulumi.AzureNative.Resources; +using Pulumi.AzureNative.Storage; +using Pulumi.AzureNative.Storage.Inputs; + +class MyStack : Stack +{ + public MyStack() + { + // Create a Resource Group + var resourceGroup = new ResourceGroup("myResourceGroup"); + + // Create a Storage Account + var storageAccount = new StorageAccount("mystorageacct", new StorageAccountArgs + { + ResourceGroupName = resourceGroup.Name, + Sku = new SkuArgs + { + Name = SkuName.Standard_LRS + }, + Kind = Kind.StorageV2 + }); + + // Export the primary storage key + this.PrimaryStorageKey = Output.CreateSecret(storageAccount.PrimaryAccessKey); + } + + [Output] + public Output PrimaryStorageKey { get; set; } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Azure C# Tutorial →](/docs/iac/get-started/azure/) +- [Browse Azure C# Examples →](https://github.com/pulumi/examples#dotnet) +- [Learn Pulumi C# Concepts →](/docs/iac/concepts/languages/dotnet/) + +{{% /choosable %}} + +{{% choosable language java %}} + +## Get Started with Java + +Build Azure infrastructure using Java's maturity and enterprise ecosystem. + +### Prerequisites + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later +- [Azure Account](https://azure.microsoft.com/free/) +- Azure CLI configured (`az login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir azure-quickstart && cd azure-quickstart +pulumi new azure-java +``` + +This creates a new Pulumi project with Java configured for Azure. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage Account: + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.azurenative.resources.ResourceGroup; +import com.pulumi.azurenative.storage.StorageAccount; +import com.pulumi.azurenative.storage.StorageAccountArgs; +import com.pulumi.azurenative.storage.inputs.SkuArgs; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Create a Resource Group + var resourceGroup = new ResourceGroup("myResourceGroup"); + + // Create a Storage Account + var storageAccount = new StorageAccount("mystorageacct", StorageAccountArgs.builder() + .resourceGroupName(resourceGroup.name()) + .sku(SkuArgs.builder() + .name("Standard_LRS") + .build()) + .kind("StorageV2") + .build()); + + // Export the primary storage key + ctx.export("primaryStorageKey", + storageAccount.primaryAccessKey().applyValue(key -> key)); + } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Azure Java Tutorial →](/docs/iac/get-started/azure/) +- [Browse Azure Java Examples →](https://github.com/pulumi/examples#java) +- [Learn Pulumi Java Concepts →](/docs/iac/concepts/languages/java/) + +{{% /choosable %}} + +{{% choosable language yaml %}} + +## Get Started with YAML + +Build Azure infrastructure using simple, declarative YAML configuration. + +### Prerequisites + +- [Azure Account](https://azure.microsoft.com/free/) +- Azure CLI configured (`az login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir azure-quickstart && cd azure-quickstart +pulumi new azure-yaml +``` + +This creates a new Pulumi project with YAML configured for Azure. + +#### 4. Deploy Infrastructure + +Your project includes example YAML to create a Storage Account: + +```yaml +name: azure-quickstart +runtime: yaml + +resources: + # Create a Resource Group + myResourceGroup: + type: azure-native:resources:ResourceGroup + + # Create a Storage Account + myStorageAccount: + type: azure-native:storage:StorageAccount + properties: + resourceGroupName: ${myResourceGroup.name} + sku: + name: Standard_LRS + kind: StorageV2 + +outputs: + # Export the primary storage key + primaryStorageKey: + value: ${myStorageAccount.primaryAccessKey} + secret: true +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Azure YAML Tutorial →](/docs/iac/get-started/azure/) +- [Browse Azure YAML Examples →](https://github.com/pulumi/examples#yaml) +- [Learn Pulumi YAML Concepts →](/docs/iac/concepts/languages/yaml/) + +{{% /choosable %}} diff --git a/content/start-now-2/gcp/_index.md b/content/start-now-2/gcp/_index.md new file mode 100644 index 000000000000..40938ab96d86 --- /dev/null +++ b/content/start-now-2/gcp/_index.md @@ -0,0 +1,605 @@ +--- +title: Get Started with Pulumi and Google Cloud +meta_desc: Deploy Google Cloud infrastructure with Pulumi using your favorite programming language +type: page +layout: cloud-progressive +no_on_this_page: true + +cloud_name: Google Cloud +subtitle: Choose your language and deploy Google Cloud infrastructure in minutes +--- + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +## Get Started with TypeScript + +Build Google Cloud infrastructure using TypeScript's type safety and modern JavaScript features. + +### Prerequisites + +- [Node.js](https://nodejs.org/) version 14 or later +- [GCP Account](https://cloud.google.com/free/) +- Google Cloud CLI configured (`gcloud auth login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir gcp-quickstart && cd gcp-quickstart +pulumi new gcp-typescript +``` + +This creates a new Pulumi project with TypeScript configured for Google Cloud. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage bucket: + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as gcp from "@pulumi/gcp"; + +// Create a GCP Storage bucket +const bucket = new gcp.storage.Bucket("my-bucket", { + location: "US", + website: { + mainPageSuffix: "index.html", + }, +}); + +// Export the bucket name and URL +export const bucketName = bucket.name; +export const bucketUrl = pulumi.interpolate`gs://${bucket.name}`; +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Google Cloud TypeScript Tutorial →](/docs/iac/get-started/gcp/) +- [Browse Google Cloud TypeScript Examples →](https://github.com/pulumi/examples#typescript) +- [Learn Pulumi TypeScript Concepts →](/docs/iac/concepts/languages/javascript/) + +{{% /choosable %}} + +{{% choosable language python %}} + +## Get Started with Python + +Build Google Cloud infrastructure using Python's simplicity and extensive ecosystem. + +### Prerequisites + +- [Python](https://www.python.org/) 3.8 or later +- [GCP Account](https://cloud.google.com/free/) +- Google Cloud CLI configured (`gcloud auth login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir gcp-quickstart && cd gcp-quickstart +pulumi new gcp-python +``` + +This creates a new Pulumi project with Python configured for Google Cloud. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage bucket: + +```python +import pulumi +import pulumi_gcp as gcp + +# Create a GCP Storage bucket +bucket = gcp.storage.Bucket("my-bucket", + location="US", + website=gcp.storage.BucketWebsiteArgs( + main_page_suffix="index.html" + )) + +# Export the bucket name and URL +pulumi.export("bucket_name", bucket.name) +pulumi.export("bucket_url", pulumi.Output.concat("gs://", bucket.name)) +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Google Cloud Python Tutorial →](/docs/iac/get-started/gcp/) +- [Browse Google Cloud Python Examples →](https://github.com/pulumi/examples#python) +- [Learn Pulumi Python Concepts →](/docs/iac/concepts/languages/python/) + +{{% /choosable %}} + +{{% choosable language go %}} + +## Get Started with Go + +Build Google Cloud infrastructure using Go's performance and strong typing. + +### Prerequisites + +- [Go](https://golang.org/) 1.20 or later +- [GCP Account](https://cloud.google.com/free/) +- Google Cloud CLI configured (`gcloud auth login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir gcp-quickstart && cd gcp-quickstart +pulumi new gcp-go +``` + +This creates a new Pulumi project with Go configured for Google Cloud. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage bucket: + +```go +package main + +import ( + "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create a GCP Storage bucket + bucket, err := storage.NewBucket(ctx, "my-bucket", &storage.BucketArgs{ + Location: pulumi.String("US"), + Website: &storage.BucketWebsiteArgs{ + MainPageSuffix: pulumi.String("index.html"), + }, + }) + if err != nil { + return err + } + + // Export the bucket name and URL + ctx.Export("bucketName", bucket.Name) + ctx.Export("bucketUrl", pulumi.Sprintf("gs://%s", bucket.Name)) + return nil + }) +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Google Cloud Go Tutorial →](/docs/iac/get-started/gcp/) +- [Browse Google Cloud Go Examples →](https://github.com/pulumi/examples#go) +- [Learn Pulumi Go Concepts →](/docs/iac/concepts/languages/go/) + +{{% /choosable %}} + +{{% choosable language csharp %}} + +## Get Started with C\# + +Build Google Cloud infrastructure using C# and the .NET ecosystem. + +### Prerequisites + +- [.NET](https://dotnet.microsoft.com/) 6.0 or later +- [GCP Account](https://cloud.google.com/free/) +- Google Cloud CLI configured (`gcloud auth login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir gcp-quickstart && cd gcp-quickstart +pulumi new gcp-csharp +``` + +This creates a new Pulumi project with C# configured for Google Cloud. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage bucket: + +```csharp +using Pulumi; +using Pulumi.Gcp.Storage; + +class MyStack : Stack +{ + public MyStack() + { + // Create a GCP Storage bucket + var bucket = new Bucket("my-bucket", new BucketArgs + { + Location = "US", + Website = new BucketWebsiteArgs + { + MainPageSuffix = "index.html" + } + }); + + // Export the bucket name and URL + this.BucketName = bucket.Name; + this.BucketUrl = Output.Format($"gs://{bucket.Name}"); + } + + [Output] + public Output BucketName { get; set; } + + [Output] + public Output BucketUrl { get; set; } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Google Cloud C# Tutorial →](/docs/iac/get-started/gcp/) +- [Browse Google Cloud C# Examples →](https://github.com/pulumi/examples#dotnet) +- [Learn Pulumi C# Concepts →](/docs/iac/concepts/languages/dotnet/) + +{{% /choosable %}} + +{{% choosable language java %}} + +## Get Started with Java + +Build Google Cloud infrastructure using Java's maturity and enterprise ecosystem. + +### Prerequisites + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later +- [GCP Account](https://cloud.google.com/free/) +- Google Cloud CLI configured (`gcloud auth login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir gcp-quickstart && cd gcp-quickstart +pulumi new gcp-java +``` + +This creates a new Pulumi project with Java configured for Google Cloud. + +#### 4. Deploy Infrastructure + +Your project includes example code to create a Storage bucket: + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.gcp.storage.Bucket; +import com.pulumi.gcp.storage.BucketArgs; +import com.pulumi.gcp.storage.inputs.BucketWebsiteArgs; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Create a GCP Storage bucket + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .location("US") + .website(BucketWebsiteArgs.builder() + .mainPageSuffix("index.html") + .build()) + .build()); + + // Export the bucket name and URL + ctx.export("bucketName", bucket.name()); + ctx.export("bucketUrl", bucket.name() + .applyValue(name -> String.format("gs://%s", name))); + } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Google Cloud Java Tutorial →](/docs/iac/get-started/gcp/) +- [Browse Google Cloud Java Examples →](https://github.com/pulumi/examples#java) +- [Learn Pulumi Java Concepts →](/docs/iac/concepts/languages/java/) + +{{% /choosable %}} + +{{% choosable language yaml %}} + +## Get Started with YAML + +Build Google Cloud infrastructure using simple, declarative YAML configuration. + +### Prerequisites + +- [GCP Account](https://cloud.google.com/free/) +- Google Cloud CLI configured (`gcloud auth login`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir gcp-quickstart && cd gcp-quickstart +pulumi new gcp-yaml +``` + +This creates a new Pulumi project with YAML configured for Google Cloud. + +#### 4. Deploy Infrastructure + +Your project includes example YAML to create a Storage bucket: + +```yaml +name: gcp-quickstart +runtime: yaml + +resources: + # Create a GCP Storage bucket + my-bucket: + type: gcp:storage:Bucket + properties: + location: US + website: + mainPageSuffix: index.html + +outputs: + # Export the bucket name and URL + bucketName: ${my-bucket.name} + bucketUrl: gs://${my-bucket.name} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Google Cloud YAML Tutorial →](/docs/iac/get-started/gcp/) +- [Browse Google Cloud YAML Examples →](https://github.com/pulumi/examples#yaml) +- [Learn Pulumi YAML Concepts →](/docs/iac/concepts/languages/yaml/) + +{{% /choosable %}} diff --git a/content/start-now-2/kubernetes/_index.md b/content/start-now-2/kubernetes/_index.md new file mode 100644 index 000000000000..94ea1cc3a746 --- /dev/null +++ b/content/start-now-2/kubernetes/_index.md @@ -0,0 +1,621 @@ +--- +title: Get Started with Pulumi and Kubernetes +meta_desc: Deploy Kubernetes infrastructure with Pulumi using your favorite programming language +type: page +layout: cloud-progressive +no_on_this_page: true + +cloud_name: Kubernetes +subtitle: Choose your language and deploy Kubernetes infrastructure in minutes +--- + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +## Get Started with TypeScript + +Deploy to Kubernetes using TypeScript's type safety and modern JavaScript features. + +### Prerequisites + +- [Node.js](https://nodejs.org/) version 14 or later +- [Kubernetes cluster](https://kubernetes.io/docs/tasks/tools/) +- kubectl configured (`kubectl cluster-info`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir kubernetes-quickstart && cd kubernetes-quickstart +pulumi new kubernetes-typescript +``` + +This creates a new Pulumi project with TypeScript configured for Kubernetes. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as kubernetes from "@pulumi/kubernetes"; + +// Create an S3 bucket +const bucket = new kubernetes.s3.Bucket("my-bucket", { + website: { + indexDocument: "index.html", + }, +}); + +// Export the bucket name and URL +export const bucketName = bucket.id; +export const bucketUrl = pulumi.interpolate`http://${bucket.websiteEndpoint}`; +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Kubernetes TypeScript Tutorial →](/docs/iac/get-started/kubernetes/) +- [Browse Kubernetes TypeScript Examples →](https://github.com/pulumi/examples#typescript) +- [Learn Pulumi TypeScript Concepts →](/docs/iac/concepts/languages/javascript/) + +{{% /choosable %}} + +{{% choosable language python %}} + +## Get Started with Python + +Deploy to Kubernetes using Python's simplicity and extensive ecosystem. + +### Prerequisites + +- [Python](https://www.python.org/) 3.8 or later +- [Kubernetes cluster](https://kubernetes.io/docs/tasks/tools/) +- kubectl configured (`kubectl cluster-info`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir kubernetes-quickstart && cd kubernetes-quickstart +pulumi new kubernetes-python +``` + +This creates a new Pulumi project with Python configured for Kubernetes. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```python +import pulumi +import pulumi_kubernetes as kubernetes + +# Create an S3 bucket +bucket = kubernetes.s3.Bucket("my-bucket", + website=kubernetes.s3.BucketWebsiteArgs( + index_document="index.html" + )) + +# Export the bucket name and URL +pulumi.export("bucket_name", bucket.id) +pulumi.export("bucket_url", pulumi.Output.concat("http://", bucket.website_endpoint)) +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Kubernetes Python Tutorial →](/docs/iac/get-started/kubernetes/) +- [Browse Kubernetes Python Examples →](https://github.com/pulumi/examples#python) +- [Learn Pulumi Python Concepts →](/docs/iac/concepts/languages/python/) + +{{% /choosable %}} + +{{% choosable language go %}} + +## Get Started with Go + +Deploy to Kubernetes using Go's performance and strong typing. + +### Prerequisites + +- [Go](https://golang.org/) 1.20 or later +- [Kubernetes cluster](https://kubernetes.io/docs/tasks/tools/) +- kubectl configured (`kubectl cluster-info`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir kubernetes-quickstart && cd kubernetes-quickstart +pulumi new kubernetes-go +``` + +This creates a new Pulumi project with Go configured for Kubernetes. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```go +package main + +import ( + "github.com/pulumi/pulumi-kubernetes/sdk/v6/go/kubernetes/s3" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Create an S3 bucket + bucket, err := s3.NewBucket(ctx, "my-bucket", &s3.BucketArgs{ + Website: &s3.BucketWebsiteArgs{ + IndexDocument: pulumi.String("index.html"), + }, + }) + if err != nil { + return err + } + + // Export the bucket name and URL + ctx.Export("bucketName", bucket.ID()) + ctx.Export("bucketUrl", pulumi.Sprintf("http://%s", bucket.WebsiteEndpoint)) + return nil + }) +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Kubernetes Go Tutorial →](/docs/iac/get-started/kubernetes/) +- [Browse Kubernetes Go Examples →](https://github.com/pulumi/examples#go) +- [Learn Pulumi Go Concepts →](/docs/iac/concepts/languages/go/) + +{{% /choosable %}} + +{{% choosable language csharp %}} + +## Get Started with C\# + +Deploy to Kubernetes using C# and the .NET ecosystem. + +### Prerequisites + +- [.NET](https://dotnet.microsoft.com/) 6.0 or later +- [Kubernetes cluster](https://kubernetes.io/docs/tasks/tools/) +- kubectl configured (`kubectl cluster-info`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir kubernetes-quickstart && cd kubernetes-quickstart +pulumi new kubernetes-csharp +``` + +This creates a new Pulumi project with C# configured for Kubernetes. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```csharp +using Pulumi; +using Pulumi.Aws.S3; + +class MyStack : Stack +{ + public MyStack() + { + // Create an S3 bucket + var bucket = new Bucket("my-bucket", new BucketArgs + { + Website = new BucketWebsiteArgs + { + IndexDocument = "index.html" + } + }); + + // Export the bucket name and URL + this.BucketName = bucket.Id; + this.BucketUrl = Output.Format($"http://{bucket.WebsiteEndpoint}"); + } + + [Output] + public Output BucketName { get; set; } + + [Output] + public Output BucketUrl { get; set; } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Kubernetes C# Tutorial →](/docs/iac/get-started/kubernetes/) +- [Browse Kubernetes C# Examples →](https://github.com/pulumi/examples#dotnet) +- [Learn Pulumi C# Concepts →](/docs/iac/concepts/languages/dotnet/) + +{{% /choosable %}} + +{{% choosable language java %}} + +## Get Started with Java + +Deploy to Kubernetes using Java's maturity and enterprise ecosystem. + +### Prerequisites + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later +- [Kubernetes cluster](https://kubernetes.io/docs/tasks/tools/) +- kubectl configured (`kubectl cluster-info`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir kubernetes-quickstart && cd kubernetes-quickstart +pulumi new kubernetes-java +``` + +This creates a new Pulumi project with Java configured for Kubernetes. + +#### 4. Deploy Infrastructure + +Your project includes example code to create an S3 bucket: + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.kubernetes.s3.Bucket; +import com.pulumi.kubernetes.s3.BucketArgs; +import com.pulumi.kubernetes.s3.inputs.BucketWebsiteArgs; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Create an S3 bucket + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .website(BucketWebsiteArgs.builder() + .indexDocument("index.html") + .build()) + .build()); + + // Export the bucket name and URL + ctx.export("bucketName", bucket.id()); + ctx.export("bucketUrl", bucket.websiteEndpoint() + .applyValue(endpoint -> String.format("http://%s", endpoint))); + } +} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Kubernetes Java Tutorial →](/docs/iac/get-started/kubernetes/) +- [Browse Kubernetes Java Examples →](https://github.com/pulumi/examples#java) +- [Learn Pulumi Java Concepts →](/docs/iac/concepts/languages/java/) + +{{% /choosable %}} + +{{% choosable language yaml %}} + +## Get Started with YAML + +Deploy to Kubernetes using simple, declarative YAML configuration. + +### Prerequisites + +- [Kubernetes cluster](https://kubernetes.io/docs/tasks/tools/) +- kubectl configured (`kubectl cluster-info`) + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +{{% /choosable %}} +{{< /chooser >}} + +#### 3. Create Your First Project + +```bash +mkdir kubernetes-quickstart && cd kubernetes-quickstart +pulumi new kubernetes-yaml +``` + +This creates a new Pulumi project with YAML configured for Kubernetes. + +#### 4. Deploy Infrastructure + +Your project includes example YAML to deploy an application: + +```yaml +name: kubernetes-quickstart +runtime: yaml + +resources: + # Create a Kubernetes Deployment + nginx-deployment: + type: kubernetes:apps/v1:Deployment + properties: + spec: + selector: + matchLabels: + app: nginx + replicas: 2 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 + + # Create a Service + nginx-service: + type: kubernetes:core/v1:Service + properties: + spec: + selector: + app: nginx + ports: + - port: 80 + type: LoadBalancer + +outputs: + serviceName: ${nginx-service.metadata.name} +``` + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete Kubernetes YAML Tutorial →](/docs/iac/get-started/kubernetes/) +- [Browse Kubernetes YAML Examples →](https://github.com/pulumi/examples#yaml) +- [Learn Pulumi YAML Concepts →](/docs/iac/concepts/languages/yaml/) + +{{% /choosable %}} diff --git a/content/start-now-2/oci/_index.md b/content/start-now-2/oci/_index.md new file mode 100644 index 000000000000..b4095d7d74b1 --- /dev/null +++ b/content/start-now-2/oci/_index.md @@ -0,0 +1,1130 @@ +--- +title: Get Started with Pulumi and Oracle Cloud +meta_desc: Create, deploy, and manage infrastructure on Oracle Cloud Infrastructure using Pulumi - progressive guide with language-specific examples +type: page +layout: cloud-progressive +no_on_this_page: true + +cloud_name: Oracle Cloud +subtitle: Choose your language and deploy Oracle Cloud infrastructure in minutes +--- + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +## Get Started with TypeScript + +Build Oracle Cloud infrastructure using familiar TypeScript syntax and tooling. + +### Prerequisites + +- **Node.js**: version 14 or later ([install](https://nodejs.org/)) +- **Oracle Cloud account**: [Sign up for free tier](https://signup.cloud.oracle.com/) +- **OCI credentials**: configured locally + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +{{% /choosable %}} + +#### 3. Configure OCI Access + +##### 1. Install OCI CLI + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +##### 2. Configure Credentials + +```bash +oci setup config +``` + +This will prompt for: + +- User OCID: `ocid1.user.oc1..xxxxx` +- Tenancy OCID: `ocid1.tenancy.oc1..xxxxx` +- Region: `us-ashburn-1` +- Path to your API signing key + +Verify: + +```bash +oci iam region list +``` + +#### 4. Create Your First Project + +##### 1. New Project + +```bash +mkdir pulumi-oci-quickstart +cd pulumi-oci-quickstart +pulumi new oci-typescript +``` + +##### 2. Project Structure + +``` +pulumi-oci-quickstart/ +├── Pulumi.yaml # Project metadata +├── Pulumi.dev.yaml # Stack configuration +├── index.ts # Infrastructure code +├── package.json # Node dependencies +└── tsconfig.json # TypeScript config +``` + +##### 3. Define Infrastructure + +Replace `index.ts` with: + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as oci from "@pulumi/oci"; + +// Get configuration +const config = new pulumi.Config(); +const compartmentId = config.require("compartmentId"); + +// Create a VCN (Virtual Cloud Network) +const vcn = new oci.core.Vcn("my-vcn", { + compartmentId: compartmentId, + cidrBlocks: ["10.0.0.0/16"], + displayName: "my-vcn", + dnsLabel: "myvcn", +}); + +// Create an Internet Gateway +const internetGateway = new oci.core.InternetGateway("my-internet-gateway", { + compartmentId: compartmentId, + vcnId: vcn.id, + displayName: "my-internet-gateway", + enabled: true, +}); + +// Create an Object Storage bucket +const namespace = oci.objectstorage.getNamespaceOutput(); +const bucket = new oci.objectstorage.Bucket("my-bucket", { + compartmentId: compartmentId, + namespace: namespace.namespace, + name: `my-pulumi-bucket-${Date.now()}`, + accessType: "ObjectRead", +}); + +// Export the outputs +export const vcnId = vcn.id; +export const vcnCidrBlock = vcn.cidrBlocks[0]; +export const bucketName = bucket.name; +export const bucketNamespace = bucket.namespace; +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +##### 4. Deploy Infrastructure + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of resources to be created +2. Asks for your confirmation +3. Creates the VCN and bucket in OCI +4. Outputs the resource IDs + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete OCI TypeScript Tutorial →](/docs/iac/get-started/oci/) +- [Browse OCI TypeScript Examples →](https://github.com/pulumi/examples#oracle-cloud-infrastructure) +- [Learn TypeScript with Pulumi →](/docs/iac/concepts/languages/javascript/) + +{{% /choosable %}} + +{{% choosable language python %}} + +## Get Started with Python + +Build Oracle Cloud infrastructure using familiar Python syntax and tooling. + +### Prerequisites + +- **Python**: version 3.8 or later ([install](https://www.python.org/)) +- **Oracle Cloud account**: [Sign up for free tier](https://signup.cloud.oracle.com/) +- **OCI credentials**: configured locally + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +{{% /choosable %}} + +#### 3. Configure OCI Access + +##### 1. Install OCI CLI + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +##### 2. Configure Credentials + +```bash +oci setup config +``` + +This will prompt for: + +- User OCID: `ocid1.user.oc1..xxxxx` +- Tenancy OCID: `ocid1.tenancy.oc1..xxxxx` +- Region: `us-ashburn-1` +- Path to your API signing key + +Verify: + +```bash +oci iam region list +``` + +#### 4. Create Your First Project + +##### 1. New Project + +```bash +mkdir pulumi-oci-quickstart +cd pulumi-oci-quickstart +pulumi new oci-python +``` + +##### 2. Project Structure + +``` +pulumi-oci-quickstart/ +├── Pulumi.yaml # Project metadata +├── Pulumi.dev.yaml # Stack configuration +├── __main__.py # Infrastructure code +├── requirements.txt # Python dependencies +└── venv/ # Virtual environment +``` + +##### 3. Define Infrastructure + +Replace `__main__.py` with: + +```python +"""An Oracle Cloud Python Pulumi program""" + +import pulumi +from pulumi import Config +import pulumi_oci as oci + +# Get configuration +config = Config() +compartment_id = config.require("compartmentId") + +# Create a VCN (Virtual Cloud Network) +vcn = oci.core.Vcn("my-vcn", + compartment_id=compartment_id, + cidr_blocks=["10.0.0.0/16"], + display_name="my-vcn", + dns_label="myvcn" +) + +# Create an Internet Gateway +internet_gateway = oci.core.InternetGateway("my-internet-gateway", + compartment_id=compartment_id, + vcn_id=vcn.id, + display_name="my-internet-gateway", + enabled=True +) + +# Get the namespace for Object Storage +namespace = oci.objectstorage.get_namespace() + +# Create an Object Storage bucket +import time +bucket = oci.objectstorage.Bucket("my-bucket", + compartment_id=compartment_id, + namespace=namespace.namespace, + name=f"my-pulumi-bucket-{int(time.time())}", + access_type="ObjectRead" +) + +# Export the outputs +pulumi.export("vcn_id", vcn.id) +pulumi.export("vcn_cidr_block", vcn.cidr_blocks[0]) +pulumi.export("bucket_name", bucket.name) +pulumi.export("bucket_namespace", bucket.namespace) +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +##### 4. Deploy Infrastructure + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of resources to be created +2. Asks for your confirmation +3. Creates the VCN and bucket in OCI +4. Outputs the resource IDs + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete OCI Python Tutorial →](/docs/iac/get-started/oci/) +- [Browse OCI Python Examples →](https://github.com/pulumi/examples#oracle-cloud-infrastructure) +- [Learn Python with Pulumi →](/docs/iac/concepts/languages/python/) + +{{% /choosable %}} + +{{% choosable language go %}} + +## Get Started with Go + +Build Oracle Cloud infrastructure using Go's type safety and performance. + +### Prerequisites + +- **Go**: version 1.20 or later ([install](https://golang.org/)) +- **Oracle Cloud account**: [Sign up for free tier](https://signup.cloud.oracle.com/) +- **OCI credentials**: configured locally + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +{{% /choosable %}} + +#### 3. Configure OCI Access + +##### 1. Install OCI CLI + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +##### 2. Configure Credentials + +```bash +oci setup config +``` + +This will prompt for: + +- User OCID: `ocid1.user.oc1..xxxxx` +- Tenancy OCID: `ocid1.tenancy.oc1..xxxxx` +- Region: `us-ashburn-1` +- Path to your API signing key + +Verify: + +```bash +oci iam region list +``` + +#### 4. Create Your First Project + +##### 1. New Project + +```bash +mkdir pulumi-oci-quickstart +cd pulumi-oci-quickstart +pulumi new oci-go +``` + +##### 2. Project Structure + +``` +pulumi-oci-quickstart/ +├── Pulumi.yaml # Project metadata +├── Pulumi.dev.yaml # Stack configuration +├── main.go # Infrastructure code +├── go.mod # Go module file +└── go.sum # Go dependencies +``` + +##### 3. Define Infrastructure + +Replace `main.go` with: + +```go +package main + +import ( + "fmt" + "time" + + "github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core" + "github.com/pulumi/pulumi-oci/sdk/v2/go/oci/objectstorage" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Get configuration + cfg := config.New(ctx, "") + compartmentId := cfg.Require("compartmentId") + + // Create a VCN (Virtual Cloud Network) + vcn, err := core.NewVcn(ctx, "my-vcn", &core.VcnArgs{ + CompartmentId: pulumi.String(compartmentId), + CidrBlocks: pulumi.StringArray{ + pulumi.String("10.0.0.0/16"), + }, + DisplayName: pulumi.String("my-vcn"), + DnsLabel: pulumi.String("myvcn"), + }) + if err != nil { + return err + } + + // Create an Internet Gateway + _, err = core.NewInternetGateway(ctx, "my-internet-gateway", &core.InternetGatewayArgs{ + CompartmentId: pulumi.String(compartmentId), + VcnId: vcn.ID(), + DisplayName: pulumi.String("my-internet-gateway"), + Enabled: pulumi.Bool(true), + }) + if err != nil { + return err + } + + // Get the namespace for Object Storage + namespace, err := objectstorage.GetNamespace(ctx, nil) + if err != nil { + return err + } + + // Create an Object Storage bucket + bucketName := fmt.Sprintf("my-pulumi-bucket-%d", time.Now().Unix()) + bucket, err := objectstorage.NewBucket(ctx, "my-bucket", &objectstorage.BucketArgs{ + CompartmentId: pulumi.String(compartmentId), + Namespace: pulumi.String(namespace.Namespace), + Name: pulumi.String(bucketName), + AccessType: pulumi.String("ObjectRead"), + }) + if err != nil { + return err + } + + // Export the outputs + ctx.Export("vcnId", vcn.ID()) + ctx.Export("vcnCidrBlock", vcn.CidrBlocks.Index(pulumi.Int(0))) + ctx.Export("bucketName", bucket.Name) + ctx.Export("bucketNamespace", bucket.Namespace) + + return nil + }) +} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +##### 4. Deploy Infrastructure + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of resources to be created +2. Asks for your confirmation +3. Creates the VCN and bucket in OCI +4. Outputs the resource IDs + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete OCI Go Tutorial →](/docs/iac/get-started/oci/) +- [Browse OCI Go Examples →](https://github.com/pulumi/examples#oracle-cloud-infrastructure) +- [Learn Go with Pulumi →](/docs/iac/concepts/languages/go/) + +{{% /choosable %}} + +{{% choosable language csharp %}} + +## Get Started with C\# + +Build Oracle Cloud infrastructure using C# and .NET ecosystem. + +### Prerequisites + +- **.NET SDK**: version 6.0 or later ([install](https://dotnet.microsoft.com/)) +- **Oracle Cloud account**: [Sign up for free tier](https://signup.cloud.oracle.com/) +- **OCI credentials**: configured locally + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +{{% /choosable %}} + +#### 3. Configure OCI Access + +##### 1. Install OCI CLI + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +##### 2. Configure Credentials + +```bash +oci setup config +``` + +This will prompt for: + +- User OCID: `ocid1.user.oc1..xxxxx` +- Tenancy OCID: `ocid1.tenancy.oc1..xxxxx` +- Region: `us-ashburn-1` +- Path to your API signing key + +Verify: + +```bash +oci iam region list +``` + +#### 4. Create Your First Project + +##### 1. New Project + +```bash +mkdir pulumi-oci-quickstart +cd pulumi-oci-quickstart +pulumi new oci-csharp +``` + +##### 2. Project Structure + +``` +pulumi-oci-quickstart/ +├── Pulumi.yaml # Project metadata +├── Pulumi.dev.yaml # Stack configuration +├── Program.cs # Infrastructure code +├── pulumi-oci-quickstart.csproj # .NET project file +``` + +##### 3. Define Infrastructure + +Replace `Program.cs` with: + +```csharp +using System; +using System.Threading.Tasks; +using Pulumi; +using Pulumi.Oci.Core; +using Pulumi.Oci.Core.Inputs; +using Pulumi.Oci.ObjectStorage; + +class Program +{ + static Task Main() => Deployment.RunAsync(); +} + +class MyStack : Stack +{ + public MyStack() + { + // Get configuration + var config = new Config(); + var compartmentId = config.Require("compartmentId"); + + // Create a VCN (Virtual Cloud Network) + var vcn = new Vcn("my-vcn", new VcnArgs + { + CompartmentId = compartmentId, + CidrBlocks = new[] { "10.0.0.0/16" }, + DisplayName = "my-vcn", + DnsLabel = "myvcn", + }); + + // Create an Internet Gateway + var internetGateway = new InternetGateway("my-internet-gateway", new InternetGatewayArgs + { + CompartmentId = compartmentId, + VcnId = vcn.Id, + DisplayName = "my-internet-gateway", + Enabled = true, + }); + + // Get the namespace for Object Storage + var @namespace = GetNamespace.Invoke(); + + // Create an Object Storage bucket + var bucketName = $"my-pulumi-bucket-{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}"; + var bucket = new Bucket("my-bucket", new BucketArgs + { + CompartmentId = compartmentId, + Namespace = @namespace.Apply(ns => ns.Namespace), + Name = bucketName, + AccessType = "ObjectRead", + }); + + // Export the outputs + this.VcnId = vcn.Id; + this.VcnCidrBlock = vcn.CidrBlocks.GetAt(0); + this.BucketName = bucket.Name; + this.BucketNamespace = bucket.Namespace; + } + + [Output] + public Output VcnId { get; set; } + + [Output] + public Output VcnCidrBlock { get; set; } + + [Output] + public Output BucketName { get; set; } + + [Output] + public Output BucketNamespace { get; set; } +} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +##### 4. Deploy Infrastructure + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of resources to be created +2. Asks for your confirmation +3. Creates the VCN and bucket in OCI +4. Outputs the resource IDs + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete OCI C# Tutorial →](/docs/iac/get-started/oci/) +- [Browse OCI C# Examples →](https://github.com/pulumi/examples#oracle-cloud-infrastructure) +- [Learn C# with Pulumi →](/docs/iac/concepts/languages/dotnet/) + +{{% /choosable %}} + +{{% choosable language java %}} + +## Get Started with Java + +Build Oracle Cloud infrastructure using Java and familiar build tools. + +### Prerequisites + +- **Java**: version 11 or later ([install](https://www.oracle.com/java/)) +- **Maven**: version 3.6.1 or later ([install](https://maven.apache.org/)) +- **Oracle Cloud account**: [Sign up for free tier](https://signup.cloud.oracle.com/) +- **OCI credentials**: configured locally + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +{{% /choosable %}} + +#### 3. Configure OCI Access + +##### 1. Install OCI CLI + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +##### 2. Configure Credentials + +```bash +oci setup config +``` + +This will prompt for: + +- User OCID: `ocid1.user.oc1..xxxxx` +- Tenancy OCID: `ocid1.tenancy.oc1..xxxxx` +- Region: `us-ashburn-1` +- Path to your API signing key + +Verify: + +```bash +oci iam region list +``` + +#### 4. Create Your First Project + +##### 1. New Project + +```bash +mkdir pulumi-oci-quickstart +cd pulumi-oci-quickstart +pulumi new oci-java +``` + +##### 2. Project Structure + +``` +pulumi-oci-quickstart/ +├── Pulumi.yaml # Project metadata +├── Pulumi.dev.yaml # Stack configuration +├── pom.xml # Maven configuration +└── src/ + └── main/ + └── java/ + └── myproject/ + └── App.java # Infrastructure code +``` + +##### 3. Define Infrastructure + +Replace `src/main/java/myproject/App.java` with: + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.oci.core.Vcn; +import com.pulumi.oci.core.VcnArgs; +import com.pulumi.oci.core.InternetGateway; +import com.pulumi.oci.core.InternetGatewayArgs; +import com.pulumi.oci.objectstorage.Bucket; +import com.pulumi.oci.objectstorage.BucketArgs; +import com.pulumi.oci.objectstorage.ObjectstorageFunctions; + +import java.util.List; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Get configuration + var config = ctx.config(); + var compartmentId = config.require("compartmentId"); + + // Create a VCN (Virtual Cloud Network) + var vcn = new Vcn("my-vcn", VcnArgs.builder() + .compartmentId(compartmentId) + .cidrBlocks("10.0.0.0/16") + .displayName("my-vcn") + .dnsLabel("myvcn") + .build()); + + // Create an Internet Gateway + var internetGateway = new InternetGateway("my-internet-gateway", InternetGatewayArgs.builder() + .compartmentId(compartmentId) + .vcnId(vcn.id()) + .displayName("my-internet-gateway") + .enabled(true) + .build()); + + // Get the namespace for Object Storage + var namespace = ObjectstorageFunctions.getNamespace(); + + // Create an Object Storage bucket + var bucketName = "my-pulumi-bucket-" + System.currentTimeMillis(); + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .compartmentId(compartmentId) + .namespace(namespace.applyValue(ns -> ns.namespace())) + .name(bucketName) + .accessType("ObjectRead") + .build()); + + // Export the outputs + ctx.export("vcnId", vcn.id()); + ctx.export("vcnCidrBlock", vcn.cidrBlocks().applyValue(blocks -> blocks.get(0))); + ctx.export("bucketName", bucket.name()); + ctx.export("bucketNamespace", bucket.namespace()); + } +} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +##### 4. Deploy Infrastructure + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of resources to be created +2. Asks for your confirmation +3. Creates the VCN and bucket in OCI +4. Outputs the resource IDs + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete OCI Java Tutorial →](/docs/iac/get-started/oci/) +- [Browse OCI Java Examples →](https://github.com/pulumi/examples#oracle-cloud-infrastructure) +- [Learn Java with Pulumi →](/docs/iac/concepts/languages/java/) + +{{% /choosable %}} + +{{% choosable language yaml %}} + +## Get Started with YAML + +Define Oracle Cloud infrastructure using simple, declarative YAML configuration. + +### Prerequisites + +- **Oracle Cloud account**: [Sign up for free tier](https://signup.cloud.oracle.com/) +- **OCI credentials**: configured locally + +### Quick Start + +#### 1. Sign up for Pulumi Cloud (Free) + +Create Free Account + +Pulumi Cloud provides free state management, secrets encryption, and deployment history. + +#### 2. Install Pulumi + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +{{% /choosable %}} + +#### 3. Configure OCI Access + +##### 1. Install OCI CLI + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +##### 2. Configure Credentials + +```bash +oci setup config +``` + +This will prompt for: + +- User OCID: `ocid1.user.oc1..xxxxx` +- Tenancy OCID: `ocid1.tenancy.oc1..xxxxx` +- Region: `us-ashburn-1` +- Path to your API signing key + +Verify: + +```bash +oci iam region list +``` + +#### 4. Create Your First Project + +##### 1. New Project + +```bash +mkdir pulumi-oci-quickstart +cd pulumi-oci-quickstart +pulumi new oci-yaml +``` + +##### 2. Project Structure + +``` +pulumi-oci-quickstart/ +├── Pulumi.yaml # Project and resource definitions +└── Pulumi.dev.yaml # Stack configuration +``` + +##### 3. Define Infrastructure + +Your project includes example YAML to create OCI resources: + +```yaml +name: oci-quickstart +runtime: yaml +description: A minimal Oracle Cloud Infrastructure Pulumi YAML program + +config: + compartmentId: + type: string + +variables: + namespace: + fn::invoke: + function: oci:ObjectStorage:getNamespace + timestamp: + fn::invoke: + function: std:datetime:timestamp + arguments: + format: unix + +resources: + # Create a VCN (Virtual Cloud Network) + my-vcn: + type: oci:Core:Vcn + properties: + compartmentId: ${compartmentId} + cidrBlocks: + - 10.0.0.0/16 + displayName: my-vcn + dnsLabel: myvcn + + # Create an Internet Gateway + my-internet-gateway: + type: oci:Core:InternetGateway + properties: + compartmentId: ${compartmentId} + vcnId: ${my-vcn.id} + displayName: my-internet-gateway + enabled: true + + # Create an Object Storage bucket + my-bucket: + type: oci:ObjectStorage:Bucket + properties: + compartmentId: ${compartmentId} + namespace: ${namespace.namespace} + name: my-pulumi-bucket-${timestamp.unix} + accessType: ObjectRead + +outputs: + # Export the VCN and bucket information + vcnId: ${my-vcn.id} + vcnCidrBlock: ${my-vcn.cidrBlocks[0]} + bucketName: ${my-bucket.name} + bucketNamespace: ${my-bucket.namespace} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +##### 4. Deploy Infrastructure + +Deploy it: + +```bash +pulumi up +``` + +### Next steps + +- [**View your stack in Pulumi Cloud →**](https://app.pulumi.com/stacks) + Explore resource details, deployment history, and manage your infrastructure +- [Complete OCI YAML Tutorial →](/docs/iac/get-started/oci/) +- [Browse OCI YAML Examples →](https://github.com/pulumi/examples#oracle-cloud-infrastructure) +- [Learn Pulumi YAML Concepts →](/docs/iac/concepts/languages/yaml/) + +{{% /choosable %}} diff --git a/content/start-now-3/_index.md b/content/start-now-3/_index.md new file mode 100644 index 000000000000..8ae63e10726b --- /dev/null +++ b/content/start-now-3/_index.md @@ -0,0 +1,26 @@ +--- +title: Getting Started with Pulumi +meta_desc: Step-by-step guides for provisioning your first cloud resources and mastering the basics of Pulumi +type: page +layout: start-now-integrated +no_on_this_page: true +subtitle: Step-by-step guides for provisioning your first cloud resources and mastering the basics of Pulumi + +cloud_providers: + items: + - name: Amazon Web Services + logo: /logos/pkg/aws.svg + link: /start-now-3/aws/ + - name: Microsoft Azure + logo: /logos/pkg/azure.svg + link: /start-now-3/azure/ + - name: Google Cloud + logo: /logos/pkg/gcp.svg + link: /start-now-3/gcp/ + - name: Kubernetes + logo: /logos/pkg/kubernetes.svg + link: /start-now-3/kubernetes/ + - name: Oracle Cloud + logo: /logos/pkg/oci.svg + link: /start-now-3/oci/ +--- diff --git a/content/start-now-3/aws/_index.md b/content/start-now-3/aws/_index.md new file mode 100644 index 000000000000..8c5f5214a55f --- /dev/null +++ b/content/start-now-3/aws/_index.md @@ -0,0 +1,229 @@ +--- +title: Get Started with Pulumi and AWS +meta_desc: Deploy your first AWS resources with Pulumi in 5 simple steps +type: page +layout: cloud-integrated +no_on_this_page: true + +cloud_name: AWS +subtitle: Deploy your first AWS resources in 6 simple steps +--- + +## Sign up for Pulumi Cloud (Free) + +Start with Pulumi Cloud for free - manage state, encrypt secrets, and track deployment history. + +Create Free Account + +## Install Pulumi CLI + +Choose your operating system: + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +Or download the [installer](https://github.com/pulumi/pulumi/releases) +{{% /choosable %}} +{{< /chooser >}} + +## Check Prerequisites + +Ensure you have the language runtime for your chosen language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} +**Required:** [Node.js](https://nodejs.org/) version 14 or later + +Check your version: + +```bash +node --version +``` + +{{% /choosable %}} + +{{% choosable language python %}} +**Required:** [Python](https://www.python.org/) 3.8 or later + +Check your version: + +```bash +python3 --version +``` + +{{% /choosable %}} + +{{% choosable language go %}} +**Required:** [Go](https://golang.org/) 1.20 or later + +Check your version: + +```bash +go version +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} +**Required:** [.NET](https://dotnet.microsoft.com/) 6.0 or later + +Check your version: + +```bash +dotnet --version +``` + +{{% /choosable %}} + +{{% choosable language java %}} +**Required:** + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later + +Check your versions: + +```bash +java --version +mvn --version +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} +No additional language runtime required - YAML is built into Pulumi! +{{% /choosable %}} + +## Configure AWS Access + +Configure your AWS credentials: + +```bash +aws configure +``` + +Or set environment variables: + +```bash +export AWS_ACCESS_KEY_ID= +export AWS_SECRET_ACCESS_KEY= +``` + +## Create Your First Project + +Choose your preferred language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new aws-typescript +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new aws-python +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new aws-go +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new aws-csharp +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new aws-java +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new aws-yaml +``` + +{{% /choosable %}} + +## Deploy Your Infrastructure + +The template creates a simple S3 bucket. Deploy it with: + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of the S3 bucket to be created +2. Asks for your confirmation +3. Creates your S3 bucket in AWS +4. Saves the state in Pulumi Cloud + +## 🎉 Congratulations! + +You've just deployed your first infrastructure with Pulumi! + +### What's next? + +- **[View your stack in Pulumi Cloud →](https://app.pulumi.com/stacks)** + Explore resource details, deployment history, and manage your infrastructure + +- **[Complete AWS Tutorial →](/docs/iac/get-started/aws/)** + Learn how to build a static website with S3 and CloudFront + +- **[Browse Examples →](https://github.com/pulumi/examples#aws)** + Explore production-ready AWS examples + +- **[Join the Community →](https://slack.pulumi.com)** + Get help and share with 10,000+ developers + +### Quick Tips + +- Run `pulumi stack` to see your current stack details +- Run `pulumi destroy` to delete your S3 bucket +- Run `pulumi config set` to configure stack settings +- View your deployments at [app.pulumi.com](https://app.pulumi.com) diff --git a/content/start-now-3/azure/_index.md b/content/start-now-3/azure/_index.md new file mode 100644 index 000000000000..25b8c88e11cd --- /dev/null +++ b/content/start-now-3/azure/_index.md @@ -0,0 +1,231 @@ +--- +title: Get Started with Pulumi and Azure +meta_desc: Deploy your first Azure resources with Pulumi in 5 simple steps +type: page +layout: cloud-integrated +no_on_this_page: true + +cloud_name: Azure +subtitle: Deploy your first Azure resources in 6 simple steps +--- + +## Sign up for Pulumi Cloud (Free) + +Start with Pulumi Cloud for free - manage state, encrypt secrets, and track deployment history. + +Create Free Account + +## Install Pulumi CLI + +Choose your operating system: + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +Or download the [installer](https://github.com/pulumi/pulumi/releases) +{{% /choosable %}} +{{< /chooser >}} + +## Check Prerequisites + +Ensure you have the language runtime for your chosen language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} +**Required:** [Node.js](https://nodejs.org/) version 14 or later + +Check your version: + +```bash +node --version +``` + +{{% /choosable %}} + +{{% choosable language python %}} +**Required:** [Python](https://www.python.org/) 3.8 or later + +Check your version: + +```bash +python3 --version +``` + +{{% /choosable %}} + +{{% choosable language go %}} +**Required:** [Go](https://golang.org/) 1.20 or later + +Check your version: + +```bash +go version +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} +**Required:** [.NET](https://dotnet.microsoft.com/) 6.0 or later + +Check your version: + +```bash +dotnet --version +``` + +{{% /choosable %}} + +{{% choosable language java %}} +**Required:** + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later + +Check your versions: + +```bash +java --version +mvn --version +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} +No additional language runtime required - YAML is built into Pulumi! +{{% /choosable %}} + +## Configure Azure Access + +Configure your Azure credentials: + +```bash +az login +``` + +Or use a service principal: + +```bash +export ARM_CLIENT_ID= +export ARM_CLIENT_SECRET= +export ARM_TENANT_ID= +export ARM_SUBSCRIPTION_ID= +``` + +## Create Your First Project + +Choose your preferred language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new azure-typescript +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new azure-python +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new azure-go +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new azure-csharp +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new azure-java +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new azure-yaml +``` + +{{% /choosable %}} + +## Deploy Your Infrastructure + +The template creates a Resource Group and StorageV2 Storage Account. Deploy it with: + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of the Resource Group and Storage Account to be created +2. Asks for your confirmation +3. Creates your Resource Group and StorageV2 Storage Account in Azure +4. Saves the state in Pulumi Cloud + +## 🎉 Congratulations! + +You've just deployed your first infrastructure with Pulumi! + +### What's next? + +- **[View your stack in Pulumi Cloud →](https://app.pulumi.com/stacks)** + Explore resource details, deployment history, and manage your infrastructure + +- **[Complete Azure Tutorial →](/docs/iac/get-started/azure/)** + Learn how to build and deploy applications on Azure + +- **[Browse Examples →](https://github.com/pulumi/examples#azure)** + Explore production-ready Azure examples + +- **[Join the Community →](https://slack.pulumi.com)** + Get help and share with 10,000+ developers + +### Quick Tips + +- Run `pulumi stack` to see your current stack details +- Run `pulumi destroy` to delete your Resource Group and Storage Account +- Run `pulumi config set` to configure stack settings +- View your deployments at [app.pulumi.com](https://app.pulumi.com) diff --git a/content/start-now-3/gcp/_index.md b/content/start-now-3/gcp/_index.md new file mode 100644 index 000000000000..bb50b813f688 --- /dev/null +++ b/content/start-now-3/gcp/_index.md @@ -0,0 +1,228 @@ +--- +title: Get Started with Pulumi and Google Cloud +meta_desc: Deploy your first Google Cloud resources with Pulumi in 5 simple steps +type: page +layout: cloud-integrated +no_on_this_page: true + +cloud_name: Google Cloud +subtitle: Deploy your first Google Cloud resources in 6 simple steps +--- + +## Sign up for Pulumi Cloud (Free) + +Start with Pulumi Cloud for free - manage state, encrypt secrets, and track deployment history. + +Create Free Account + +## Install Pulumi CLI + +Choose your operating system: + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +Or download the [installer](https://github.com/pulumi/pulumi/releases) +{{% /choosable %}} +{{< /chooser >}} + +## Check Prerequisites + +Ensure you have the language runtime for your chosen language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} +**Required:** [Node.js](https://nodejs.org/) version 14 or later + +Check your version: + +```bash +node --version +``` + +{{% /choosable %}} + +{{% choosable language python %}} +**Required:** [Python](https://www.python.org/) 3.8 or later + +Check your version: + +```bash +python3 --version +``` + +{{% /choosable %}} + +{{% choosable language go %}} +**Required:** [Go](https://golang.org/) 1.20 or later + +Check your version: + +```bash +go version +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} +**Required:** [.NET](https://dotnet.microsoft.com/) 6.0 or later + +Check your version: + +```bash +dotnet --version +``` + +{{% /choosable %}} + +{{% choosable language java %}} +**Required:** + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later + +Check your versions: + +```bash +java --version +mvn --version +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} +No additional language runtime required - YAML is built into Pulumi! +{{% /choosable %}} + +## Configure Google Cloud Access + +Configure your Google Cloud credentials: + +```bash +gcloud auth application-default login +``` + +Or use a service account: + +```bash +export GOOGLE_CREDENTIALS=/path/to/service-account-key.json +``` + +## Create Your First Project + +Choose your preferred language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new gcp-typescript +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new gcp-python +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new gcp-go +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new gcp-csharp +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new gcp-java +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new gcp-yaml +``` + +{{% /choosable %}} + +## Deploy Your Infrastructure + +The template creates a Google Cloud Storage bucket. Deploy it with: + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of the Cloud Storage bucket to be created +2. Asks for your confirmation +3. Creates your Cloud Storage bucket in Google Cloud (US region) +4. Saves the state in Pulumi Cloud + +## 🎉 Congratulations! + +You've just deployed your first infrastructure with Pulumi! + +### What's next? + +- **[View your stack in Pulumi Cloud →](https://app.pulumi.com/stacks)** + Explore resource details, deployment history, and manage your infrastructure + +- **[Complete Google Cloud Tutorial →](/docs/iac/get-started/gcp/)** + Learn how to build and deploy applications on Google Cloud + +- **[Browse Examples →](https://github.com/pulumi/examples#gcp)** + Explore production-ready Google Cloud examples + +- **[Join the Community →](https://slack.pulumi.com)** + Get help and share with 10,000+ developers + +### Quick Tips + +- Run `pulumi stack` to see your current stack details +- Run `pulumi destroy` to delete your Cloud Storage bucket +- Run `pulumi config set` to configure stack settings +- View your deployments at [app.pulumi.com](https://app.pulumi.com) diff --git a/content/start-now-3/kubernetes/_index.md b/content/start-now-3/kubernetes/_index.md new file mode 100644 index 000000000000..07e33130647d --- /dev/null +++ b/content/start-now-3/kubernetes/_index.md @@ -0,0 +1,224 @@ +--- +title: Get Started with Pulumi and Kubernetes +meta_desc: Deploy your first Kubernetes applications with Pulumi in 5 simple steps +type: page +layout: cloud-integrated +no_on_this_page: true + +cloud_name: Kubernetes +subtitle: Deploy your first Kubernetes applications in 6 simple steps +--- + +## Sign up for Pulumi Cloud (Free) + +Start with Pulumi Cloud for free - manage state, encrypt secrets, and track deployment history. + +Create Free Account + +## Install Pulumi CLI + +Choose your operating system: + +{{< chooser os "macos,linux,windows" >}} +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} +{{% choosable os windows %}} + +```powershell +choco install pulumi +``` + +Or download the [installer](https://github.com/pulumi/pulumi/releases) +{{% /choosable %}} +{{< /chooser >}} + +## Check Prerequisites + +Ensure you have the language runtime for your chosen language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} +**Required:** [Node.js](https://nodejs.org/) version 14 or later + +Check your version: + +```bash +node --version +``` + +{{% /choosable %}} + +{{% choosable language python %}} +**Required:** [Python](https://www.python.org/) 3.8 or later + +Check your version: + +```bash +python3 --version +``` + +{{% /choosable %}} + +{{% choosable language go %}} +**Required:** [Go](https://golang.org/) 1.20 or later + +Check your version: + +```bash +go version +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} +**Required:** [.NET](https://dotnet.microsoft.com/) 6.0 or later + +Check your version: + +```bash +dotnet --version +``` + +{{% /choosable %}} + +{{% choosable language java %}} +**Required:** + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later + +Check your versions: + +```bash +java --version +mvn --version +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} +No additional language runtime required - YAML is built into Pulumi! +{{% /choosable %}} + +## Configure Kubernetes Access + +Configure kubectl to connect to your cluster: + +```bash +kubectl cluster-info +``` + +Pulumi uses the same configuration as kubectl from `~/.kube/config`. + +## Create Your First Project + +Choose your preferred language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new kubernetes-typescript +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new kubernetes-python +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new kubernetes-go +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new kubernetes-csharp +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new kubernetes-java +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +```bash +mkdir quickstart && cd quickstart +pulumi new kubernetes-yaml +``` + +{{% /choosable %}} + +## Deploy Your Infrastructure + +The template creates a simple Kubernetes deployment. Deploy it with: + +```bash +pulumi up +``` + +This command: + +1. Shows a preview of the Kubernetes resources to be created +2. Asks for your confirmation +3. Creates your deployment in the Kubernetes cluster +4. Saves the state in Pulumi Cloud + +## 🎉 Congratulations! + +You've just deployed your first infrastructure with Pulumi! + +### What's next? + +- **[View your stack in Pulumi Cloud →](https://app.pulumi.com/stacks)** + Explore resource details, deployment history, and manage your infrastructure + +- **[Complete Kubernetes Tutorial →](/docs/iac/get-started/kubernetes/)** + Learn how to deploy and manage applications on Kubernetes + +- **[Browse Examples →](https://github.com/pulumi/examples#kubernetes)** + Explore production-ready Kubernetes examples + +- **[Join the Community →](https://slack.pulumi.com)** + Get help and share with 10,000+ developers + +### Quick Tips + +- Run `pulumi stack` to see your current stack details +- Run `pulumi destroy` to remove your Kubernetes deployment +- Run `pulumi config set` to configure stack settings +- View your deployments at [app.pulumi.com](https://app.pulumi.com) diff --git a/content/start-now-3/oci/_index.md b/content/start-now-3/oci/_index.md new file mode 100644 index 000000000000..e4b1e5a4907e --- /dev/null +++ b/content/start-now-3/oci/_index.md @@ -0,0 +1,558 @@ +--- +title: Get Started with Pulumi and Oracle Cloud +meta_desc: Set up Pulumi to manage infrastructure on Oracle Cloud Infrastructure - follow these 6 simple steps +type: page +layout: cloud-integrated +no_on_this_page: true + +cloud_name: Oracle Cloud +subtitle: Deploy your first Oracle Cloud resources in 6 simple steps +--- + +## Sign up for Pulumi Cloud (Free) + +Start with Pulumi Cloud for free - manage state, encrypt secrets, and track deployment history. + +Create Free Account + +## What You'll Build + +You'll create an **Object Storage bucket** in Oracle Cloud using infrastructure as code. + +This covers the fundamentals: authentication, defining resources, and deploying to Oracle Cloud Infrastructure. + +## Install Pulumi + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +brew install pulumi/tap/pulumi +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +curl -fsSL https://get.pulumi.com | sh +``` + +{{% /choosable %}} + +{{% choosable os windows %}} + +```powershell +Invoke-WebRequest -Uri "https://get.pulumi.com/install.ps1" -OutFile install.ps1; .\install.ps1 +``` + +{{% /choosable %}} + +Verify the installation: + +```bash +pulumi version +``` + +## Check Prerequisites + +Ensure you have the language runtime for your chosen language: + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} +**Required:** [Node.js](https://nodejs.org/) version 14 or later + +Check your version: + +```bash +node --version +``` + +{{% /choosable %}} + +{{% choosable language python %}} +**Required:** [Python](https://www.python.org/) 3.8 or later + +Check your version: + +```bash +python3 --version +``` + +{{% /choosable %}} + +{{% choosable language go %}} +**Required:** [Go](https://golang.org/) 1.20 or later + +Check your version: + +```bash +go version +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} +**Required:** [.NET](https://dotnet.microsoft.com/) 6.0 or later + +Check your version: + +```bash +dotnet --version +``` + +{{% /choosable %}} + +{{% choosable language java %}} +**Required:** + +- [Java](https://www.oracle.com/java/) 11 or later +- [Maven](https://maven.apache.org/) 3.6.1 or later + +Check your versions: + +```bash +java --version +mvn --version +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} +No additional language runtime required - YAML is built into Pulumi! +{{% /choosable %}} + +## Configure Oracle Cloud + +Set up your OCI credentials for Pulumi to use: + +### Install OCI CLI + +{{< chooser os "macos,linux,windows" / >}} + +{{% choosable os macos %}} + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +{{% /choosable %}} + +{{% choosable os linux %}} + +```bash +bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" +``` + +{{% /choosable %}} + +{{% choosable os windows %}} +Download and run the [Windows installer](https://github.com/oracle/oci-cli/releases/latest) +{{% /choosable %}} + +### Configure Credentials + +```bash +oci setup config +``` + +This will prompt you for: + +- **User OCID**: Find in OCI Console → Identity → Users → Your User +- **Tenancy OCID**: Find in OCI Console → Administration → Tenancy Details +- **Region**: e.g., `us-ashburn-1` +- **API Signing Key**: Path to your private key (will be created if doesn't exist) + +### Verify Configuration + +```bash +oci iam region list +``` + +You should see a list of available OCI regions. + +## Create Your Project + +{{< chooser language "typescript,python,go,csharp,java,yaml" / >}} + +{{% choosable language typescript %}} + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-typescript +``` + +This creates: + +- `index.ts` - Your infrastructure code +- `package.json` - Node.js dependencies +- `Pulumi.yaml` - Project configuration + +**Your infrastructure code:** + +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as oci from "@pulumi/oci"; + +// Get configuration +const config = new pulumi.Config(); +const compartmentId = config.require("compartmentId"); + +// Get the namespace for Object Storage +const namespace = oci.objectstorage.getNamespaceOutput(); + +// Create an Object Storage bucket +const bucket = new oci.objectstorage.Bucket("my-bucket", { + compartmentId: compartmentId, + namespace: namespace.namespace, + name: `my-bucket-${Date.now()}`, + accessType: "NoPublicAccess", +}); + +// Export the bucket name +export const bucketName = bucket.name; +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +{{% /choosable %}} + +{{% choosable language python %}} + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-python +``` + +This creates: + +- `__main__.py` - Your infrastructure code +- `requirements.txt` - Python dependencies +- `Pulumi.yaml` - Project configuration + +**Your infrastructure code:** + +```python +import pulumi +import pulumi_oci as oci +import time + +# Get configuration +config = pulumi.Config() +compartment_id = config.require("compartmentId") + +# Get the namespace for Object Storage +namespace = oci.objectstorage.get_namespace() + +# Create an Object Storage bucket +bucket = oci.objectstorage.Bucket("my-bucket", + compartment_id=compartment_id, + namespace=namespace.namespace, + name=f"my-bucket-{int(time.time())}", + access_type="NoPublicAccess" +) + +# Export the bucket name +pulumi.export("bucketName", bucket.name) +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +{{% /choosable %}} + +{{% choosable language go %}} + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-go +``` + +This creates: + +- `main.go` - Your infrastructure code +- `go.mod` - Go module dependencies +- `Pulumi.yaml` - Project configuration + +**Your infrastructure code:** + +```go +package main + +import ( + "fmt" + "time" + + "github.com/pulumi/pulumi-oci/sdk/v2/go/oci/objectstorage" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + // Get configuration + cfg := config.New(ctx, "") + compartmentId := cfg.Require("compartmentId") + + // Get the namespace for Object Storage + namespace, err := objectstorage.GetNamespace(ctx, nil) + if err != nil { + return err + } + + // Create an Object Storage bucket + bucketName := fmt.Sprintf("my-bucket-%d", time.Now().Unix()) + bucket, err := objectstorage.NewBucket(ctx, "my-bucket", &objectstorage.BucketArgs{ + CompartmentId: pulumi.String(compartmentId), + Namespace: pulumi.String(namespace.Namespace), + Name: pulumi.String(bucketName), + AccessType: pulumi.String("NoPublicAccess"), + }) + if err != nil { + return err + } + + // Export the bucket name + ctx.Export("bucketName", bucket.Name) + + return nil + }) +} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +{{% /choosable %}} + +{{% choosable language csharp %}} + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-csharp +``` + +This creates: + +- `Program.cs` - Your infrastructure code +- `*.csproj` - .NET project file +- `Pulumi.yaml` - Project configuration + +**Your infrastructure code:** + +```csharp +using System; +using System.Threading.Tasks; +using Pulumi; +using Pulumi.Oci.ObjectStorage; + +class Program +{ + static Task Main() => Deployment.RunAsync(); +} + +class MyStack : Stack +{ + public MyStack() + { + // Get configuration + var config = new Config(); + var compartmentId = config.Require("compartmentId"); + + // Get the namespace for Object Storage + var @namespace = GetNamespace.Invoke(); + + // Create an Object Storage bucket + var bucketName = $"my-bucket-{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}"; + var bucket = new Bucket("my-bucket", new BucketArgs + { + CompartmentId = compartmentId, + Namespace = @namespace.Apply(ns => ns.Namespace), + Name = bucketName, + AccessType = "NoPublicAccess", + }); + + // Export the bucket name + this.BucketName = bucket.Name; + } + + [Output] + public Output BucketName { get; set; } +} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +{{% /choosable %}} + +{{% choosable language java %}} + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-java +``` + +This creates: + +- `src/main/java/myproject/App.java` - Your infrastructure code +- `pom.xml` - Maven configuration +- `Pulumi.yaml` - Project configuration + +**Your infrastructure code:** + +```java +package myproject; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.oci.objectstorage.Bucket; +import com.pulumi.oci.objectstorage.BucketArgs; +import com.pulumi.oci.objectstorage.ObjectstorageFunctions; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + // Get configuration + var config = ctx.config(); + var compartmentId = config.require("compartmentId"); + + // Get the namespace for Object Storage + var namespace = ObjectstorageFunctions.getNamespace(); + + // Create an Object Storage bucket + var bucketName = "my-bucket-" + System.currentTimeMillis(); + var bucket = new Bucket("my-bucket", BucketArgs.builder() + .compartmentId(compartmentId) + .namespace(namespace.applyValue(ns -> ns.namespace())) + .name(bucketName) + .accessType("NoPublicAccess") + .build()); + + // Export the bucket name + ctx.export("bucketName", bucket.name()); + } +} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +{{% /choosable %}} + +{{% choosable language yaml %}} + +```bash +mkdir oci-quickstart && cd oci-quickstart +pulumi new oci-yaml +``` + +This creates: + +- `Pulumi.yaml` - Project configuration and resources +- `Pulumi.dev.yaml` - Stack configuration + +**Your infrastructure code:** + +```yaml +name: oci-quickstart +runtime: yaml +description: A minimal Oracle Cloud Infrastructure Pulumi YAML program + +config: + compartmentId: + type: string + +variables: + namespace: + fn::invoke: + function: oci:ObjectStorage:getNamespace + timestamp: + fn::invoke: + function: std:datetime:timestamp + arguments: + format: unix + +resources: + # Create an Object Storage bucket + my-bucket: + type: oci:ObjectStorage:Bucket + properties: + compartmentId: ${compartmentId} + namespace: ${namespace.namespace} + name: my-bucket-${timestamp.unix} + accessType: NoPublicAccess + +outputs: + # Export the bucket name + bucketName: ${my-bucket.name} +``` + +Set your compartment ID: + +```bash +pulumi config set compartmentId +``` + +{{% /choosable %}} + +## Deploy Your Bucket + +Run Pulumi to create your resources: + +```bash +pulumi up +``` + +Pulumi will: + +1. Show a preview of the Object Storage bucket to be created +2. Ask for your confirmation +3. Create your bucket in OCI +4. Save the state in Pulumi Cloud + +## 🎉 Congratulations! + +You've just deployed your first infrastructure with Pulumi on Oracle Cloud! + +### What's next? + +- **[View your stack in Pulumi Cloud →](https://app.pulumi.com/stacks)** + Explore resource details, deployment history, and manage your infrastructure + +- **[Complete OCI Tutorial →](/docs/iac/get-started/oci/)** + Learn how to build more complex infrastructure on Oracle Cloud + +- **[Browse Examples →](https://github.com/pulumi/examples#oracle-cloud-infrastructure)** + Explore production-ready OCI examples + +- **[Join the Community →](https://slack.pulumi.com)** + Get help and share with 10,000+ developers + +### Quick Tips + +- Run `pulumi stack` to see your current stack details +- Run `pulumi destroy` to delete your bucket +- Run `pulumi config set` to configure stack settings +- View your deployments at [app.pulumi.com](https://app.pulumi.com) diff --git a/layouts/page/cloud-integrated.html b/layouts/page/cloud-integrated.html new file mode 100644 index 000000000000..ca87221c5b37 --- /dev/null +++ b/layouts/page/cloud-integrated.html @@ -0,0 +1,282 @@ +{{ define "hero" }} +
+

{{ .Title }}

+ {{ if .Params.subtitle }} +

{{ .Params.subtitle }}

+ {{ end }} +
+{{ end }} + +{{ define "main" }} + + +
+
+
+
+ {{ .Content }} +
+
+
+
+{{ end }} \ No newline at end of file diff --git a/layouts/page/cloud-progressive.html b/layouts/page/cloud-progressive.html new file mode 100644 index 000000000000..8374d62afa9c --- /dev/null +++ b/layouts/page/cloud-progressive.html @@ -0,0 +1,211 @@ +{{ define "hero" }} +
+

{{ .Title }}

+ {{ if .Params.subtitle }} +

{{ .Params.subtitle }}

+ {{ end }} +
+{{ end }} + +{{ define "main" }} + + +
+
+
+
+ {{ .Content }} +
+
+
+
+{{ end }} \ No newline at end of file diff --git a/layouts/page/cloud-unified.html b/layouts/page/cloud-unified.html new file mode 100644 index 000000000000..7fb165e36d97 --- /dev/null +++ b/layouts/page/cloud-unified.html @@ -0,0 +1,170 @@ +{{ define "hero" }} +
+

{{ .Title }}

+ {{ if .Params.subtitle }} +

{{ .Params.subtitle }}

+ {{ end }} +
+{{ end }} + +{{ define "main" }} + + +
+
+
+
+ {{ .Content }} +
+
+
+
+{{ end }} \ No newline at end of file diff --git a/layouts/page/start-now-integrated.html b/layouts/page/start-now-integrated.html new file mode 100644 index 000000000000..b74795baf948 --- /dev/null +++ b/layouts/page/start-now-integrated.html @@ -0,0 +1,26 @@ +{{ define "hero" }} +
+

{{ .Title }}

+ {{ if .Params.subtitle }} +

{{ .Params.subtitle }}

+ {{ end }} +
+{{ end }} + +{{ define "main" }} +
+ {{ if .Params.cloud_providers }} +
+
+ {{ range .Params.cloud_providers.items }} + +
+ {{ .name }} +
+
+ {{ end }} +
+
+ {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/layouts/page/start-now-progressive.html b/layouts/page/start-now-progressive.html new file mode 100644 index 000000000000..b74795baf948 --- /dev/null +++ b/layouts/page/start-now-progressive.html @@ -0,0 +1,26 @@ +{{ define "hero" }} +
+

{{ .Title }}

+ {{ if .Params.subtitle }} +

{{ .Params.subtitle }}

+ {{ end }} +
+{{ end }} + +{{ define "main" }} +
+ {{ if .Params.cloud_providers }} +
+
+ {{ range .Params.cloud_providers.items }} + +
+ {{ .name }} +
+
+ {{ end }} +
+
+ {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/layouts/page/start-now-unified.html b/layouts/page/start-now-unified.html new file mode 100644 index 000000000000..b74795baf948 --- /dev/null +++ b/layouts/page/start-now-unified.html @@ -0,0 +1,26 @@ +{{ define "hero" }} +
+

{{ .Title }}

+ {{ if .Params.subtitle }} +

{{ .Params.subtitle }}

+ {{ end }} +
+{{ end }} + +{{ define "main" }} +
+ {{ if .Params.cloud_providers }} +
+
+ {{ range .Params.cloud_providers.items }} + +
+ {{ .name }} +
+
+ {{ end }} +
+
+ {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/choosable-inline.html b/layouts/shortcodes/choosable-inline.html index 9bf19794cd4f..c48c125dfdae 100644 --- a/layouts/shortcodes/choosable-inline.html +++ b/layouts/shortcodes/choosable-inline.html @@ -3,4 +3,4 @@ {{ $mode := .Get 2 }} {{ if eq $values "nodejs" }} {{ $values = "javascript,typescript" }} -{{ end }} {{ .Inner }} +{{ end }} {{ .Inner | markdownify }} diff --git a/layouts/shortcodes/choosable.html b/layouts/shortcodes/choosable.html index 2a7b7a12a84a..e9da1e5d57b9 100644 --- a/layouts/shortcodes/choosable.html +++ b/layouts/shortcodes/choosable.html @@ -15,5 +15,5 @@
- {{ .Inner }} + {{ .Inner | markdownify }}