370 Commits

Author SHA1 Message Date
Feiyu Shi
9bd19df040 validate if user assigned identity exists 2020-05-24 19:05:46 -07:00
Feiyu Shi
3e3fdaa24e make generate 2020-05-24 19:05:45 -07:00
Feiyu Shi
f7f033a7fd add config validation test 2020-05-24 19:05:45 -07:00
Feiyu Shi
10b0a4548f add identity resource id validation 2020-05-24 19:05:45 -07:00
Feiyu Shi
7c1a62dfed set identity field in the template 2020-05-24 19:05:45 -07:00
Feiyu Shi
b5b2982772 add user_assigned_managed_identities to the config 2020-05-24 19:05:45 -07:00
Wilken Rivera
c954831bb2 builder/azure-arm: Update runtime constants with a valid DataDiskName
This change fixes an issue where using the `disk_additional_size` configuration option would cause builds to fail.

Build results before the change
```
==> Builds finished but no artifacts were created.
Build 'azure-arm' errored: Code="DeploymentFailed" Message="At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details." Details=[{"code":"BadRequest","message":"{\r\n  \"error\": {\r\n    \"code
\": \"InvalidParameter\",\r\n    \"message\": \"The entity name 'dataDisk.name' is invalid according to its validation rule: ^[^_\\\\W][\\\\w-._]{0,79}(?\u003c![-.])$.\",\r\n    \"target\": \"dataDisk.name\"\r\n  }\r\n}"}]

```

Build results after change
```
Build 'azure-arm' finished.

==> Builds finished. The artifacts of successful builds are:
--> azure-arm: Azure.ResourceManagement.VMImage:

OSType: Linux
ManagedImageResourceGroupName: test-pkr
ManagedImageName: wilkenPacker9249
```

