Skip to content

Commit c740aa4

Browse files
authored
Updated SharedImageGallery param docs examples (#519)
1 parent ffc545f commit c740aa4

File tree

3 files changed

+116
-24
lines changed

3 files changed

+116
-24
lines changed

‎.web-docs/components/builder/arm/README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ Providing `temp_resource_group_name` or `location` in combination with
179179
}
180180
```
181181

182-
- `shared_image_gallery_destination` (SharedImageGalleryDestination) - Shared Gallery Destination
182+
- `shared_image_gallery_destination` (SharedImageGalleryDestination) - The name of the Shared Image Gallery under which the managed image will be published as Shared Gallery Image version.
183+
A managed image target can also be set when using a shared image gallery destination
183184

184185
- `shared_image_gallery_timeout` (duration string | ex: "1h5m2s") - How long to wait for an image to be published to the shared image
185186
gallery before timing out. If your Packer build is failing on the
@@ -197,6 +198,48 @@ Providing `temp_resource_group_name` or `location` in combination with
197198

198199
- `shared_gallery_image_version_exclude_from_latest` (bool) - If set to true, Virtual Machines deployed from the latest version of the
199200
Image Definition won't use this Image Version.
201+
202+
In JSON
203+
```json
204+
"shared_image_gallery_destination": {
205+
"subscription": "00000000-0000-0000-0000-00000000000",
206+
"resource_group": "ResourceGroup",
207+
"gallery_name": "GalleryName",
208+
"image_name": "ImageName",
209+
"image_version": "1.0.0",
210+
"replication_regions": ["regionA", "regionB", "regionC"],
211+
"storage_account_type": "Standard_LRS"
212+
},
213+
"shared_image_gallery_timeout": "60m",
214+
"shared_gallery_image_version_end_of_life_date": "2006-01-02T15:04:05.99Z",
215+
"shared_gallery_image_version_replica_count": 1,
216+
"shared_gallery_image_version_exclude_from_latest": true
217+
```
218+
219+
In HCL2
220+
```hcl
221+
shared_image_gallery_destination {
222+
subscription = "00000000-0000-0000-0000-00000000000"
223+
resource_group = "ResourceGroup"
224+
gallery_name = "GalleryName"
225+
image_name = "ImageName"
226+
image_version = "1.0.0"
227+
storage_account_type = "Standard_LRS"
228+
target_region {
229+
name = "regionA"
230+
}
231+
target_region {
232+
name = "regionB"
233+
}
234+
target_region {
235+
name = "regionC"
236+
}
237+
}
238+
shared_image_gallery_timeout = "60m"
239+
shared_gallery_image_version_end_of_life_date = "2006-01-02T15:04:05.99Z"
240+
shared_gallery_image_version_replica_count = 1
241+
shared_gallery_image_version_exclude_from_latest = true
242+
```
200243

201244
- `image_version` (string) - Specify a specific version of an OS to boot from.
202245
Defaults to `latest`. There may be a difference in versions available

‎builder/azure/arm/config.go

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,24 @@ type Config struct {
212212
// ```
213213
SharedGallery SharedImageGallery `mapstructure:"shared_image_gallery" required:"false"`
214214
// The name of the Shared Image Gallery under which the managed image will be published as Shared Gallery Image version.
215-
//
216-
// Following is an example.
215+
// A managed image target can also be set when using a shared image gallery destination
216+
SharedGalleryDestination SharedImageGalleryDestination `mapstructure:"shared_image_gallery_destination"`
217+
// How long to wait for an image to be published to the shared image
218+
// gallery before timing out. If your Packer build is failing on the
219+
// Publishing to Shared Image Gallery step with the error `Original Error:
220+
// context deadline exceeded`, but the image is present when you check your
221+
// Azure dashboard, then you probably need to increase this timeout from
222+
// its default of "60m" (valid time units include `s` for seconds, `m` for
223+
// minutes, and `h` for hours.)
224+
SharedGalleryTimeout time.Duration `mapstructure:"shared_image_gallery_timeout"`
225+
// The end of life date (2006-01-02T15:04:05.99Z) of the gallery Image Version. This property
226+
// can be used for decommissioning purposes.
227+
SharedGalleryImageVersionEndOfLifeDate string `mapstructure:"shared_gallery_image_version_end_of_life_date" required:"false"`
228+
// The number of replicas of the Image Version to be created per region defined in `replication_regions`.
229+
// Users using `target_region` blocks can specify individual replica counts per region using the `replicas` field.
230+
SharedGalleryImageVersionReplicaCount int64 `mapstructure:"shared_image_gallery_replica_count" required:"false"`
231+
// If set to true, Virtual Machines deployed from the latest version of the
232+
// Image Definition won't use this Image Version.
217233
//
218234
// In JSON
219235
// ```json
@@ -225,8 +241,13 @@ type Config struct {
225241
// "image_version": "1.0.0",
226242
// "replication_regions": ["regionA", "regionB", "regionC"],
227243
// "storage_account_type": "Standard_LRS"
228-
// }
244+
// },
245+
// "shared_image_gallery_timeout": "60m",
246+
// "shared_gallery_image_version_end_of_life_date": "2006-01-02T15:04:05.99Z",
247+
// "shared_gallery_image_version_replica_count": 1,
248+
// "shared_gallery_image_version_exclude_from_latest": true
229249
// ```
250+
//
230251
// In HCL2
231252
// ```hcl
232253
// shared_image_gallery_destination {
@@ -246,26 +267,11 @@ type Config struct {
246267
// name = "regionC"
247268
// }
248269
// }
270+
// shared_image_gallery_timeout = "60m"
271+
// shared_gallery_image_version_end_of_life_date = "2006-01-02T15:04:05.99Z"
272+
// shared_gallery_image_version_replica_count = 1
273+
// shared_gallery_image_version_exclude_from_latest = true
249274
// ```
250-
// A managed image target can also be set when using a shared image gallery destination
251-
252-
SharedGalleryDestination SharedImageGalleryDestination `mapstructure:"shared_image_gallery_destination"`
253-
// How long to wait for an image to be published to the shared image
254-
// gallery before timing out. If your Packer build is failing on the
255-
// Publishing to Shared Image Gallery step with the error `Original Error:
256-
// context deadline exceeded`, but the image is present when you check your
257-
// Azure dashboard, then you probably need to increase this timeout from
258-
// its default of "60m" (valid time units include `s` for seconds, `m` for
259-
// minutes, and `h` for hours.)
260-
SharedGalleryTimeout time.Duration `mapstructure:"shared_image_gallery_timeout"`
261-
// The end of life date (2006-01-02T15:04:05.99Z) of the gallery Image Version. This property
262-
// can be used for decommissioning purposes.
263-
SharedGalleryImageVersionEndOfLifeDate string `mapstructure:"shared_gallery_image_version_end_of_life_date" required:"false"`
264-
// The number of replicas of the Image Version to be created per region defined in `replication_regions`.
265-
// Users using `target_region` blocks can specify individual replica counts per region using the `replicas` field.
266-
SharedGalleryImageVersionReplicaCount int64 `mapstructure:"shared_image_gallery_replica_count" required:"false"`
267-
// If set to true, Virtual Machines deployed from the latest version of the
268-
// Image Definition won't use this Image Version.
269275
SharedGalleryImageVersionExcludeFromLatest bool `mapstructure:"shared_gallery_image_version_exclude_from_latest" required:"false"`
270276
// Name of the publisher to use for your base image (Azure Marketplace Images only). See
271277
// [documentation](https://docs.microsoft.com/en-us/cli/azure/vm/image)

‎docs-partials/builder/azure/arm/Config-not-required.mdx

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
}
3939
```
4040

41-
- `shared_image_gallery_destination` (SharedImageGalleryDestination) - Shared Gallery Destination
41+
- `shared_image_gallery_destination` (SharedImageGalleryDestination) - The name of the Shared Image Gallery under which the managed image will be published as Shared Gallery Image version.
42+
A managed image target can also be set when using a shared image gallery destination
4243

4344
- `shared_image_gallery_timeout` (duration string | ex: "1h5m2s") - How long to wait for an image to be published to the shared image
4445
gallery before timing out. If your Packer build is failing on the
@@ -56,6 +57,48 @@
5657

5758
- `shared_gallery_image_version_exclude_from_latest` (bool) - If set to true, Virtual Machines deployed from the latest version of the
5859
Image Definition won't use this Image Version.
60+
61+
In JSON
62+
```json
63+
"shared_image_gallery_destination": {
64+
"subscription": "00000000-0000-0000-0000-00000000000",
65+
"resource_group": "ResourceGroup",
66+
"gallery_name": "GalleryName",
67+
"image_name": "ImageName",
68+
"image_version": "1.0.0",
69+
"replication_regions": ["regionA", "regionB", "regionC"],
70+
"storage_account_type": "Standard_LRS"
71+
},
72+
"shared_image_gallery_timeout": "60m",
73+
"shared_gallery_image_version_end_of_life_date": "2006-01-02T15:04:05.99Z",
74+
"shared_gallery_image_version_replica_count": 1,
75+
"shared_gallery_image_version_exclude_from_latest": true
76+
```
77+
78+
In HCL2
79+
```hcl
80+
shared_image_gallery_destination {
81+
subscription = "00000000-0000-0000-0000-00000000000"
82+
resource_group = "ResourceGroup"
83+
gallery_name = "GalleryName"
84+
image_name = "ImageName"
85+
image_version = "1.0.0"
86+
storage_account_type = "Standard_LRS"
87+
target_region {
88+
name = "regionA"
89+
}
90+
target_region {
91+
name = "regionB"
92+
}
93+
target_region {
94+
name = "regionC"
95+
}
96+
}
97+
shared_image_gallery_timeout = "60m"
98+
shared_gallery_image_version_end_of_life_date = "2006-01-02T15:04:05.99Z"
99+
shared_gallery_image_version_replica_count = 1
100+
shared_gallery_image_version_exclude_from_latest = true
101+
```
59102

60103
- `image_version` (string) - Specify a specific version of an OS to boot from.
61104
Defaults to `latest`. There may be a difference in versions available

0 commit comments

Comments
 (0)