diff --git a/website/pages/docs/builders/alicloud-ecs.mdx b/website/pages/docs/builders/alicloud-ecs.mdx index 26a6cf352..e05510cce 100644 --- a/website/pages/docs/builders/alicloud-ecs.mdx +++ b/website/pages/docs/builders/alicloud-ecs.mdx @@ -49,6 +49,9 @@ builder. Here is a basic example for Alicloud. + + + ```json { "variables": { @@ -79,6 +82,45 @@ Here is a basic example for Alicloud. } ``` + + + +```hcl +variable "access_key" { + type = string +} + +variable "secret_key" { + type = string +} + +source "alicloud-ecs" "basic-example" { + access_key = var.access_key + secret_key = var.secret_key + region = "cn-beijing" + image_name = "packer_test2" + source_image = "centos_7_04_64_20G_alibase_201701015.vhd" + ssh_username = "root" + instance_type = "ecs.n1.tiny" + io_optimized = true + internet_charge_type = "PayByTraffic" + image_force_delete = true +} + +build { + sources = ["sources.alicloud-ecs.basic-example"] + + provisioner "shell" { + inline = [ + "sleep 30", "yum install redis.x86_64 -y", + ] + } +} +``` + + + + ~> Note: Images can become deprecated after a while; run `aliyun ecs DescribeImages` to find one that exists. diff --git a/website/pages/docs/builders/azure/arm.mdx b/website/pages/docs/builders/azure/arm.mdx index a9fe924a3..e77385b0e 100644 --- a/website/pages/docs/builders/azure/arm.mdx +++ b/website/pages/docs/builders/azure/arm.mdx @@ -165,6 +165,9 @@ Providing `temp_resource_group_name` or `location` in combination with Here is a basic example for Azure. + + + ```json { "type": "azure-arm", @@ -193,6 +196,42 @@ Here is a basic example for Azure. } ``` + + + +```hcl +source "azure-arm" "basic-example" { + client_id = "fe354398-d7sf-4dc9-87fd-c432cd8a7e09" + client_secret = "keepitsecret&#*$" + resource_group_name = "packerdemo" + storage_account = "virtualmachines" + subscription_id = "44cae533-4247-4093-42cf-897ded6e7823" + tenant_id = "de39842a-caba-497e-a798-7896aea43218" + + capture_container_name = "images" + capture_name_prefix = "packer" + + os_type = "Linux" + image_publisher = "Canonical" + image_offer = "UbuntuServer" + image_sku = "14.04.4-LTS" + + azure_tags = { + dept = "engineering" + } + + location = "West US" + vm_size = "Standard_A2" +} + +build { + sources = ["sources.azure-arm.basic-example"] +} +``` + + + + ## Deprovision Azure VMs should be deprovisioned at the end of every build. For Windows this diff --git a/website/pages/docs/builders/azure/chroot.mdx b/website/pages/docs/builders/azure/chroot.mdx index 4998195fd..4e80ce2b9 100644 --- a/website/pages/docs/builders/azure/chroot.mdx +++ b/website/pages/docs/builders/azure/chroot.mdx @@ -194,6 +194,9 @@ to update your VM. Set the `ARM_IMAGE_RESOURCEGROUP_ID` variable to an existing resource group in the subscription where the resulting image will be created. + + + ```json { "variables": { @@ -224,3 +227,43 @@ subscription where the resulting image will be created. ] } ``` + + + + +```hcl +variable "client_id" { + type = string +} +variable "client_secret" { + type = string +} +variable "subscription_id" { + type = string +} +variable "resource_group" { + type = string +} + +source "azure-chroot" "basic-example" { + client_id = var.client_id + client_secret = var.client_secret + subscription_id = var.subscription_id + + image_resource_id = "/subscriptions/${var.subscription_id}/resourceGroups/${var.resource_group}/providers/Microsoft.Compute/images/MyDebianOSImage-{{timestamp}}" + + source = "credativ:Debian:9:latest" +} + +build { + sources = ["sources.azure-chroot.basic-example"] + + provisioner "shell" { + inline = ["apt-get update", "apt-get upgrade -y"] + inline_shebang = "/bin/sh -x" + } +} +``` + + + diff --git a/website/pages/docs/builders/null.mdx b/website/pages/docs/builders/null.mdx index 020612a5a..97265cad0 100644 --- a/website/pages/docs/builders/null.mdx +++ b/website/pages/docs/builders/null.mdx @@ -23,6 +23,9 @@ artifact. Below is a fully functioning example. It doesn't do anything useful, since no provisioners are defined, but it will connect to the specified host via ssh. + + + ```json { "type": "null", @@ -32,6 +35,25 @@ provisioners are defined, but it will connect to the specified host via ssh. } ``` + + + +```hcl +source "null" "basic-example" { + ssh_host = "127.0.0.1" + ssh_username = "foo" + ssh_password = "bar" +} + +build { + sources = ["sources.null.basic-example"] +} +``` + + + + + ## Configuration Reference The null builder has no configuration parameters other than the