Closes #9249
2020-05-18 14:57:20 -04:00
Wilken Rivera
f31f5bc61b docs/builder/azure-arm: Fix a small typo for the custom_managed_image_* config options
Closes #9199
2020-05-14 13:31:40 -04:00
Megan Marsh
7e0cfd8b77 add undocumented tag to struct-markdown generator so that we can leave internal-use-only fields out of docs 2020-05-01 10:31:38 -07:00
Wilken Rivera
86ab71f56e
test/azure/arm: Add regression test case for ssh_username overrides (#9136)
This test is for the regression fixed in #9103

Before fix
```
⇶  go test ./builder/azure/arm/... -run=TestConfigUserNameOverride
--- FAIL: TestConfigUserNameOverride (0.42s)
    config_test.go:75: Expected 'c.Comm.SSHPassword' to be set to generated password, but found ""!
    config_test.go💯 Expected 'UserName' to be set to 'override_winrm_username', but found "packer"!
FAIL
FAIL    github.com/hashicorp/packer/builder/azure/arm   0.425s
FAIL

```

After fix
```
⇶  go test ./builder/azure/arm/... -run=TestConfigUserNameOverride
ok      github.com/hashicorp/packer/builder/azure/arm   0.379s
```

* Fix variable names in error messages
2020-04-30 10:49:58 +02:00
Wilken Rivera
e0d2f4fd69
builder/azure-arm: Fix SSH connection for temporary admin users specified in ssh_username (#9103) 2020-04-23 11:04:49 +02:00
Adrien Delorme
da4a5224be
HCL2 singular blocks: use key/value or name/value depending on how the service names things (#9078)
* make sure keyvalue and namevalue filters are using the same naming as the service being used

* make docs a bit more readable for KeyValues too

* Update website/pages/docs/from-1.5/expressions.mdx

Co-Authored-By: Megan Marsh <megan@hashicorp.com>

Co-authored-by: Megan Marsh <megan@hashicorp.com>
2020-04-23 10:46:49 +02:00
Matthew Sanabria
761abdda4e
Updating documentation for azure-arm builder (#9097) 2020-04-21 10:47:48 +02:00
vijayrajah
5d2fee04b2
builder/azure: enable boot Diagnostics (#9053)
* enable boot Diagnostics
2020-04-20 07:29:13 -04:00
Paul Meyer
89f3aa0bd6
[builder/azure-arm] Use VM/build location for image location (#9068)
* [builder/azure-arm] Use VM/build location for image locationThe builder was using the location of the containing resource group asthe image location, but the API call can only create images in the samelocation as the source VM that is being captured.
2020-04-17 05:43:03 -04:00
Megan Marsh
08787ba31f
Merge pull request #9028 from vijayrajah/set_azure_custom_res_names
Set Custom Resource Names for Azure-Arm builds
2020-04-16 15:58:41 -07:00
Vijay Rajah
da7382980a Fix failing test & format code 2020-04-17 00:17:39 +05:30
vijayrajah
fff06353b7
Update builder/azure/arm/tempname.go
refactor the code.. thanks for the suggestion @sylviamoss

Co-Authored-By: Sylvia Moss <sylviamoss.m@gmail.com>
2020-04-17 00:04:39 +05:30
Adrien Delorme
73242e8de4 make sure keyvalue and namevalue filters are using the same naming as the service being used 2020-04-16 17:22:13 +02:00
Adrien Delorme
840e67f775
HCL2: when we see a map generate an attribute spec instead of a block spec (#9035)
* mapstructure-to-hcl2: when we see a map generate an attribute spec and not a block spec

this will alow to do

tags = {
 key = "value"
}

instead of

tags {
  key = "value"
}

This will also enable using variables directly for those tags

* generate code

* update tests
2020-04-14 16:05:13 +02:00
Vijay Rajah
9209826bfe Update the doc with more info 2020-04-10 00:34:56 +05:30
Vijay Rajah
1e66a1b355 Fix linting & code generation 2020-04-09 00:00:13 +05:30
Vijay Rajah
56bf8bd686 Merge branch 'set_azure_custom_res_names' of github.com:vijayrajah/packer into set_azure_custom_res_names 2020-04-08 23:54:21 +05:30
vijayrajah
a3c580f2ac
Merge branch 'master' into set_azure_custom_res_names 2020-04-08 23:51:58 +05:30
Vijay Rajah
53f54000e6 generate spec & fix typo 2020-04-08 23:42:49 +05:30
Jeff Escalante
9165be87da
packer.io prefix removal, html extension remove for in-code errors 2020-04-07 17:53:22 -04:00
Jeff Escalante
4afd107eeb
patch source files for extensions changes 2020-04-07 17:50:51 -04:00
Vijay Rajah
cd41ad1a40 change resource names 2020-04-07 02:17:50 +05:30
Vijay Rajah
1314d69b51 fix typo (add missing ')]' ) 2020-04-06 11:40:05 +05:30
Vijay Rajah
0589f57d4d Update tests for datadisk name change 2020-04-05 01:16:24 +05:30
vijayrajah
aba9797730
Fix :: allow Managed data disks to be used with azure shared image gallery image Sources (#8912) 2020-04-03 10:18:02 +02:00
Vijay Rajah
5340af4d49 Merge remote-tracking branch 'upstream/master' into feature/datadisk-change_name 2020-04-02 21:53:47 +05:30
Vijay Rajah
d82475566a change datadisk names -- WIP 2020-04-02 21:28:38 +05:30
Sylvia Moss
e6368b9246
Fix azure winrm_password attribution and allow to set winrm_username (#8928) 2020-03-24 14:43:24 +01:00
Vijay Rajah
dd04108ac8 Fix :: allow Managed data disks to be used with azure shared image gallery image Sources 2020-03-19 12:11:34 +05:30
Megan Marsh
28797dd709 replace the homegrown vault delete functions in azure with the sdk ones. 2020-03-18 13:48:54 -07:00
Megan Marsh
e7dba3e55e fix error cleaning up existing keyvault 2020-03-18 13:48:54 -07:00
Adrien Delorme
88297c796d Merge branch 'master' into hcl2_singular_blocks 2020-03-17 14:47:17 +01:00
Adrien Delorme
b5e8750f5f Change key/value to name/value to remain consistent with Terraform 2020-03-17 11:23:11 +01:00
Adrien Delorme
87d6b2433f make generate 2020-03-16 15:21:29 +01:00
Adrien Delorme
9a74ce60d5 Update config.go 2020-03-16 15:12:13 +01:00
Adrien Delorme
45695608b5 WIP 2020-03-16 12:21:46 +01:00
Adrien Delorme
dab689ce2e WIP 2020-03-16 12:19:34 +01:00
Megan Marsh
6008f911fd
Merge pull request #8847 from takaishi/support-keyboard-interactive
communicator/ssh: support keyboard-interactive auth to connect bastion
2020-03-13 11:48:12 -07:00
Adrien Delorme
6e6490d688 WIP 2020-03-13 18:04:48 +01:00
r_takaishi
f50ff1d270 make generate 2020-03-13 11:29:42 +09:00
Megan Marsh
aeedc9af7a
Merge pull request #8879 from mbrancato/specify_keyvault_sku
Add support for configurable KeyVault SKU
2020-03-12 13:47:51 -07:00
Wilken Rivera
7b705545d9
docs: Various doc clean-ups to fix code block formatting and syntax highlighting (#8868) 2020-03-12 15:05:08 +01:00
Mike Brancato
ebb161ae41 Fix config documentation 2020-03-11 21:43:37 -04:00
Mike Brancato
892622987c Add KeyVault parameter and fix whitespace 2020-03-11 21:13:10 -04:00