e01d957 Bump github.com/stretchr/testify from 1.9.0 to 1.10.073a91d2 Bump github.com/hashicorp/hcl/v2 from 2.22.0 to 2.23.04332e09 Bump golang.org/x/mod from 0.21.0 to 0.22.0cd17fa9 Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0f28c918 Bump github.com/gruntwork-io/terratest from 0.47.1 to 0.47.263a1d51 Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0f28c918 Bump github.com/gruntwork-io/terratest from 0.47.1 to 0.47.263a1d51 Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.47.2
\nModules affected
\n\n
\n- \n
ssh- \n
terraformDescription
\n\n
\n- Updated logging line in ssh module
\n- Refined terraform output by removing unnecessary info lines
\n- Update rexml dependency
\nRelated links
\n\nFull Changelog: https://github.com/gruntwork-io/terratest/compare/v0.47.1...v0.47.2
\n
cf38360 Merge pull request #1445 from gruntwork-io/fix/json-output-errorbb1a781 fix: cleaning the output received from terragrunt - remove info linefc19428 Merge pull request #1437 from gruntwork-io/dependabot/bundler/docs/rexml-3.3.65069b5e Merge pull request #1440 from gruntwork-io/fix/ssh-logse01ef3d fix: move the logging lineb83ccf4 Bump rexml from 3.3.3 to 3.3.6 in /docsef102bb solve gosec issueb61ba2a bump gosec version2752771 modify action setup go versiona4eb1b1 Bump golang.org/x/oauth2 from 0.22.0 to 0.23.04267cef Bump golang.org/x/oauth2 from 0.22.0 to 0.23.0581b468 Bump github.com/hashicorp/hcl/v2 from 2.21.0 to 2.22.08a25f37 Bump github.com/gruntwork-io/terratest from 0.47.0 to 0.47.1b19ceb7 Bump golang.org/x/mod from 0.19.0 to 0.20.063b5d3c Bump github.com/timandy/routine from 1.1.3 to 1.1.49ac1d86 fix golangci-lint-action version to v3.7.1Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.46.5
\nModules affected
\n\n\n
\n- \n
k8sDescription
\n\n
\n- Added
\nRestConfigfield to extend auth options for Kubernetes client.Special thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bkirecekRelated links
\n\n\n\nv0.46.4
\n\n\n
... (truncated)
\n237816f Merge pull request #1354 from kirecek/k8s/kubectl-options/rest-configf498ee0 Merge pull request #1362 from gruntwork-io/dependabot/go_modules/github.com/d...0767fe9 Merge pull request #1360 from gruntwork-io/dependabot/go_modules/google.golan...605b6f0 Bump github.com/docker/docker97a52ef Merge pull request #1286 from gruntwork-io/dependabot/go_modules/github.com/d...894ea6e add an option for passing custom k8s rest confige615bd8 Bump github.com/docker/distributiondc6f834 Bump google.golang.org/grpc from 1.51.0 to 1.56.31f1821e Merge pull request #1356 from gruntwork-io/dependabot/go_modules/golang.org/x...1e1ea0e Bump golang.org/x/net from 0.8.0 to 0.17.04080cbe update github action files to fix action version, bump dependency versions (#73)63894ff Bump github.com/hashicorp/hcl/v2 from 2.18.1 to 2.19.1 (#71)a6d7f88 Bump github.com/gruntwork-io/terratest from 0.45.0 to 0.46.1 (#70)0fafe79 Bump github.com/timandy/routine from 1.1.1 to 1.1.2 (#72)cddc21b Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0 (#67)ccda0db Bump github.com/hashicorp/hcl/v2 from 2.18.0 to 2.18.1 (#65)8b505a3 Bump github.com/gruntwork-io/terratest from 0.44.0 to 0.45.0 (#66)4f8cc66 Bump golang.org/x/mod from 0.12.0 to 0.13.0 (#68)efb432d Bump github.com/spf13/afero from 1.9.5 to 1.10.0 (#63)d79ef0b Bump github.com/gruntwork-io/terratest from 0.43.13 to 0.44.0 (#64)Sourced from google.golang.org/grpc's releases.
\n\n\nRelease 1.56.3
\nSecurity
\n\n
\n- \n
\nserver: prohibit more than MaxConcurrentStreams handlers from running at once (CVE-2023-44487)
\nIn addition to this change, applications should ensure they do not leave running tasks behind related to the RPC before returning from method handlers, or should enforce appropriate limits on any such work.
\nRelease 1.56.2
\n\n
\n- status: To fix a panic,
\nstatus.FromErrornow returns an error withcodes.Unknownwhen the error implements theGRPCStatus()method, and callingGRPCStatus()returnsnil. (#6374)Release 1.56.1
\n\n
\n- client: handle empty address lists correctly in addrConn.updateAddrs
\nRelease 1.56.0
\nNew Features
\n\n
\n- client: support channel idleness using
\nWithIdleTimeoutdial option (#6263)\n\n
\n- This feature is currently disabled by default, but will be enabled with a 30 minute default in the future.
\n- client: when using pickfirst, keep channel state in TRANSIENT_FAILURE until it becomes READY (gRFC A62) (#6306)
\n- xds: Add support for Custom LB Policies (gRFC A52) (#6224)
\n- xds: support pick_first Custom LB policy (gRFC A62) (#6314) (#6317)
\n- client: add support for pickfirst address shuffling (gRFC A62) (#6311)
\n- xds: Add support for String Matcher Header Matcher in RDS (#6313)
\n- xds/outlierdetection: Add Channelz Logger to Outlier Detection LB (#6145)\n
\n\n
\n- Special Thanks:
\n@\u200bs-matyukevich- xds: enable RLS in xDS by default (#6343)
\n- orca: add support for application_utilization field and missing range checks on several metrics setters
\n- balancer/weightedroundrobin: add new LB policy for balancing between backends based on their load reports (gRFC A58) (#6241)
\n- authz: add conversion of json to RBAC Audit Logging config (#6192)
\n- authz: add support for stdout logger (#6230 and #6298)
\n- authz: support customizable audit functionality for authorization policy (#6192 #6230\u00a0#6298 #6158 #6304 and #6225)
\nBug Fixes
\n\n
\n- orca: fix a race at startup of out-of-band metric subscriptions that would cause the report interval to request 0 (#6245)
\n- xds/xdsresource: Fix Outlier Detection Config Handling and correctly set xDS Defaults (#6361)
\n- xds/outlierdetection: Fix Outlier Detection Config Handling by setting defaults in ParseConfig() (#6361)
\nAPI Changes
\n\n
\n- orca: allow a ServerMetricsProvider to be passed to the ORCA service and ServerOption (#6223)
\nRelease 1.55.1
\n\n
\n- status: To fix a panic,
\nstatus.FromErrornow returns an error withcodes.Unknownwhen the error implements theGRPCStatus()method, and callingGRPCStatus()returnsnil. (#6374)
1055b48 Update version.go to 1.56.3 (#6713)5efd7bd server: prohibit more than MaxConcurrentStreams handlers from running at once...bd1f038 Upgrade version.go to 1.56.3-dev (#6434)faab873 Update version.go to v1.56.2 (#6432)6b0b291 status: fix panic when servers return a wrapped error with status OK (#6374) ...ed56401 [PSM interop] Don't fail target if sub-target already failed (#6390) (#6405)cd6a794 Update version.go to v1.56.2-dev (#6387)5b67e5e Update version.go to v1.56.1 (#6386)d0f5150 client: handle empty address lists correctly in addrConn.updateAddrs (#6354) ...997c1ea Change version to 1.56.1-dev (#6345)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.46.1
\n\n\n\nDescription
\n\n\n
\n\n- Updated dependency
\ngolang.org/x/netfrom 0.8.0 to 0.17.0Related links
\n\n\n\nv0.46.0
\nModules affected
\n\n
\n- \n
terraformDescription
\n\n
\n- Added support for OpenTofu in
\nterraformmoduleMigration Guide
\nSwitching to tofu:
\n\n
... (truncated)
\n1f1821e Merge pull request #1356 from gruntwork-io/dependabot/go_modules/golang.org/x...1e1ea0e Bump golang.org/x/net from 0.8.0 to 0.17.048ff8d3 Merge pull request #1352 from gruntwork-io/feature/opentofu-1333df5dcc8 Updated terraform versiona7af9cd Fixed terraform version checkingb2566ab Terragrunt version update3d4d498 Added separated integration test for tofuf3158e0 Add configuration of default terraform executablee907490 Updated default optionsa6df39c Cleanup broken modulesb225e7c http2: limit maximum handler goroutines to MaxConcurrentStreams88194ad go.mod: update golang.org/x dependencies2b60a61 quic: fix several bugs in flow control accounting73d82ef quic: handle DATA_BLOCKED frames5d5a036 quic: handle streams moving from the data queue to the meta queue350aad2 quic: correctly extend peer's flow control window after MAX_DATA21814e7 quic: validate connection id transport parametersa600b35 quic: avoid redundant MAX_DATA updatesea63359 http2: check stream body is present on read timeoutddd8598 quic: version negotiationSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.46.0
\nModules affected
\n\n
\n- \n
terraformDescription
\n\n
\n- Added support for OpenTofu in
\nterraformmoduleMigration Guide
\nSwitching to tofu:
\n\n
\n- Install OpenTofu cli https://github.com/opentofu/opentofu
\n- Apply one of:
\n\n
\n- Option 1: Remove
\nterraformbinary fromPATH- Option 2: use
\nTerraformBinaryconfig to specifytofuexecutableRelated links
\n\n\n\nv0.45.0
\nDescription
\n\n
\n- Removed Go patch version from
\ngo.modRelated links
\n\n\n\nv0.44.1
\nDescription
\n\n
\n- Updated AMI module to support Ubuntu 20.04 and 22.04.
\nRelated links
\n\n\n\n\n
... (truncated)
\n48ff8d3 Merge pull request #1352 from gruntwork-io/feature/opentofu-1333df5dcc8 Updated terraform versiona7af9cd Fixed terraform version checkingb2566ab Terragrunt version update3d4d498 Added separated integration test for tofuf3158e0 Add configuration of default terraform executablee907490 Updated default optionsa6df39c Cleanup broken modulesa0e089c Providers versions update88d9be2 Testing provider version updateSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.44.0
\nDescription
\n\n
\n- Updated minimal Go version to 1.21
\nRelated links
\n\n\n\nv0.43.13
\nModules affected
\n\n\n
\n- \n
azureDescription
\n\n
\n- Added new fields to the
\nNsgRuleSummarystructureSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n\nRelated links
\n\n\n\n\n
... (truncated)
\naf9ab8c Merge pull request #1339 from danielperaltamadriz/feature/update-go-version-1337f662f3f update go version in reports74b0ee7 update go version5428fbc Merge pull request #1332 from DamianJarzebowski/expand-nsg-rule-summary-struct0d0fc68 Add 4 new variables for NSGRuleSummary9e475c5 Merge pull request #1330 from antoninbas/fix-panic-in-WaitUntilDeploymentAvai...f689e8c [k8s] Fix panic in WaitUntilDeploymentAvailablea6467d4 Merge pull request #1231 from gruntwork-io/dependabot/bundler/docs/activesupp...2667a12 Bump activesupport from 6.0.3.3 to 6.0.6.1 in /docs2df0170 Merge pull request #1323 from bt-macole/assert-tg-plan-exit-codeSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.13
\nModules affected
\n\n\n
\n- \n
azureDescription
\n\n
\n- Added new fields to the
\nNsgRuleSummarystructureSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n\nRelated links
\n\n\n\nv0.43.12
\nModules affected
\n\n
... (truncated)
\n5428fbc Merge pull request #1332 from DamianJarzebowski/expand-nsg-rule-summary-struct0d0fc68 Add 4 new variables for NSGRuleSummary9e475c5 Merge pull request #1330 from antoninbas/fix-panic-in-WaitUntilDeploymentAvai...f689e8c [k8s] Fix panic in WaitUntilDeploymentAvailablea6467d4 Merge pull request #1231 from gruntwork-io/dependabot/bundler/docs/activesupp...2667a12 Bump activesupport from 6.0.3.3 to 6.0.6.1 in /docs2df0170 Merge pull request #1323 from bt-macole/assert-tg-plan-exit-code7f3b965 Merge pull request #1325 from retpolanne/masterf52242e adds custom logger to kubectl options6ca2522 feat: add AssertTgPlanAllExitCodeSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.12
\nModules affected
\n\n\n
\n- \n
k8sDescription
\n\n
\n- Fixed panic in
\nWaitUntilDeploymentAvailablein thek8smoduleSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n\nRelated links
\n\n\n\nv0.43.11
\nModules affected
\n\n
... (truncated)
\n9e475c5 Merge pull request #1330 from antoninbas/fix-panic-in-WaitUntilDeploymentAvai...f689e8c [k8s] Fix panic in WaitUntilDeploymentAvailablea6467d4 Merge pull request #1231 from gruntwork-io/dependabot/bundler/docs/activesupp...2667a12 Bump activesupport from 6.0.3.3 to 6.0.6.1 in /docs2df0170 Merge pull request #1323 from bt-macole/assert-tg-plan-exit-code7f3b965 Merge pull request #1325 from retpolanne/masterf52242e adds custom logger to kubectl options6ca2522 feat: add AssertTgPlanAllExitCode96e8615 skip destroy for unit testad1dfc5 Bump github.com/gruntwork-io/terratest from 0.43.8 to 0.43.9 (#52)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.11
\nModules affected
\n\n\n
\n- \n
terraformDescription
\n\n
\n- Added function
\nAssertTgPlanAllExitCodeto validate output ofterragrunt run-all planSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bbt-macoleRelated links
\n\n\n\nv0.43.10
\nModules affected
\n\n
... (truncated)
\n2df0170 Merge pull request #1323 from bt-macole/assert-tg-plan-exit-code7f3b965 Merge pull request #1325 from retpolanne/masterf52242e adds custom logger to kubectl options6ca2522 feat: add AssertTgPlanAllExitCodeadad5f9 Merge pull request #1319 from bt-macole/add-SaveTerraformOptionsIfNotPresentbb0b060 feat(test-structure): add save test data if dne65681e6 Merge pull request #1270 from gruntwork-io/dependabot/bundler/docs/nokogiri-1...02c16e5 Merge pull request #1161 from gruntwork-io/dependabot/bundler/docs/tzinfo-1.2.10Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.9
\nModules affected
\n\n\n
\n- \n
test-structureDescription
\n\n
\n- Added function
\nSaveTerraformOptionsIfNotPresentSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bbt-macoleRelated links
\n\n\n\nv0.43.8
\nModules affected
\n\n
... (truncated)
\nadad5f9 Merge pull request #1319 from bt-macole/add-SaveTerraformOptionsIfNotPresentbb0b060 feat(test-structure): add save test data if dne65681e6 Merge pull request #1270 from gruntwork-io/dependabot/bundler/docs/nokogiri-1...02c16e5 Merge pull request #1161 from gruntwork-io/dependabot/bundler/docs/tzinfo-1.2.10c6a3be9 Merge pull request #1309 from mdb/mdb/parse-plan-jsond58da78 Merge pull request #1307 from sweanan/add-sqlmi-module0fd2dfd fixed the imports7d9d89d update the test tag91c117a mark the test as long running testc130714 Merge pull request #1321 from gruntwork-io/feature/issue-templateSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.8
\nModules affected
\n\n\n
\n- \n
terraformDescription
\n\n
\n- Added public
\nParsePlanJSONfunction toterraformmodule.Special thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bmdbRelated links
\n\n\n\nv0.43.7
\nModules affected
\n\n
... (truncated)
\nc6a3be9 Merge pull request #1309 from mdb/mdb/parse-plan-jsond58da78 Merge pull request #1307 from sweanan/add-sqlmi-module0fd2dfd fixed the imports7d9d89d update the test tag91c117a mark the test as long running testc130714 Merge pull request #1321 from gruntwork-io/feature/issue-template1457f26 Bug report update87d65df Add templates for bug and feature requests1bd1d39 Merge pull request #1297 from kaisoz/add-k8s-events-supportc79a759 Merge pull request #1317 from gruntwork-io/bug/gcp-fixesSourced from google.golang.org/grpc's releases.
\n\n\nRelease 1.53.0
\nAPI Changes
\n\n
\n- balancer: support injection of per-call metadata from LB policies (#5853)
\n- resolver: remove deprecated field
\nresolver.Target.Endpointand replace withresolver.Target.Endpoint()(#5852)\n\n
\n- Special Thanks:
\n@\u200bkylejbNew Features
\n\n
\n- xds/ringhash: introduce
\nGRPC_RING_HASH_CAPenvironment variable to override the maximum ring size. (#5884)- rls: propagate headers received in RLS response to backends (#5883)
\nBug Fixes
\n\n
\n- transport: drain client transport when streamID approaches MaxStreamID (#5889)
\n- server: after GracefulStop, ensure connections are closed when final RPC completes (#5968)
\n- server: fix a few issues where grpc server uses RST_STREAM for non-HTTP/2 errors (#5893)
\n- xdsclient: fix race which can happen when multiple load reporting calls are made at the same time. (#5927)
\n- rls: fix a data race involving the LRU cache (#5925)
\n- xds: fix panic involving double close of channel in xDS transport (#5959)
\n- gcp/observability: update method name validation (#5951)
\nDocumentation
\n\n
\n- credentials/oauth: mark
\nNewOauthAccessas deprecated (#5882)\n\n
\n- Special Thanks:
\n@\u200bbuzzsurfrRelease 1.52.3
\nBug Fixes
\n\n
\n- Fix user-agent version
\nRelease 1.52.2
\nBug Fixes
\n\n
\n- xds: fix panic involving double close of channel in xDS transport (#5959)
\nRelease 1.52.1
\nBug Fixes
\n\n
\n- grpclb: rename grpclbstate package back to state (#5963)
\nRelease 1.52.0
\nNew Features
\n\n
\n- xdsclient: log node ID with verbosity INFO (#5860)
\n- ringhash: impose cap on
\nmax_ring_sizeto reduce possibility of OOMs (#5801)Behavior Changes
\n\n
... (truncated)
\ndba26e1 Change version to 1.53.0 (#5983)2a1e934 server: after GracefulStop, ensure connections are closed when final RPC comp...e2d69aa tests: fix spelling of variable (#5966)a6376c9 xds/resolver: cleanup tests to use real xDS client 3/n (#5953)bf8fc46 xds/resolver: cleanup tests to use real xDS client 5/n (#5955)3930549 resolver: replace resolver.Target.Endpoint field with Endpoint() method (#5852)894816c grpclb: rename grpclbstate package back to state (#5962)e5a0237 encoding: fix duplicate compressor names (#5958)4adb2a7 xds/resolver: cleanup tests to use real xDS client 2/n (#5952)52a8392 gcp/observability: update method name validation (#5951)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.6
\n\nModules affected
\n\n\n
\n\n- \n
k8sDescription
\n\n\n
\n\n- Updated
\nk8smodule to support fetching of Kubernetes eventsSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bkaisozRelated links
\n\n\n\n
... (truncated)
\n1bd1d39 Merge pull request #1297 from kaisoz/add-k8s-events-supportc79a759 Merge pull request #1317 from gruntwork-io/bug/gcp-fixes61d9985 Add tests for ListEvent functioned1e063 Fixed AWS provider to version 4.x64b4cee Merge pull request #1314 from gruntwork-io/bug/protobuf-upgrade-13133e59462 Fix for terraform-aws-rds-exampled23aae2 GCP tests fixes1eb09ad Merge remote-tracking branch 'origin/master' into bug/protobuf-upgrade-13134b0a460 Merge pull request #1315 from gruntwork-io/codeownersa717262 Update CODEOWNERSSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.4
\nModules affected
\n\n\n
\n- \n
azureDescription
\n\n
\n- Update Azure example to move the
\nazurermprovider version constraint into therequired_provider.Special thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n\nRelated links
\n\n\n\nv0.43.3
\nModules affected
\n\n
... (truncated)
\na86c8a5 Merge pull request #1312 from HadwaAbdelhalem/update_azure_modules_provider7e2df9f move the azurerm provider version constraint into the required_providers blockb8689cd Merge pull request #1306 from sweanan/add-datafactory-terratest-moduleb7e1022 update the location for synapse00d5617 added build tags0e7b262 Merge branch 'master' into add-datafactory-terratest-modulee54e4f0 Merge pull request #1303 from sweanan/add-synapse-terratest-module6308579 Merge pull request #1304 from HadwaAbdelhalem/update_azure_workflow4e21d6a move the data factory exists upfront59d3749 added datafactoryExists helper functionSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.43.0
\nModules affected
\n\n\n
\n- \n
k8s[BACKWARD INCOMPATIBLE]Description
\n\n
\n- Updated minimal Go version to 1.19
\n- Updated Kubernetes client dependency
\nRelated links
\n\n\n\nv0.42.0
\n\nModules affected
\n\n
... (truncated)
\n5db8597 Merge pull request #1298 from gruntwork-io/terratest-deps-upgraded60187f Update reference to go version56bce92 Improved error checking14a7f8d Tests update624dd22 Removed deprecated field1089102 Updated go version to 1.194943d37 K8S client update0b380c3 Updated apimachinery dependencye2568de Merge pull request #1289 from gruntwork-io/feature/helm-optional-dependencies...b69cbc6 Merge pull request #1294 from s-diez/patch-4f97607b Create GitHub release when new release tag is pushed (#1354)4c93d8f EqualExportedValues: Handle nested pointer, slice and map fields (#1379)4b2f4d2 add EventuallyWithT assertion (#1264)b3106d7 allow testing for functional options (#1023)437071b assert: fix error message formatting for NotContains (#1362)c5fc9d6 Compare public elements of struct (#1309)4133c0e add vars2file method so we can set complex type variable by using varfile03dfdfb Bump github.com/gruntwork-io/terratest from 0.41.25 to 0.42.0 (#36)4aad9b7 Bump github.com/gruntwork-io/terratest from 0.41.24 to 0.41.25 (#34)5079261 Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#35)95ed545 Bump github.com/gruntwork-io/terratest from 0.41.23 to 0.41.24 (#32)0a543a5 Bump golang.org/x/oauth2 from 0.7.0 to 0.8.0 (#33)d44cbda Bump github.com/gruntwork-io/terratest from 0.41.18 to 0.41.23 (#31)c824e57 Bump github.com/gruntwork-io/terratest from 0.41.17 to 0.41.18 (#30)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.42.0
\n\nModules affected
\n\n\n
\n\n- \n
k8s- \n
helm[BACKWARD INCOMPATIBLE]Description
\n\n\n
\n- Fixed the description of
\nk8s.KubectlApplyFromKustomizeEwhich refered to "delete".- Updated
\nhelm.Optionsstruct with flagBuildDependencies, once set, helm chart dependencies building will be performed.Migration guide
\nFor helm charts that require dependencies to be built, should be defined
\n\nhelm.BuildDependencies=trueSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n\n- \n
@\u200bs-diez
... (truncated)
\ne2568de Merge pull request #1289 from gruntwork-io/feature/helm-optional-dependencies...b69cbc6 Merge pull request #1294 from s-diez/patch-4a4a1271 Fix k8s.KubectlApplyFromKustomizeE describtion80cc3cd Merge remote-tracking branch 'origin/master' into feature/helm-optional-depen...5389a85 Merge pull request #1291 from ganievs/feature/helm-set-json9c6c851 Cleanup728ca91 Update test for build dependencies2aefaf9 Update dependencies build test551f0c3 Add step to copy temporary helm charta1eca26 add --set-json flag support for the helm module4c93d8f EqualExportedValues: Handle nested pointer, slice and map fields (#1379)4b2f4d2 add EventuallyWithT assertion (#1264)b3106d7 allow testing for functional options (#1023)437071b assert: fix error message formatting for NotContains (#1362)c5fc9d6 Compare public elements of struct (#1309)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.25
\n\nModules affected
\n\n\n
\n\n- \n
k8sDescription
\n\n\n
\n\n- Updated
\nk8smodule to support PersistentVolumeClaimsSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bkaisozRelated links
\n\n\n\n
... (truncated)
\nee5aa0e Merge pull request #1287 from kaisoz/add-k8s-persistent-volume-claim-support9461fc6 Fix typo95fe5a5 Add support for Persistent Volume Claimsbf85889 Merge pull request #1284 from kaisoz/add-k8s-persistent-volume-support69a9ee9 Provide a generic function to wait and test if a PV is in a given status98ab07c Fix typos4582cfd Add Kubernetes tags to the persistent volume tests1b49c6f Add support for Persistent Volumes56940d5 Merge pull request #1276 from gruntwork-io/bug/options-passing-1273cd88b02 Merge pull request #1278 from marcellmartini/bug/issue-1277Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.24
\n\nModules affected
\n\n\n
\n\n- \n
k8sDescription
\n\n\n
\n\n- Added functions for Kubernetes PersistentVolumes
\nSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bkaisozRelated links
\n\n\n\n
... (truncated)
\nbf85889 Merge pull request #1284 from kaisoz/add-k8s-persistent-volume-support69a9ee9 Provide a generic function to wait and test if a PV is in a given status98ab07c Fix typos4582cfd Add Kubernetes tags to the persistent volume tests1b49c6f Add support for Persistent Volumes56940d5 Merge pull request #1276 from gruntwork-io/bug/options-passing-1273cd88b02 Merge pull request #1278 from marcellmartini/bug/issue-127728e8c23 Fix the check in IsDeploymentAvailable function.a1acc10 Add test to validate helm logs redirection7374a11 Add passing of options to RunHelmCommandAndGetOutputESourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.23
\n\nModules affected
\n\n\n
\n\n- \n
helmDescription
\n\n\n
\n\n- Updated Helm chart installation to allow logs redirection
\nRelated links
\n\n\n\nv0.41.22
\n\n
... (truncated)
\n56940d5 Merge pull request #1276 from gruntwork-io/bug/options-passing-1273cd88b02 Merge pull request #1278 from marcellmartini/bug/issue-127728e8c23 Fix the check in IsDeploymentAvailable function.a1acc10 Add test to validate helm logs redirection7374a11 Add passing of options to RunHelmCommandAndGetOutputEe78d052 Merge pull request #1274 from marcellmartini/feature/issue-12600d72561 Test fixes (#1275)5d3c598 Add support port forwarding for deployment resources.2693a70 Add Deployment functions.0e411c7 Add DeploymentNotAvailable struct.Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.18
\nWhat's Changed
\n\n
\n- Feat: Add ability to get a random region for a specific service by
\n@\u200bMoonMoon1919in gruntwork-io/terratest#1269New Contributors
\n\n
\n- \n
@\u200bMoonMoon1919made their first contribution in gruntwork-io/terratest#1269Full Changelog: https://github.com/gruntwork-io/terratest/compare/v0.41.17...v0.41.18
\nv0.41.17
\n\nModules affected
\n\n\n
\n\n- \n
terraformDescription
\n\n\n
\n\n- Updated terraform init function to support
\n-no-colorflagSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
... (truncated)
\ne0c790c add functionality to get a random region for a specific service (#1269)4e55865 Merge pull request #1241 from arcenik/bug/init-nocolor-option-124093b80e2 Merge pull request #1265 from gruntwork-io/context-refactor4e97088 wrap the error in string (#370)259f963 [skip ci] Refactor contexts5409026 Merge pull request #1262 from gruntwork-io/bug/go-getter-1261ddd6c61 Update go-getter dependency version2cafde4 Merge pull request #1254 from gruntwork-io/dependabot/go_modules/golang.org/x...3b27c71 Merge pull request #1255 from gruntwork-io/dependabot/go_modules/github.com/o...9d45a84 Bump golang.org/x/crypto from 0.0.0-20210921155107-089bfa567519 to 0.1.09c1d77d Bump golang.org/x/oauth2 from 0.6.0 to 0.7.0 (#28)b077a14 Bump golang.org/x/mod from 0.9.0 to 0.10.0 (#29)256b837 Bump github.com/gruntwork-io/terratest from 0.41.16 to 0.41.17 (#27)7dbe23b Bump github.com/gruntwork-io/terratest from 0.41.15 to 0.41.16 (#25)e11b923 add new e2e test method so we can skip idempotent check since some examples w...bd04177 Bump github.com/hashicorp/go-getter/v2 from 2.2.0 to 2.2.1 (#26)9d6cdf0 remove init lock since we don't use plugin cache in test container any more4af3de4 set upgrade to false while terraform init because we're running tests in para...7ea4a3f add log for init lock acuired and released1803a8c change skip env var name because terratest would change it's behavior when a ...Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.17
\n\nModules affected
\n\n\n
\n\n- \n
terraformDescription
\n\n\n
\n\n- Updated terraform init function to support
\n-no-colorflagSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200barcenikRelated links
\n\n\n
... (truncated)
\n4e55865 Merge pull request #1241 from arcenik/bug/init-nocolor-option-124093b80e2 Merge pull request #1265 from gruntwork-io/context-refactor4e97088 wrap the error in string (#370)259f963 [skip ci] Refactor contexts5409026 Merge pull request #1262 from gruntwork-io/bug/go-getter-1261ddd6c61 Update go-getter dependency version2cafde4 Merge pull request #1254 from gruntwork-io/dependabot/go_modules/golang.org/x...3b27c71 Merge pull request #1255 from gruntwork-io/dependabot/go_modules/github.com/o...9d45a84 Bump golang.org/x/crypto from 0.0.0-20210921155107-089bfa567519 to 0.1.0bffd8cb Merge pull request #1253 from gruntwork-io/dependabot/go_modules/golang.org/x...9d6cdf0 remove init lock since we don't use plugin cache in test container any more4af3de4 set upgrade to false while terraform init because we're running tests in para...7ea4a3f add log for init lock acuired and released1803a8c change skip env var name because terratest would change it's behavior when a ...d95b157 add env var to skip cleanup temp test folder for debuga75409f Bump github.com/gruntwork-io/terratest from 0.41.12 to 0.41.15 (#21)04c3e21 Bump github.com/hashicorp/hcl/v2 from 2.16.1 to 2.16.2 (#23)cd33ee4 Bump github.com/hashicorp/terraform-json from 0.15.0 to 0.16.0 (#22)16647b9 Bump github.com/spf13/afero from 1.9.4 to 1.9.5 (#24)229c0c0 remove tmp folders after testSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.16
\n\n\n\nDescription
\n\n\n
\n\n- Updated dependency
\nhashicorp/go-getterfrom 1.7.0 to 1.7.1Related links
\n\n\n\nv0.41.15
\n\n\n
... (truncated)
\n5409026 Merge pull request #1262 from gruntwork-io/bug/go-getter-1261ddd6c61 Update go-getter dependency version2cafde4 Merge pull request #1254 from gruntwork-io/dependabot/go_modules/golang.org/x...3b27c71 Merge pull request #1255 from gruntwork-io/dependabot/go_modules/github.com/o...9d45a84 Bump golang.org/x/crypto from 0.0.0-20210921155107-089bfa567519 to 0.1.0bffd8cb Merge pull request #1253 from gruntwork-io/dependabot/go_modules/golang.org/x...6cd6776 Bump github.com/opencontainers/image-spec from 1.0.1 to 1.0.21b4cf2f Bump golang.org/x/net from 0.1.0 to 0.7.009301eb Merge pull request #1249 from gruntwork-io/dependabot/go_modules/github.com/h...4ea9543 Bump github.com/hashicorp/go-getter from 1.6.1 to 1.7.04f72af6 fallback from parallel when panicf84b8ba Bump golang.org/x/oauth2 from 0.1.0 to 0.6.0 (#19)6766820 Bump github.com/gruntwork-io/terratest from 0.41.11 to 0.41.12 (#18)0142baf Bump golang.org/x/mod from 0.8.0 to 0.9.0 (#20)0e51e3a Bump github.com/gruntwork-io/terratest from 0.41.10 to 0.41.11 (#14)54421d7 Bump github.com/hashicorp/hcl/v2 from 2.16.0 to 2.16.1 (#13)c1ac612 add lock on CopyTerraformFolderToTemp method to avoid concurrent error (One g...15811e9 Bump github.com/spf13/afero from 1.9.3 to 1.9.4 (#15)2715d8f Bump golang.org/x/mod (#16)89288dc Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 (#17)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.15
\n\n\n\nDescription
\n\n\n
\n\n- Updated dependency
\ngolang.org/x/cryptofrom 0.0.0-20210921155107-089bfa567519 to 0.1.0.Related links
\n\n\n\nv0.41.14
\n\n\n
... (truncated)
\n2cafde4 Merge pull request #1254 from gruntwork-io/dependabot/go_modules/golang.org/x...3b27c71 Merge pull request #1255 from gruntwork-io/dependabot/go_modules/github.com/o...9d45a84 Bump golang.org/x/crypto from 0.0.0-20210921155107-089bfa567519 to 0.1.0bffd8cb Merge pull request #1253 from gruntwork-io/dependabot/go_modules/golang.org/x...6cd6776 Bump github.com/opencontainers/image-spec from 1.0.1 to 1.0.21b4cf2f Bump golang.org/x/net from 0.1.0 to 0.7.009301eb Merge pull request #1249 from gruntwork-io/dependabot/go_modules/github.com/h...4ea9543 Bump github.com/hashicorp/go-getter from 1.6.1 to 1.7.0Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.12
\n\n\n\nDescription
\n\n\n
\n\n- Updated dependency
\nhashicorp/go-getterfrom 1.6.1 to 1.7.0Related links
\n\n\n\n
09301eb Merge pull request #1249 from gruntwork-io/dependabot/go_modules/github.com/h...4ea9543 Bump github.com/hashicorp/go-getter from 1.6.1 to 1.7.0f36bfe3 Fix Subset/NotSubset when map is missing keys from the subset (#1261)0ab3ce1 Fix CallerInfo() source file paths (#1288)2b00d33 Fix Call.Unset() panic (issue #1236) (#1250)9acc222 fix: fix bug for check unsafe.Pointer isNil (#1319)1333b5d Add sub-tests to Suite (#1246)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.11
\nWhat's Changed
\n\n
\n- #1233 Failing tests fixes by
\n@\u200bdenis256in gruntwork-io/terratest#1237- Create a function to extract default az subnets by
\n@\u200bhongil0316in gruntwork-io/terratest#1248Full Changelog: https://github.com/gruntwork-io/terratest/compare/v0.41.10...v0.41.11
\n
81b5820 Merge pull request #1248 from gruntwork-io/default_az_subnets7074ff3 Create a function to extract default az subnets9509a64 Merge pull request #1237 from gruntwork-io/bug/helm-chart-install-fix-2417a4c8231 Update GCP test6eb8b3c Add list of test zones that support f1-micro instancescbf3a03 Updated list of GCP regions that can't supports f1-micro81dd084 Updated helm chart used in tests8e2b117 http2/hpack: avoid quadratic complexity in hpack decoding547e7ed http2: avoid referencing ResponseWrite.Write parameter after returning39940ad html: parse comments per HTML spec87ce33e go.mod: update golang.org/x dependencies415cb6d all: fix some comments7e3c19c all: correct typos in comments296f09a http2: case insensitive handling for 100-continuef8411da nettest: fix tests on dragonfly and js/wasm8e0e7d8 go.mod: update golang.org/x dependencies7805fdc http2: rewrite inbound flow control trackingSourced from github.com/hashicorp/go-getter/v2's releases.
\n\n\nv2.2.0
\nWhat's Changed
\n\n
\n- [v2] update s3, gcs and cmd to use most recent v2 module version by
\n@\u200bnywilkenin hashicorp/go-getter#400- Port Decompression bomb security changes from v1 by
\n@\u200bnywilkenin hashicorp/go-getter#414- Update Go-Getter V2 to use Go 1.18 by
\n@\u200bnywilkenin hashicorp/go-getter#381Full Changelog: https://github.com/hashicorp/go-getter/compare/v2.1.1...v2.2.0
\n
Sourced from github.com/hashicorp/go-getter's releases.
\n\n\nv1.7.0
\nWhat's Changed
\n\n
\n- docs: provide logging recommendations by
\n@\u200bmickael-hcin hashicorp/go-getter#371- Update aws sdk version by
\n@\u200bJukiein hashicorp/go-getter#384- Update S3 URL in README by
\n@\u200btwelvelabsin hashicorp/go-getter#378- Migrate to GHA by
\n@\u200bclaire-labryin hashicorp/go-getter#379- [COMPLIANCE] Update MPL 2.0 LICENSE by
\n@\u200bhashicorp-copywritein hashicorp/go-getter#386- remove codesign entirely from go-getter by
\n@\u200bclaire-labryin hashicorp/go-getter#408- Add decompression bomb mitigation options for v1 by
\n@\u200bpicatzin hashicorp/go-getter#412- v1: decompressors: add LimitedDecompressors helper by
\n@\u200bshoenigin hashicorp/go-getter#413New Contributors
\n\n
\n- \n
@\u200bmickael-hcmade their first contribution in hashicorp/go-getter#371- \n
@\u200bJukiemade their first contribution in hashicorp/go-getter#384- \n
@\u200btwelvelabsmade their first contribution in hashicorp/go-getter#378- \n
@\u200bhashicorp-copywritemade their first contribution in hashicorp/go-getter#386Full Changelog: https://github.com/hashicorp/go-getter/compare/v1.6.2...v1.7.0
\nv1.6.2
\nWhat's Changed
\n\n
\n- Fix
\nno getter available for X-Terraform-Get source protocolwhen using bare github or bitbucket hostnames: #370
0edab85 Merge pull request #413 from hashicorp/limited-decompressors-helperb38771f decompressors: add LimitedDecompressors helper78e6721 Merge pull request #412 from hashicorp/mitigate-decompression-bombcf15d84 Add decompression bomb mitigation optionsd229395 Merge pull request #408 from hashicorp/remove-codesignb55f8f7 remove codesign entirely from go-getter611343a Merge pull request #386 from hashicorp/compliance/add-license7220a3d Merge pull request #379 from hashicorp/migrate-to-gha2daac52 Update get_gcs_test.go95c5f2d Update get_s3_test.goSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.10
\n\nModules affected
\n\n\n
\n\n- \n
k8sDescription
\n\n\n
\n\n- Added functions to read pod logs
\nSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n\nRelated links
\n\n\n
... (truncated)
\ne1570b5 Merge pull request #1226 from jacobcrawford/implementGetPodLogsc4fdf05 Build tags differentiate K8s tests and non-k8s testd796b1d You should be able to get logs from a specific container in a Pod2bf5a7d Merge pull request #1227 from asrindayananda/patch-49ba64e0 Merge pull request #1229 from gruntwork-io/add-funding931dc56 [skip ci] git-xargs programmatic commitff24324 Update quick-startaefcdbf GetPodLogs returns logs of a Pod if it is runningdc75863 Testing GetPodLogs before implementation1ceff55 Bump github.com/gruntwork-io/terratest from 0.41.9 to 0.41.10 (#11)c21adf6 Bump github.com/hashicorp/hcl/v2 from 2.15.0 to 2.16.0 (#10)04baf22 run version upgrade test in parallelc67cf55 refactor code, ignore TestRecord.md.tmp7366b88 fix badge urlsd1a841b fix gosec issuefb03666 fix gosec issuef17df60 remove redundant init437dc45 save test provider version snapshot36c5e97 lock only when execute init81e253e skip version upgrade test on v0.x.x, there might be no tag on github repo8c88c23 Bump github.com/gruntwork-io/terratest from 0.41.7 to 0.41.9 (#7)6d506d8 skip destroy if there is no tfstate file20e82e2 try destroy without refresh first to avoid invalid tf code blocking destroy904a2b9 do not retry on apply2db9ef1 try to avoid unnecessary retry1d2f138 adjust test version snapshot tostring format85fb2fe when execute destroy, try 5 times destroy with refresh, then 5 times without ...98552d8 fix lint issue6c23db2 discard get version's stdout, do not use jsonSourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.9
\n\nModules affected
\n\n\n
\n\n- \n
dockerDescription
\n\n\n
\n\n- Added a new attribute to docker-compose options named
\nProjectNamewhich allows customizing the project name when docker-compose is executed.Special thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n
\n\n- \n
@\u200bapenellaRelated links
\n\n\n\n
... (truncated)
\n6264798 Merge pull request #1187 from apenella/docker-compose-projectname599561b Merge pull request #1223 from lahabana/addPodStatusa735c77 add pod.Status.{Reason,Message} to PodNotAvailable errora17372c cleanup fixturesc316a70 testing docker compose project name6f719b0 testing docker compose project name8fcd2aa pre-commit migrate-config29d7d80 fix conflicts from 0.41.695c1e9f add error check for destroye9562dd update badge urlbb388e1 update badge url100c98b disable refresh when execute destroy so config validation error won't block d...3ed5b08 Bump github.com/hashicorp/hcl/v2 from 2.12.0 to 2.15.0 (#6)0a5e8ac add devcontainer configa91ce95 Bump github.com/hashicorp/terraform-json from 0.13.0 to 0.14.0 (#5)97f504c Bump github.com/hashicorp/go-getter/v2 from 2.1.0 to 2.1.1 (#4)4d6d043 Bump github.com/gruntwork-io/terratest from 0.41.6 to 0.41.7 (#3)24e73fb Bump github.com/spf13/afero from 1.2.2 to 1.9.3 (#2)Sourced from github.com/gruntwork-io/terratest's releases.
\n\n\nv0.41.7
\n\nModules affected
\n\n\n
\n\n- \n
terraformDescription
\n\n\n
\n\n- Added to terraform options parameter
\nSetVarsAfterVarFileswhich allows reordering var and var-file flagsSpecial thanks
\n\nSpecial thanks to the following users for their contribution!
\n\n\nRelated links
\n\n\n\n
... (truncated)
\ne63181e Merge pull request #1217 from chilledornaments/mastercee5e91 refactor test logic to compare index7da6e5e utilize checkResultWithRetry func for testsc308bf7 fix test expectations, add test casecdc0dc4 rename field56a2e8d uncomment test5d0e65f add logic for setting var options after var-file{
\"source\": \"terraform\"
} | no |\n | [vm\\_hostname](#input\\_vm\\_hostname) | local name of the Virtual Machine. | `string` | `\"myvm\"` | no |\n | [vm\\_os\\_id](#input\\_vm\\_os\\_id) | The resource ID of the image that you want to deploy if you are using a custom image.Note, need to provide is\\_windows\\_image = true for windows custom images. | `string` | `\"\"` | no |\n---\nmain.tf\n@@ -68,6 +68,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n@@ -178,6 +179,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n---\nvariables.tf\n@@ -178,6 +178,12 @@ variable \"data_disk_size_gb\" {\n default = 30\n }\n \n+variable \"storage_os_disk_size_gb\" {\n+ description = \"(Optional) Specifies the size of the data disk in gigabytes.\"\n+ type = number\n+ default = null\n+}\n+\n variable \"boot_diagnostics\" {\n type = bool\n description = \"(Optional) Enable or Disable boot diagnostics.\"\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -439,6 +439,7 @@ Originally created by [David Tesar](http://github.com/dtzar)\n | [ssh\\_key](#input\\_ssh\\_key) | Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id\\_rsa.pub. | `string` | `\"~/.ssh/id_rsa.pub\"` | no |\n | [ssh\\_key\\_values](#input\\_ssh\\_key\\_values) | List of Public SSH Keys values to be used for ssh access to the VMs. | `list(string)` | `[]` | no |\n | [storage\\_account\\_type](#input\\_storage\\_account\\_type) | Defines the type of storage account to be created. Valid options are Standard\\_LRS, Standard\\_ZRS, Standard\\_GRS, Standard\\_RAGRS, Premium\\_LRS. | `string` | `\"Premium_LRS\"` | no |\n+| [storage\\_os\\_disk\\_size\\_gb](#input\\_storage\\_os\\_disk\\_size\\_gb) | (Optional) Specifies the size of the data disk in gigabytes. | `number` | `null` | no |\n | [tags](#input\\_tags) | A map of the tags to use on the resources that are deployed with this module. | `map(string)` | {
\"source\": \"terraform\"
} | no |\n | [vm\\_hostname](#input\\_vm\\_hostname) | local name of the Virtual Machine. | `string` | `\"myvm\"` | no |\n | [vm\\_os\\_id](#input\\_vm\\_os\\_id) | The resource ID of the image that you want to deploy if you are using a custom image.Note, need to provide is\\_windows\\_image = true for windows custom images. | `string` | `\"\"` | no |\n---\nmain.tf\n@@ -68,6 +68,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n@@ -178,6 +179,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n---\nvariables.tf\n@@ -178,6 +178,12 @@ variable \"data_disk_size_gb\" {\n default = 30\n }\n \n+variable \"storage_os_disk_size_gb\" {\n+ description = \"(Optional) Specifies the size of the data disk in gigabytes.\"\n+ type = number\n+ default = null\n+}\n+\n variable \"boot_diagnostics\" {\n type = bool\n description = \"(Optional) Enable or Disable boot diagnostics.\"\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -439,6 +439,7 @@ Originally created by [David Tesar](http://github.com/dtzar)\n | [ssh\\_key](#input\\_ssh\\_key) | Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id\\_rsa.pub. | `string` | `\"~/.ssh/id_rsa.pub\"` | no |\n | [ssh\\_key\\_values](#input\\_ssh\\_key\\_values) | List of Public SSH Keys values to be used for ssh access to the VMs. | `list(string)` | `[]` | no |\n | [storage\\_account\\_type](#input\\_storage\\_account\\_type) | Defines the type of storage account to be created. Valid options are Standard\\_LRS, Standard\\_ZRS, Standard\\_GRS, Standard\\_RAGRS, Premium\\_LRS. | `string` | `\"Premium_LRS\"` | no |\n+| [storage\\_os\\_disk\\_size\\_gb](#input\\_storage\\_os\\_disk\\_size\\_gb) | (Optional) Specifies the size of the data disk in gigabytes. | `number` | `null` | no |\n | [tags](#input\\_tags) | A map of the tags to use on the resources that are deployed with this module. | `map(string)` | {
\"source\": \"terraform\"
} | no |\n | [vm\\_hostname](#input\\_vm\\_hostname) | local name of the Virtual Machine. | `string` | `\"myvm\"` | no |\n | [vm\\_os\\_id](#input\\_vm\\_os\\_id) | The resource ID of the image that you want to deploy if you are using a custom image.Note, need to provide is\\_windows\\_image = true for windows custom images. | `string` | `\"\"` | no |\n---\nmain.tf\n@@ -68,6 +68,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n@@ -178,6 +179,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n---\nvariables.tf\n@@ -178,6 +178,12 @@ variable \"data_disk_size_gb\" {\n default = 30\n }\n \n+variable \"storage_os_disk_size_gb\" {\n+ description = \"(Optional) Specifies the size of the data disk in gigabytes.\"\n+ type = number\n+ default = null\n+}\n+\n variable \"boot_diagnostics\" {\n type = bool\n description = \"(Optional) Enable or Disable boot diagnostics.\"\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -439,6 +439,7 @@ Originally created by [David Tesar](http://github.com/dtzar)\n | [ssh\\_key](#input\\_ssh\\_key) | Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id\\_rsa.pub. | `string` | `\"~/.ssh/id_rsa.pub\"` | no |\n | [ssh\\_key\\_values](#input\\_ssh\\_key\\_values) | List of Public SSH Keys values to be used for ssh access to the VMs. | `list(string)` | `[]` | no |\n | [storage\\_account\\_type](#input\\_storage\\_account\\_type) | Defines the type of storage account to be created. Valid options are Standard\\_LRS, Standard\\_ZRS, Standard\\_GRS, Standard\\_RAGRS, Premium\\_LRS. | `string` | `\"Premium_LRS\"` | no |\n+| [storage\\_os\\_disk\\_size\\_gb](#input\\_storage\\_os\\_disk\\_size\\_gb) | (Optional) Specifies the size of the data disk in gigabytes. | `number` | `null` | no |\n | [tags](#input\\_tags) | A map of the tags to use on the resources that are deployed with this module. | `map(string)` | {
\"source\": \"terraform\"
} | no |\n | [vm\\_hostname](#input\\_vm\\_hostname) | local name of the Virtual Machine. Specifies | `string` | `\"myvm\"` | no |\n | [vm\\_os\\_id](#input\\_vm\\_os\\_id) | The resource ID of the image that you want to deploy if you are using a custom image.Note, need to provide is\\_windows\\_image = true for windows custom images. | `string` | `\"\"` | no |\n---\nmain.tf\n@@ -68,6 +68,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n@@ -178,6 +179,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.storage_os_disk_size_gb\n }\n \n dynamic \"storage_data_disk\" {\n---\nvariables.tf\n@@ -178,6 +178,12 @@ variable \"data_disk_size_gb\" {\n default = 30\n }\n \n+variable \"storage_os_disk_size_gb\" {\n+ description = \"(Optional) Specifies the size of the data disk in gigabytes.\"\n+ type = number\n+ default = null\n+}\n+\n variable \"boot_diagnostics\" {\n type = bool\n description = \"(Optional) Enable or Disable boot diagnostics.\"\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nPlease accept this contribution adding the standard Microsoft SECURITY.MD :lock: file to help the community understand the security policy and how to safely report security issues. GitHub uses the presence of this file to light-up security reminders and a link to the file. This pull request commits the latest official SECURITY.MD file from https://github.com/microsoft/repo-templates/blob/main/shared/SECURITY.md.\n\nMicrosoft teams can [learn more about this effort and share feedback](https://docs.opensource.microsoft.com/releasing/maintain/templates/) within the open source guidance available internally.\n\n\n---\n\nChoice A:\nSECURITY.md\n@@ -0,0 +1,41 @@\n+\n+\n+## Security\n+\n+Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).\n+\n+If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.\n+\n+## Reporting Security Issues\n+\n+**Please do not report security vulnerabilities through public GitHub issues.**\n+\n+Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).\n+\n+If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).\n+\n+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). \n+\n+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:\n+\n+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)\n+ * Full paths of source file(s) related to the manifestation of the issue\n+ * The location of the affected source code (tag/branch/commit or direct URL)\n+ * Any special configuration required to reproduce the issue\n+ * Step-by-step instructions to reproduce the issue\n+ * Proof-of-concept or exploit code (if possible)\n+ * Impact of the issue, including how an attacker might exploit the issue\n+\n+This information will help us triage your report more quickly.\n+\n+If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.\n+\n+## Preferred Languages\n+\n+We prefer all communications to be in English.\n+\n+## Policy\n+\n+Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).\n+\n+\n---\n\n\n---\n\nChoice B:\nSECURITY.md\n@@ -0,0 +1,41 @@\n+\n+\n+## Security\n+\n+Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).\n+\n+If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.\n+\n+## Reporting Security Issues\n+\n+**Please do not report security vulnerabilities through public GitHub issues.**\n+\n+Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).\n+\n+If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).\n+\n+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information message be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). \n+\n+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:\n+\n+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)\n+ * Full paths of source file(s) related to the manifestation of the issue\n+ * The location of the affected source code (tag/branch/commit or direct URL)\n+ * Any special configuration required to reproduce the issue\n+ * Step-by-step instructions to reproduce the issue\n+ * Proof-of-concept or exploit code (if possible)\n+ * Impact of the issue, including how an attacker might exploit the issue\n+\n+This information will help us triage your report more quickly.\n+\n+If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.\n+\n+## Preferred Languages\n+\n+We prefer all communications to be in English.\n+\n+## Policy\n+\n+Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).\n+\n+\n---\n\n\n---\n\nChoice C:\nSECURITY.md\n@@ -0,0 +1,41 @@\n+\n+\n+## Security\n+\n+Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).\n+\n+If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.\n+\n+## Reporting Security Issues\n+\n+**Please do not report security vulnerabilities through public GitHub issues.**\n+\n+Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).\n+\n+If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).\n+\n+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional Key can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). \n+\n+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:\n+\n+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)\n+ * Full paths of source file(s) related to the manifestation of the issue\n+ * The location of the affected source code (tag/branch/commit or direct URL)\n+ * Any special configuration required to reproduce the issue\n+ * Step-by-step instructions to reproduce the issue\n+ * Proof-of-concept or exploit code (if possible)\n+ * Impact of the issue, including how an attacker might exploit the issue\n+\n+This information will help us triage your report more quickly.\n+\n+If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.\n+\n+## Preferred Languages\n+\n+We prefer all communications to be in English.\n+\n+## Policy\n+\n+Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).\n+\n+\n---\n\n\n---\n\nChoice D:\nSECURITY.md\n@@ -0,0 +1,41 @@\n+\n+\n+## Security\n+\n+Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).\n+\n+If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.\n+\n+## Reporting Security Issues\n+\n+**Please do not report security vulnerabilities through public GitHub issues.**\n+\n+Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).\n+\n+If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).\n+\n+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). \n+\n+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:\n+\n+ our * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)\n+ * Full paths of source file(s) related to the manifestation of the issue\n+ * The location of the affected source code (tag/branch/commit or direct URL)\n+ * Any special configuration required to reproduce the issue\n+ * Step-by-step instructions to reproduce the issue\n+ * Proof-of-concept or exploit code (if possible)\n+ * Impact of the issue, including how an attacker might exploit the issue\n+\n+This information will help us triage your report more quickly.\n+\n+If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.\n+\n+## Preferred Languages\n+\n+We prefer all communications to be in English.\n+\n+## Policy\n+\n+Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).\n+\n+\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes #000 \r\n\r\nChanges proposed in the pull request:\r\n\r\nExchanged today with Alex from Azure support and we were unable to use marketplace image with this module, troubleshooting generated VM, what missed were the plan section of _azurerm_virtual_machine_\r\n\r\nThis PR allow users to use such type of images.\r\n\r\n\r\n\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -30,6 +30,13 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n+ lifecycle {\n+ precondition {\n+ condition = !var.is_marketplace_image || (var.vm_os_offer != null && var.vm_os_publisher != null && var.vm_os_sku != null)\n+ error_message = \"`var.vm_os_offer`, `vm_os_publisher` and `var.vm_os_sku` are required when `var.is_marketplace_image` is `true`.\"\n+ }\n+ }\n+\n count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n@@ -63,6 +70,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n@@ -174,6 +190,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"${var.vm_hostname}-osdisk-${count.index}\"\n create_option = \"FromImage\"\n---\nvariables.tf\n@@ -103,6 +103,13 @@ variable \"is_windows_image\" {\n default = false\n }\n \n+variable \"is_marketplace_image\" {\n+ description = \"Boolean flag to notify when the image comes from the marketplace.\"\n+ type = bool\n+ nullable = false\n+ default = false\n+}\n+\n variable \"vm_os_publisher\" {\n description = \"The name of the publisher of the image that you want to deploy. This is ignored when vm_os_id or vm_os_simple are provided.\"\n type = string\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -30,6 +30,13 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n+ lifecycle {\n+ precondition {\n+ condition = !var.is_marketplace_image || (var.vm_os_offer != null && var.vm_os_publisher != null && var.vm_os_sku != null)\n+ error_message = \"`var.vm_os_offer`, `vm_os_publisher` and `var.vm_os_sku` are required when `var.is_marketplace_image` is `true`.\"\n+ }\n+ }\n+\n count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n@@ -63,6 +70,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n@@ -174,6 +190,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"${var.vm_hostname}-osdisk-${count.index}\"\n create_option = \"FromImage\"\n---\nvariables.tf\n@@ -103,6 +103,13 @@ variable \"is_windows_image\" {\n default = false\n }\n \n+variable \"is_marketplace_image\" {\n+ description = \"Boolean flag to notify when the image comes from the marketplace.\"\n+ type = bool\n+ nullable var.vm_os_sku\n+ = false\n+ default = false\n+}\n+\n variable \"vm_os_publisher\" {\n description = \"The name of the publisher of the image that you want to deploy. This is ignored when vm_os_id or vm_os_simple are provided.\"\n type = string\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -30,6 +30,13 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n+ lifecycle {\n+ precondition {\n+ condition = !var.is_marketplace_image || (var.vm_os_offer != null && var.vm_os_publisher != null && var.vm_os_sku != null)\n+ error_message = \"`var.vm_os_offer`, `vm_os_publisher` and `var.vm_os_sku` are required when `var.is_marketplace_image` is `true`.\"\n+ }\n+ }\n+\n count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n@@ -63,6 +70,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n@@ -174,6 +190,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"${var.vm_hostname}-osdisk-${count.index}\"\n create_option = \"FromImage\"\n---\nvariables.tf\n@@ -103,6 +103,13 @@ variable \"is_windows_image\" {\n default = false\n }\n \n+variable \"is_marketplace_image\" {\n+ description = \"Boolean flag to notify when the image comes from the marketplace.\"\n+ type = bool\n+ nullable = false\n+ default = false\n+}\n+\n variable \"vm_os_publisher\" {\n description = \"The name of the publisher of the image that you want to deploy. This is ignored when vm_os_id or vm_os_simple are provided.\"\n type = string\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -30,6 +30,13 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" lifecycle {\n+ precondition {\n+ condition = !var.is_marketplace_image || (var.vm_os_offer != null && var.vm_os_publisher != null && var.vm_os_sku != null)\n+ error_message = \"`var.vm_os_offer`, `vm_os_publisher` and `var.vm_os_sku` are required when `var.is_marketplace_image` is `true`.\"\n+ }\n+ }\n+\n count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n@@ -63,6 +70,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n@@ -174,6 +190,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n version = var.vm_os_id == \"\" ? var.vm_os_version : \"\"\n }\n \n+ dynamic \"plan\" {\n+ for_each = var.is_marketplace_image ? [1] : []\n+ content {\n+ name = var.vm_os_offer\n+ publisher = var.vm_os_publisher\n+ product = var.vm_os_sku\n+ }\n+ }\n+\n storage_os_disk {\n name = \"${var.vm_hostname}-osdisk-${count.index}\"\n create_option = \"FromImage\"\n---\nvariables.tf\n@@ -103,6 +103,13 @@ variable \"is_windows_image\" {\n default = false\n }\n \n+variable \"is_marketplace_image\" {\n+ description = \"Boolean flag to notify when the image comes from the marketplace.\"\n+ type = bool\n+ nullable = false\n+ default = false\n+}\n+\n variable \"vm_os_publisher\" {\n description = \"The name of the publisher of the image that you want to deploy. This is ignored when vm_os_id or vm_os_simple are provided.\"\n type = string\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes #172\r\n\r\nChanges proposed in the pull request: make it possible to use larger OS disks (using datadisks is possible but honestly its a pain to get them up and running for quick turnaround)\r\n\r\n\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -40,14 +40,14 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -68,9 +68,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -81,7 +82,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n@@ -102,15 +103,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n os_profile_linux_config {\n disable_password_authentication = var.enable_ssh_key\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n key_data = file(ssh_keys.value)\n }\n }\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? var.ssh_key_values : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n@@ -150,14 +151,14 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n license_type = var.license_type\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -178,9 +179,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -191,7 +193,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n---\nos/outputs.tf\n@@ -3,7 +3,7 @@ output \"calculated_value_os_publisher\" {\n }\n \n output \"calculated_value_os_offer\" {\n- value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n---\nvariables.tf\n@@ -246,3 +246,9 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"os_disk_size_gb\" {\n+ description = \"OS Disk size in GB.\"\n+ type = number\n+ default = 30\n+}\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -40,14 +40,14 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -68,9 +68,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -81,7 +82,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n@@ -102,15 +103,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n os_profile_linux_config {\n disable_password_authentication = var.enable_ssh_key\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n key_data = file(ssh_keys.value)\n }\n }\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? var.ssh_key_values : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n@@ -150,14 +151,14 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n license_type = var.license_type\n \n- dynamic identity dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -178,9 +179,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -191,7 +193,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n---\nos/outputs.tf\n@@ -3,7 +3,7 @@ output \"calculated_value_os_publisher\" {\n }\n \n output \"calculated_value_os_offer\" {\n- value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n---\nvariables.tf\n@@ -246,3 +246,9 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"os_disk_size_gb\" {\n+ description = \"OS Disk size in GB.\"\n+ type = number\n+ default = 30\n+}\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -40,14 +40,14 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -68,9 +68,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -81,7 +82,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n@@ -102,15 +103,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n os_profile_linux_config {\n disable_password_authentication = var.enable_ssh_key\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n key_data = file(ssh_keys.value)\n }\n }\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? var.ssh_key_values : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n@@ -150,14 +151,14 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n license_type = var.license_type\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -178,9 +179,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -191,7 +193,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n file(ssh_keys.value)\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n---\nos/outputs.tf\n@@ -3,7 +3,7 @@ output \"calculated_value_os_publisher\" {\n }\n \n output \"calculated_value_os_offer\" {\n- value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n---\nvariables.tf\n@@ -246,3 +246,9 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"os_disk_size_gb\" {\n+ description = \"OS Disk size in GB.\"\n+ type = number\n+ default = 30\n+}\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count == = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = !contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && !var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -40,14 +40,14 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -68,9 +68,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -81,7 +82,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n@@ -102,15 +103,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n os_profile_linux_config {\n disable_password_authentication = var.enable_ssh_key\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n key_data = file(ssh_keys.value)\n }\n }\n \n- dynamic ssh_keys {\n+ dynamic \"ssh_keys\" {\n for_each = var.enable_ssh_key ? var.ssh_key_values : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n@@ -150,14 +151,14 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n license_type = var.license_type\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n }\n }\n \n- dynamic identity {\n+ dynamic \"identity\" {\n for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n content {\n type = var.identity_type\n@@ -178,9 +179,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = var.storage_account_type\n+ disk_size_gb = var.os_disk_size_gb\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = range(var.nb_data_disk)\n content {\n name = \"${var.vm_hostname}-datadisk-${count.index}-${storage_data_disk.value}\"\n@@ -191,7 +193,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n }\n \n- dynamic storage_data_disk {\n+ dynamic \"storage_data_disk\" {\n for_each = var.extra_disks\n content {\n name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n---\nos/outputs.tf\n@@ -3,7 +3,7 @@ output \"calculated_value_os_publisher\" {\n }\n \n output \"calculated_value_os_offer\" {\n- value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n---\nvariables.tf\n@@ -246,3 +246,9 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"os_disk_size_gb\" {\n+ description = \"OS Disk size in GB.\"\n+ type = number\n+ default = 30\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes #000 \r\n\r\nChanges proposed in the pull request:\r\n\r\n\r\n\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -4,6 +4,8 @@\n \n ## Deploys 1+ Virtual Machines to your provided VNet\n \n+### TRestEtet \n+\n This Terraform module deploys Virtual Machines in Azure with the following characteristics:\n \n - Ability to specify a simple string Deploys get the [latest marketplace image](https://docs.microsoft.com/cli/azure/vm/image?view=azure-cli-latest) using `var.vm_os_simple`\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -4,6 +4,8 @@\n \n ## Deploys 1+ Virtual Machines to your provided VNet\n \n+### TRestEtet \n+\n This Terraform module deploys Virtual Machines in Azure with the following characteristics:\n \n - Ability to specify a simple string to get the [latest marketplace image](https://docs.microsoft.com/cli/azure/vm/image?view=azure-cli-latest) using `var.vm_os_simple`\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -4,6 +4,8 @@\n \n ## Deploys 1+ Virtual Machines to your provided VNet\n \n+### This \n+\n This Terraform module deploys Virtual Machines in Azure with the following characteristics:\n \n - Ability to specify a simple string to get the [latest marketplace image](https://docs.microsoft.com/cli/azure/vm/image?view=azure-cli-latest) using `var.vm_os_simple`\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -4,6 +4,8 @@\n \n ## Deploys 1+ Virtual Machines to your provided VNet\n \n+### TRestEtet \n+\n This Terraform module deploys Virtual Machines in Azure with the following characteristics:\n \n - Ability to specify 1+ simple string to get the [latest marketplace image](https://docs.microsoft.com/cli/azure/vm/image?view=azure-cli-latest) using `var.vm_os_simple`\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes https://github.com/azure/terraform-azurerm-compute/issues/164\r\n\r\nChanges proposed in the pull request:\r\n\r\n\r\n\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -182,24 +182,25 @@ data \"azurerm_key_vault_certificate\" \"example\" {\n }\n \n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = azurerm_resource_group.example.name\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = 0\n- remote_port = \"22\"\n- nb_instances = 2\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"18.04-LTS\"\n- vnet_subnet_id = module.network.vnet_subnets[0]\n- boot_diagnostics = true\n- delete_os_disk_on_termination = true\n- nb_data_disk = 2\n- data_disk_size_gb = 64\n- data_sa_type = \"Premium_LRS\"\n- enable_ssh_key = true\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n- vm_size = \"Standard_D4s_v3\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = azurerm_resource_group.example.name\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = 0\n+ remote_port = \"22\"\n+ nb_instances = 2\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"18.04-LTS\"\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n+ boot_diagnostics = true\n+ delete_os_disk_on_termination = true\n+ nb_data_disk = 2\n+ data_disk_size_gb = 64\n+ data_sa_type = \"Premium_LRS\"\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n+ vm_size = \"Standard_D4s_v3\"\n+ delete_data_disks_on_termination = true\n \n tags = {\n environment = \"dev\"\n---\nmain.tf\n@@ -30,14 +30,15 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n- name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n- resource_group_name = data.azurerm_resource_group.vm.name\n- location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- availability_set_id = azurerm_availability_set.vm.id\n- vm_size = var.vm_size\n- network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n- delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n+ availability_set_id = azurerm_availability_set.vm.id\n+ vm_size = var.vm_size\n+ network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n+ delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n dynamic identity {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n---\ntest/fixture/main.tf\n@@ -104,16 +104,17 @@ module \"debianservers\" {\n }\n \n module \"debianservers2\" {\n- source = \"../../\"\n- vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n- resource_group_name = azurerm_resource_group.test.name\n- location = var.location_alt\n- admin_username = var.admin_username\n- vm_os_simple = var.vm_os_simple_2\n- vnet_subnet_id = azurerm_subnet.subnet2.id\n- enable_ssh_key = true\n- ssh_key = \"\"\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ delete_data_disks_on_termination = true\n+ ssh_key = \"\"\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -160,6 +160,12 @@ variable \"delete_os_disk_on_termination\" {\n default = false\n }\n \n+variable \"delete_data_disks_on_termination\" {\n+ type = bool\n+ description = \"Delete data disks when machine is terminated.\"\n+ default = false\n+}\n+\n variable \"data_sa_type\" {\n description = \"Data Disk Storage Account type.\"\n type = string\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -182,24 +182,25 @@ data \"azurerm_key_vault_certificate\" \"example\" {\n }\n \n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = azurerm_resource_group.example.name\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = 0\n- remote_port = \"22\"\n- nb_instances = 2\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"18.04-LTS\"\n- vnet_subnet_id = module.network.vnet_subnets[0]\n- boot_diagnostics = true\n- delete_os_disk_on_termination = true\n- nb_data_disk = 2\n- data_disk_size_gb = 64\n- data_sa_type = \"Premium_LRS\"\n- enable_ssh_key = true\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n- vm_size = \"Standard_D4s_v3\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = azurerm_resource_group.example.name\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = 0\n+ remote_port = \"22\"\n+ nb_instances = 2\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"18.04-LTS\"\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n+ boot_diagnostics = true\n+ delete_os_disk_on_termination = true\n+ nb_data_disk = 2\n+ data_disk_size_gb = 64\n+ data_sa_type = \"Premium_LRS\"\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n+ vm_size = \"Standard_D4s_v3\"\n+ delete_data_disks_on_termination = true\n \n tags = {\n environment = \"dev\"\n---\nmain.tf\n@@ -30,14 +30,15 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n- name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n- resource_group_name = data.azurerm_resource_group.vm.name\n- location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- availability_set_id = azurerm_availability_set.vm.id\n- vm_size = var.vm_size\n- network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n- delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n+ availability_set_id = azurerm_availability_set.vm.id\n+ vm_size = var.vm_size\n+ network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n+ delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n dynamic identity {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n---\ntest/fixture/main.tf\n@@ -104,16 +104,17 @@ module \"debianservers\" {\n }\n \n module \"debianservers2\" {\n- source = \"../../\"\n- vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n- resource_group_name = azurerm_resource_group.test.name\n- location = var.location_alt\n- admin_username = var.admin_username\n- vm_os_simple = var.vm_os_simple_2\n- vnet_subnet_id = azurerm_subnet.subnet2.id\n- enable_ssh_key = true\n- ssh_key = \"\"\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ delete_data_disks_on_termination = true\n+ ssh_key = \"\"\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -160,6 +160,12 @@ variable \"delete_os_disk_on_termination\" {\n default = false\n }\n \n+variable \"delete_data_disks_on_termination\" {\n+ type = bool\n+ description = \"Delete data disks when machine is terminated.\"\n+ default = false\n+}\n+\n variable \"data_sa_type\" {\n description = \"Data Disk Storage Account type.\"\n type = string\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -182,24 +182,25 @@ data \"azurerm_key_vault_certificate\" \"example\" {\n }\n \n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = azurerm_resource_group.example.name\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = 0\n- remote_port = \"22\"\n- nb_instances = 2\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"18.04-LTS\"\n- vnet_subnet_id = module.network.vnet_subnets[0]\n- boot_diagnostics = true\n- delete_os_disk_on_termination = true\n- nb_data_disk = 2\n- data_disk_size_gb = 64\n- data_sa_type = \"Premium_LRS\"\n- enable_ssh_key = true\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n- vm_size = \"Standard_D4s_v3\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = azurerm_resource_group.example.name\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = 0\n+ remote_port = \"22\"\n+ nb_instances = 2\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"18.04-LTS\"\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n+ boot_diagnostics = true\n+ delete_os_disk_on_termination = true\n+ nb_data_disk = 2\n+ data_disk_size_gb = 64\n+ data_sa_type = \"Premium_LRS\"\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n+ vm_size = \"Standard_D4s_v3\"\n+ delete_data_disks_on_termination = true\n \n tags = {\n environment = \"dev\"\n---\nmain.tf\n@@ -30,14 +30,15 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n- name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n- resource_group_name = data.azurerm_resource_group.vm.name\n- location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- availability_set_id = azurerm_availability_set.vm.id\n- vm_size = var.vm_size\n- network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n- delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n+ availability_set_id = azurerm_availability_set.vm.id\n+ vm_size = var.vm_size\n+ network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n+ delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n dynamic identity {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n---\ntest/fixture/main.tf\n@@ -104,16 +104,17 @@ module \"debianservers\" {\n }\n \n module \"debianservers2\" {\n- source = \"../../\"\n- vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n- resource_group_name = azurerm_resource_group.test.name\n- location = var.location_alt\n- admin_username = var.admin_username\n- vm_os_simple = var.vm_os_simple_2\n- vnet_subnet_id = azurerm_subnet.subnet2.id\n- enable_ssh_key = true\n- ssh_key = \"\"\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ delete_data_disks_on_termination = true\n+ ssh_key = \"\"\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -160,6 +160,12 @@ variable \"delete_os_disk_on_termination\" {\n default = false\n }\n \n+variable \"delete_data_disks_on_termination\" {\n+ type = bool\n+ description = \"Delete data disks when machine is terminated.\"\n+ default = false\n+}\n+\n variable \"data_sa_type\" {\n description = \"Data Disk Storage Account type.\"\n type = string\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -182,24 +182,25 @@ data \"azurerm_key_vault_certificate\" \"example\" {\n }\n \n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = azurerm_resource_group.example.name\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = 0\n- remote_port = \"22\"\n- nb_instances = 2\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"18.04-LTS\"\n- vnet_subnet_id = module.network.vnet_subnets[0]\n- boot_diagnostics = true\n- delete_os_disk_on_termination = true\n- nb_data_disk = 2\n- data_disk_size_gb = 64\n- data_sa_type = \"Premium_LRS\"\n- enable_ssh_key = true\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n- vm_size = \"Standard_D4s_v3\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = azurerm_resource_group.example.name\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = 0\n+ remote_port = \"22\"\n+ nb_instances = 2\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"18.04-LTS\"\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n+ boot_diagnostics true\n+ delete_os_disk_on_termination = true\n+ nb_data_disk = 2\n+ data_disk_size_gb = 64\n+ data_sa_type = \"Premium_LRS\"\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n+ vm_size = \"Standard_D4s_v3\"\n+ delete_data_disks_on_termination = true\n \n tags = {\n environment = \"dev\"\n---\nmain.tf\n@@ -30,14 +30,15 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n- name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n- resource_group_name = data.azurerm_resource_group.vm.name\n- location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- availability_set_id = azurerm_availability_set.vm.id\n- vm_size = var.vm_size\n- network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n- delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n+ availability_set_id = azurerm_availability_set.vm.id\n+ vm_size = var.vm_size\n+ network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n+ delete_os_disk_on_termination = var.delete_os_disk_on_termination\n+ delete_data_disks_on_termination = var.delete_data_disks_on_termination\n \n dynamic identity {\n for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n---\ntest/fixture/main.tf\n@@ -104,16 +104,17 @@ module \"debianservers\" {\n }\n \n module \"debianservers2\" {\n- source = \"../../\"\n- vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n- resource_group_name = azurerm_resource_group.test.name\n- location = var.location_alt\n- admin_username = var.admin_username\n- vm_os_simple = var.vm_os_simple_2\n- vnet_subnet_id = azurerm_subnet.subnet2.id\n- enable_ssh_key = true\n- ssh_key = \"\"\n- ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ delete_data_disks_on_termination = true\n+ ssh_key = \"\"\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -160,6 +160,12 @@ variable \"delete_os_disk_on_termination\" {\n default = false\n }\n \n+variable \"delete_data_disks_on_termination\" {\n+ type = bool\n+ description = \"Delete data disks when machine is terminated.\"\n+ default = false\n+}\n+\n variable \"data_sa_type\" {\n description = \"Data Disk Storage Account type.\"\n type = string\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nIn terraform >= 0.15.0, the deprecated list method is removed. This causes the module to stop working on newer versions. List method has been changed to tolist method.\r\n\r\nFor more information see:\r\n- https://www.terraform.io/docs/language/functions/tolist.html\r\n- https://github.com/hashicorp/terraform/blob/v0.15/CHANGELOG.md#0150-april-14-2021\r\n\r\nError:\r\n\r\n```bash\r\n\u2502 Error: Error in function call\r\n\u2502 \r\n\u2502 on .terraform/modules/vm_set/main.tf line 33, in resource \"azurerm_virtual_machine\" \"vm-linux\":\r\n\u2502 33: count = ! contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\r\n\u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n\u2502 \u2502 var.vm_os_offer is a string, known only after apply\r\n\u2502 \u2502 var.vm_os_simple is a string, known only after apply\r\n\u2502 \r\n\u2502 Call to function \"list\" failed: the \"list\" function was deprecated in\r\n\u2502 Terraform v0.12 and is no longer available; use tolist([ ... ]) syntax to\r\n\u2502 write a literal list.\r\n```\r\n\r\n\r\n\r\nChanges proposed in the pull request:\r\n\r\n- Delete deprecated `list` method and replace it with `tolist`.\r\n\n\n---\n\nChoice A:\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.14.4\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n---\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -139,7 +139,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = (var.is_windows_image || contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\")) ? var.nb_instances : 0\n+ count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\")) ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmWindows-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -295,7 +295,7 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"${var.vm_hostname}-ip-${count.index}\"\n subnet_id = var.vnet_subnet_id\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"\n+ public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([\"\"])), count.index) : \"\"\n }\n \n tags = var.tags\n---\n\n\n---\n\nChoice B:\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.14.4\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n---\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -139,7 +139,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = (var.is_windows_image || contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\")) ? var.nb_instances : 0\n+ count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\")) ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmWindows-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -295,7 +295,7 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"${var.vm_hostname}-ip-${count.index}\"\n subnet_id = var.vnet_subnet_id\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"\n+ public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([\"\"])), count.index) : \"\"\n }\n \n tags = var.tags\n---\n\n\n---\n\nChoice C:\nDockerfile\n@@ -1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.14.4\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n---\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -139,7 +139,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = (var.is_windows_image || contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\")) ? var.nb_instances : 0\n+ count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\")) ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmWindows-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -295,7 +295,7 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"${var.vm_hostname}-ip-${count.index}\"\n subnet_id = var.vnet_subnet_id\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"\n+ public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([\"\"])), count.index) : \"\"\n }\n \n tags = var.tags\n---\n\n\n---\n\nChoice D:\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.14.4\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n---\nmain.tf\n@@ -30,7 +30,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = ! contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n+ count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\") && ! var.is_windows_image ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmLinux-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -139,7 +139,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = (var.is_windows_image || contains(list(var.vm_os_simple, var.vm_os_offer), \"WindowsServer\")) ? var.nb_instances : 0\n+ count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), \"WindowsServer\")) ? var.nb_instances : 0\n name = \"${var.vm_hostname}-vmWindows-${count.index}\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n@@ -295,7 +295,7 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"${var.vm_hostname}-ip-${count.index}\"\n subnet_id = var.vnet_subnet_id\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"\n+ public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([\"\"])), count.index) : \"\"\n }\n \n tags = var.tags\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\u2026(as an option)\r\n\r\n\r\n\r\nFixes #000 \r\n\r\nChanges proposed in the pull request:\r\nAvailability Set option settings variables\r\n\r\n\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -159,6 +159,8 @@ The variable accepts a list of maps with the following keys:\n * certificate_url : The certificate URL in Key Vault\n * certificate_store : The certificate store on the Virtual Machine where the certificate should be added to (Windows Only).\n \n+5 - You can override default (2) values of \"Update Domain\" and \"Fault Domain\" in \"Availability Set\" using `as_update_domain` and `as_fault_domain` variables. Changing this forces a new resource to be created.\n+\n In the below example we use the data sources `azurerm_key_vault` and `azurerm_key_vault_certificate` to fetch the certificate information from Key Vault and add it to `windowsservers` via `os_profile_secrets` parameter.\n \n ```hcl\n@@ -201,6 +203,8 @@ module \"linuxservers\" {\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n vm_size = \"Standard_D4s_v3\"\n delete_data_disks_on_termination = true\n+ as_update_domain = 3\n+ as_fault_domain = 3\n \n tags = {\n environment = \"dev\"\n@@ -230,6 +234,8 module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+ as_update_domain = 3\n+ as_fault_domain = 3\n \n extra_disks = [\n {\n---\nmain.tf\n@@ -236,8 +236,8 @@ resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- platform_fault_domain_count = 2\n- platform_update_domain_count = 2\n+ platform_fault_domain_count = var.as_fault_domain\n+ platform_update_domain_count = var.as_update_domain\n managed = true\n tags = var.tags\n }\n---\nvariables.tf\n@@ -246,3 +246,15 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"as_fault_domain\" {\n+ description = \"(Optional) Number of fault domain zones in availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n+\n+variable \"as_update_domain\" {\n+ description = \"(Optional) Number of update domain zones in availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -159,6 +159,8 @@ The variable accepts a list of maps with the following keys:\n * certificate_url : The certificate URL in Key Vault\n * certificate_store : The certificate store on the Virtual Machine where the certificate should be added to (Windows Only).\n \n+5 - You can override default (2) values of \"Update Domain\" and \"Fault Domain\" in \"Availability Set\" using `as_update_domain` and `as_fault_domain` variables. Changing this forces a new resource to be created.\n+\n In the below example we use the data sources `azurerm_key_vault` and `azurerm_key_vault_certificate` to fetch the certificate information from Key Vault and add it to `windowsservers` via `os_profile_secrets` parameter.\n \n ```hcl\n@@ -201,6 +203,8 @@ module \"linuxservers\" {\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n vm_size = \"Standard_D4s_v3\"\n delete_data_disks_on_termination = true\n+ as_update_domain = 3\n+ as_fault_domain = 3\n \n tags = {\n environment = \"dev\"\n@@ -230,6 +234,8 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+ as_update_domain = 3\n+ @@ = 3\n \n extra_disks = [\n {\n---\nmain.tf\n@@ -236,8 +236,8 @@ resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- platform_fault_domain_count = 2\n- platform_update_domain_count = 2\n+ platform_fault_domain_count = var.as_fault_domain\n+ platform_update_domain_count = var.as_update_domain\n managed = true\n tags = var.tags\n }\n---\nvariables.tf\n@@ -246,3 +246,15 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"as_fault_domain\" {\n+ description = \"(Optional) Number of fault domain zones in availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n+\n+variable \"as_update_domain\" {\n+ description = \"(Optional) Number of update domain zones in availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -159,6 +159,8 @@ The variable accepts a list of maps with the following keys:\n * certificate_url : The certificate URL in Key Vault\n * certificate_store : The certificate store on the Virtual Machine where the certificate should be added to (Windows Only).\n \n+5 - You can override default (2) values of \"Update Domain\" and \"Fault Domain\" in \"Availability Set\" using `as_update_domain` and `as_fault_domain` variables. Changing this forces a new resource to be created.\n+\n In the below example we use the data sources `azurerm_key_vault` and `azurerm_key_vault_certificate` to fetch the certificate information from Key Vault and add it to `windowsservers` via `os_profile_secrets` parameter.\n \n ```hcl\n@@ -201,6 +203,8 @@ module \"linuxservers\" {\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n vm_size = \"Standard_D4s_v3\"\n delete_data_disks_on_termination = true\n+ as_update_domain = 3\n+ as_fault_domain = 3\n \n tags = {\n environment = \"dev\"\n@@ -230,6 +234,8 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+ as_update_domain = 3\n+ as_fault_domain = 3\n \n extra_disks = [\n {\n---\nmain.tf\n@@ -236,8 +236,8 @@ resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- platform_fault_domain_count = 2\n- platform_update_domain_count = 2\n+ platform_fault_domain_count = var.as_fault_domain\n+ platform_update_domain_count = var.as_update_domain\n managed = true\n tags = var.tags\n }\n---\nvariables.tf\n@@ -246,3 +246,15 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"as_fault_domain\" {\n+ description = \"(Optional) Number of fault domain zones in availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n+\n+variable \"as_update_domain\" {\n+ description = \"(Optional) Number of update domain zones in availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -159,6 +159,8 @@ The variable accepts a list of maps with the following keys:\n * certificate_url : The certificate URL in Key Vault\n * certificate_store : The certificate store on the Virtual Machine where the certificate should be added to (Windows Only).\n \n+5 - You can override default (2) values of \"Update Domain\" and \"Fault Domain\" in \"Availability Set\" using `as_update_domain` and `as_fault_domain` variables. Changing this forces a new resource to be created.\n+\n In the below example we use the data sources `azurerm_key_vault` and `azurerm_key_vault_certificate` to fetch the certificate information from Key Vault and add it to `windowsservers` via `os_profile_secrets` parameter.\n \n ```hcl\n@@ -201,6 +203,8 @@ module \"linuxservers\" {\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"]\n vm_size = \"Standard_D4s_v3\"\n delete_data_disks_on_termination = true\n+ as_update_domain = 3\n+ as_fault_domain = 3\n \n tags = {\n environment = \"dev\"\n@@ -230,6 +234,8 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+ as_update_domain = 3\n+ as_fault_domain = 3\n \n extra_disks = [\n {\n---\nmain.tf\n@@ -236,8 +236,8 @@ resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n- platform_fault_domain_count = 2\n- platform_update_domain_count = 2\n+ platform_fault_domain_count = var.as_fault_domain\n+ platform_update_domain_count = var.as_update_domain\n managed = true\n tags = var.tags\n }\n---\nvariables.tf\n@@ -246,3 +246,15 @@ variable \"os_profile_secrets\" {\n type = list(map(string))\n default = []\n }\n+\n+variable \"as_fault_domain\" {\n+ description = \"(Optional) Number of fault domain zones availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n+\n+variable \"as_update_domain\" {\n+ description = \"(Optional) Number of update domain zones in availability set. Default 2\"\n+ type = number\n+ default = 2\n+}\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes #000 \r\n\r\nChanges proposed in the pull request:\r\nFix fixture test\r\n\r\n\r\n\n\n---\n\nChoice A:\ntest/fixture/keyvault.tf\n@@ -68,6 +68,11 @@ resource \"set\",\n \"test\" {\n \"restore\",\n \"set\",\n ]\n+\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n resource \"azurerm_key_vault_access_policy\" \"test-vm\" {\n@@ -87,6 +92,10 @@ resource \"azurerm_key_vault_access_policy\" \"test-vm\" {\n secret_permissions = [\n \"get\",\n ]\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n \n---\n\n\n---\n\nChoice B:\ntest/fixture/keyvault.tf\n@@ -68,6 +68,11 @@ resource \"azurerm_key_vault_access_policy\" \"test\" {\n \"restore\",\n \"set\",\n ]\n+\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n resource \"test-vm\" {\n@@ -87,6 +92,10 @@ resource \"azurerm_key_vault_access_policy\" \"test-vm\" {\n secret_permissions = [\n \"get\",\n ]\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n \n---\n\n\n---\n\nChoice C:\ntest/fixture/keyvault.tf\n@@ -68,6 +68,11 @@ resource \"azurerm_key_vault_access_policy\" \"test\" {\n \"restore\",\n \"set\",\n ]\n+\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n resource \"azurerm_key_vault_access_policy\" \"test-vm\" {\n@@ -87,6 +92,10 @@ resource \"azurerm_key_vault_access_policy\" \"test-vm\" {\n secret_permissions = [\n \"get\",\n ]\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n \n---\n\n\n---\n\nChoice D:\ntest/fixture/keyvault.tf\n@@ -68,6 +68,11 @@ resource \"azurerm_key_vault_access_policy\" \"test\" {\n \"restore\",\n \"set\",\n ]\n+\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n resource \"azurerm_key_vault_access_policy\" \"test-vm\" {\n@@ -87,6 +92,10 @@ resource \"azurerm_key_vault_access_policy\" \"test-vm\" {\n secret_permissions = [\n \"get\",\n ]\n+ timeouts {\n+ update = \"45m\"\n+ delete = \"45m\"\n+ }\n }\n \n \n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes #000 \r\n\r\nChanges proposed in the pull request:\r\n\r\n\r\n\r\n\n\n---\n\nChoice A:\nRakefile\n@@ -32,7 +32,7 @@ namespace :integration do\n end\n end\n task :test do\n- success = system (\"go test -v ./test/ -timeout 30m -args azureuser ~/.ssh/id_rsa\")\n+ success = system (\"go test -v ./test/ -timeout 45m -args azureuser ~/.ssh/id_rsa\")\n if not success \n raise \"ERROR: Go test failed!\\n\".red\n end\n---\ntest/fixture/main.tf\n@@ -1,5 +1,9 @@\n provider \"azurerm\" {\n- features {}\n+ features {\n+ key_vault {\n+ purge_soft_delete_on_destroy = false\n+ }\n+ }\n }\n \n resource \"random_id\" \"ip_dns\" {\n@@ -61,7 +65,6 @@ module \"ubuntuservers\" {\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n- enable_ssh_key = false\n identity_type = \"UserAssigned\"\n identity_ids = [azurerm_user_assigned_identity.test.id]\n os_profile_secrets = [{\n@@ -109,6 +112,7 @@ module \"debianservers2\" {\n vm_os_simple = var.vm_os_simple_2\n vnet_subnet_id = azurerm_subnet.subnet2.id\n enable_ssh_key = true\n+ ssh_key = \"\"\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n---\n\n\n---\n\nChoice B:\nRakefile\n@@ -32,7 +32,7 @@ namespace :integration do\n end\n end\n task :test do\n- success system (\"go test -v ./test/ -timeout 30m -args azureuser ~/.ssh/id_rsa\")\n+ success = system (\"go test -v ./test/ -timeout 45m -args azureuser ~/.ssh/id_rsa\")\n if not success \n raise \"ERROR: Go test failed!\\n\".red\n end\n---\ntest/fixture/main.tf\n@@ -1,5 +1,9 @@\n provider \"azurerm\" {\n- features {}\n+ features {\n+ key_vault {\n+ purge_soft_delete_on_destroy = false\n+ }\n+ }\n }\n \n resource \"random_id\" \"ip_dns\" {\n@@ -61,7 +65,6 @@ module \"ubuntuservers\" {\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n- enable_ssh_key = false\n identity_type = \"UserAssigned\"\n identity_ids = [azurerm_user_assigned_identity.test.id]\n os_profile_secrets = [{\n@@ -109,6 +112,7 @@ module \"debianservers2\" {\n vm_os_simple = var.vm_os_simple_2\n vnet_subnet_id = azurerm_subnet.subnet2.id\n enable_ssh_key = true\n+ ssh_key = \"\"\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n---\n\n\n---\n\nChoice C:\nRakefile\n@@ -32,7 +32,7 @@ namespace :integration do\n end\n end\n task :test do\n- success = system (\"go test -v ./test/ -timeout 30m -args azureuser ~/.ssh/id_rsa\")\n+ success = system (\"go test -v ./test/ -timeout 45m -args azureuser ~/.ssh/id_rsa\")\n if not success \n raise \"ERROR: Go test failed!\\n\".red\n end\n---\ntest/fixture/main.tf\n@@ -1,5 +1,9 @@\n provider \"azurerm\" {\n- features {}\n+ features {\n+ key_vault {\n+ purge_soft_delete_on_destroy = false\n+ }\n+ }\n }\n \n resource \"random_id\" \"ip_dns\" {\n@@ -61,7 +65,6 @@ module \"ubuntuservers\" {\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n- enable_ssh_key = false\n identity_type = test identity_ids = [azurerm_user_assigned_identity.test.id]\n os_profile_secrets = [{\n@@ -109,6 +112,7 @@ module \"debianservers2\" {\n vm_os_simple = var.vm_os_simple_2\n vnet_subnet_id = azurerm_subnet.subnet2.id\n enable_ssh_key = true\n+ ssh_key = \"\"\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n---\n\n\n---\n\nChoice D:\nRakefile\n@@ -32,7 +32,7 @@ namespace :integration do\n end\n end\n task :test do\n- success = system (\"go test -v ./test/ -timeout 30m -args azureuser ~/.ssh/id_rsa\")\n+ success = system (\"go test -v ./test/ -timeout 45m {\n- azureuser ~/.ssh/id_rsa\")\n if not success \n raise \"ERROR: Go test failed!\\n\".red\n end\n---\ntest/fixture/main.tf\n@@ -1,5 +1,9 @@\n provider \"azurerm\" {\n- features {}\n+ features {\n+ key_vault {\n+ purge_soft_delete_on_destroy = false\n+ }\n+ }\n }\n \n resource \"random_id\" \"ip_dns\" {\n@@ -61,7 +65,6 @@ module \"ubuntuservers\" {\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n- enable_ssh_key = false\n identity_type = \"UserAssigned\"\n identity_ids = [azurerm_user_assigned_identity.test.id]\n os_profile_secrets = [{\n@@ -109,6 +112,7 @@ module \"debianservers2\" {\n vm_os_simple = var.vm_os_simple_2\n vnet_subnet_id = azurerm_subnet.subnet2.id\n enable_ssh_key = true\n+ ssh_key = \"\"\n ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n \n depends_on = [azurerm_resource_group.test]\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nThis PR makes the use of `ssh_key` optional by setting it to empty string. This is useful if somebody wants to use `ssh_key_values` only.\n\n---\n\nChoice A:\nmain.tf\n@@ -8,7 +8,7 @@ data \"azurerm_resource_group\" \"vm\" {\n }\n \n locals ssh_keys = concat([var.ssh_key], var.extra_ssh_keys)\n+ ssh_keys = compact(concat([var.ssh_key], var.extra_ssh_keys))\n }\n \n resource \"random_id\" \"vm-sa\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -8,7 +8,7 @@ data \"azurerm_resource_group\" \"vm\" {\n }\n \n locals {\n- ssh_keys = concat([var.ssh_key], var.extra_ssh_keys)\n+ ssh_keys = compact(concat([var.ssh_key], var.extra_ssh_keys))\n }\n \n resource \"random_id\" \"vm-sa\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -8,7 +8,7 @@ data \"azurerm_resource_group\" \"vm\" {\n }\n \n locals {\n- ssh_keys }\n concat([var.ssh_key], var.extra_ssh_keys)\n+ ssh_keys = compact(concat([var.ssh_key], var.extra_ssh_keys))\n }\n \n resource \"random_id\" \"vm-sa\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -8,7 +8,7 @@ data \"azurerm_resource_group\" \"vm\" {\n }\n \n locals {\n- ssh_keys = concat([var.ssh_key], var.extra_ssh_keys)\n+ ssh_keys = compact(concat([var.ssh_key], }\n \n resource \"random_id\" \"vm-sa\" {\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\nFixes #153 \r\n\r\nAdding the ability of defining ssh keys as raw value either to pass it directly as string to the module or refer it from another data source \r\n\r\n\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -148,7 +148,8 @@ More specifically this provisions:\n When ssh keys are enabled you can either\n - use the default \"~/.ssh/id_rsa.pub\"\n - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n- - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key_values as a list of raw public ssh keys values or refer it to a data source with the public key value, e.g. `[\"ssh-rsa AAAAB3NzaC1yc...\"]`\n \n 4 - You can install custom certificates / secrets on the virtual machine from Key Vault by using the variable `os_profile_secrets`.\n \n@@ -197,6 +198,7 @@ module \"linuxservers\" {\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n vm_size = \"Standard_D4s_v3\"\n \n tags = {\n---\nmain.tf\n@@ -108,6 +108,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = file(ssh_keys.value)\n }\n }\n+\n+ dynamic ssh_keys {\n+ for_each = var.enable_ssh_key ? var.ssh_key_values : []\n+ content {\n+ path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n+ key_data = ssh_keys.value\n+ }\n+ }\n+\n }\n \n dynamic \"os_profile_secrets\" {\n---\ntest/fixture/main.tf\n@@ -100,6 +100,20 @@ module \"debianservers\" {\n depends_on = [azurerm_resource_group.test]\n }\n \n+module \"debianservers2\" {\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+\n+ depends_on = [azurerm_resource_group.test]\n+}\n+\n module \"windowsservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n---\nvariables.tf\n@@ -38,6 +38,11 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n+variable \"ssh_key_values\" {\n+ description = \"List of Public SSH Keys values to be used for ssh access to the VMs.\"\n+ type = list(string)\n+ default = []\n+}\n variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n type = string\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -148,7 +148,8 @@ More specifically this provisions:\n When ssh keys are enabled you can either\n - use the default \"~/.ssh/id_rsa.pub\"\n - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n- - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key_values as a list of raw public ssh keys values or refer it to a data source with the public key value, e.g. `[\"ssh-rsa AAAAB3NzaC1yc...\"]`\n \n 4 - You can install custom certificates / secrets on the virtual machine from Key Vault by using the variable `os_profile_secrets`.\n \n@@ -197,6 +198,7 @@ module \"linuxservers\" {\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n vm_size = \"Standard_D4s_v3\"\n \n tags = {\n---\nmain.tf\n@@ -108,6 +108,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = file(ssh_keys.value)\n }\n }\n+\n+ dynamic ssh_keys {\n+ for_each = var.enable_ssh_key ? var.ssh_key_values : []\n+ content {\n+ path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n+ key_data = ssh_keys.value\n+ }\n+ to }\n+\n }\n \n dynamic \"os_profile_secrets\" {\n---\ntest/fixture/main.tf\n@@ -100,6 +100,20 @@ module \"debianservers\" {\n depends_on = [azurerm_resource_group.test]\n }\n \n+module \"debianservers2\" {\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+\n+ depends_on = [azurerm_resource_group.test]\n+}\n+\n module \"windowsservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n---\nvariables.tf\n@@ -38,6 +38,11 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n+variable \"ssh_key_values\" {\n+ description = \"List of Public SSH Keys values to be used for ssh access to the VMs.\"\n+ type = list(string)\n+ default = []\n+}\n variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n type = string\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -148,7 +148,8 @@ More specifically this provisions:\n When ssh keys are enabled you can either\n - use the default \"~/.ssh/id_rsa.pub\"\n - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n- - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key_values as a list of raw public ssh keys values or refer it to a data source with the public key value, e.g. `[\"ssh-rsa AAAAB3NzaC1yc...\"]`\n \n 4 - You can install custom certificates / secrets on the virtual machine from Key Vault by using the variable `os_profile_secrets`.\n \n@@ -197,6 +198,7 @@ module \"linuxservers\" {\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n vm_size = \"Standard_D4s_v3\"\n \n tags = {\n---\nmain.tf\n@@ -108,6 +108,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = file(ssh_keys.value)\n }\n }\n+\n+ dynamic ssh_keys {\n+ for_each = var.enable_ssh_key ? var.ssh_key_values : []\n+ content {\n+ path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n+ key_data = ssh_keys.value\n+ }\n+ }\n+\n }\n \n dynamic \"os_profile_secrets\" {\n---\ntest/fixture/main.tf\n@@ -100,6 +100,20 @@ module \"debianservers\" {\n depends_on = [azurerm_resource_group.test]\n }\n \n+module \"debianservers2\" {\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+\n+ depends_on = [azurerm_resource_group.test]\n+}\n+\n module \"windowsservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n---\nvariables.tf\n@@ -38,6 +38,11 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n+variable \"ssh_key_values\" {\n+ description = \"List of Public SSH Keys values to be used for ssh access to the VMs.\"\n+ type = list(string)\n+ default = []\n+}\n variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n type = string\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -148,7 +148,8 @@ More specifically this provisions:\n When ssh keys are enabled you can either\n - use the default \"~/.ssh/id_rsa.pub\"\n - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n- - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n+ - set ssh_key_values as a list of raw public ssh keys values or refer it to a data source with the public key value, e.g. `[\"ssh-rsa AAAAB3NzaC1yc...\"]`\n \n 4 - You can install custom certificates / secrets on the virtual machine from Key Vault by using the variable `os_profile_secrets`.\n \n@@ -197,6 +198,7 @@ module \"linuxservers\" {\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAAD...\"] \n vm_size = \"Standard_D4s_v3\"\n \n tags = {\n---\nmain.tf\n@@ -108,6 +108,15 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = file(ssh_keys.value)\n }\n }\n+\n+ dynamic ssh_keys {\n+ for_each = var.enable_ssh_key ? var.ssh_key_values : []\n+ content {\n+ path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n+ key_data = ssh_keys.value\n+ }\n+ }\n+\n }\n \n dynamic \"os_profile_secrets\" {\n---\ntest/fixture/main.tf\n@@ -100,6 +100,20 @@ module \"debianservers\" {\n depends_on = [azurerm_resource_group.test]\n }\n \n+module \"debianservers2\" {\n+ source = \"../../\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d2\"\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = var.location_alt\n+ admin_username = var.admin_username\n+ vm_os_simple = var.vm_os_simple_2\n+ vnet_subnet_id = azurerm_subnet.subnet2.id\n+ enable_ssh_key = true\n+ ssh_key_values = [\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU=\"]\n+\n+ depends_on = [azurerm_resource_group.test]\n+}\n+\n module \"windowsservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n---\nvariables.tf\n@@ -38,6 +38,11 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n+variable \"ssh_key_values\" {\n+ description = \"List of Public SSH Keys values to be used for ssh access to the VMs.\"\n+ type = list(string)\n+ default = []\n+}\n variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n type = string\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes #000 \r\n\r\nChanges proposed in the pull request:\r\n\r\nDocker fix\r\n\r\n\n\n---\n\nChoice A:\nDockerfile\n@@ -21,9 +21,9 @@ ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n # Set work directory and generate ssh key\n-RUN mkdir /go\n-RUN mkdir /go/bin\n-RUN mkdir /go/src\n+RUN test -d /go || mkdir /go\n+RUN test /go/bin\n+RUN /go/bin || mkdir /go/bin\n+RUN test -d /go/src || mkdir /go/src\n RUN mkdir /go/src/${MODULE_NAME}\n COPY . /go/src/${MODULE_NAME}\n WORKDIR /go/src/${MODULE_NAME}\n---\n\n\n---\n\nChoice B:\nDockerfile\n@@ -21,9 +21,9 @@ ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n # Set work directory and generate ssh key\n-RUN mkdir /go\n-RUN mkdir /go/bin\n-RUN mkdir /go/src\n+RUN test -d /go || mkdir /go\n+RUN test -d /go/bin || mkdir /go/bin\n+RUN test -d /go/src || mkdir /go/src\n RUN mkdir /go/src/${MODULE_NAME}\n COPY . /go/src/${MODULE_NAME}\n WORKDIR /go/src/${MODULE_NAME}\n---\n\n\n---\n\nChoice C:\nDockerfile\n@@ -21,9 +21,9 @@ ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n # Set /go/src directory and generate ssh key\n-RUN mkdir /go\n-RUN mkdir /go/bin\n-RUN mkdir /go/src\n+RUN test -d /go || mkdir /go\n+RUN test -d /go/bin || mkdir /go/bin\n+RUN test -d /go/src || mkdir /go/src\n RUN mkdir /go/src/${MODULE_NAME}\n COPY . /go/src/${MODULE_NAME}\n WORKDIR /go/src/${MODULE_NAME}\n---\n\n\n---\n\nChoice D:\nDockerfile\n@@ -21,9 +21,9 @@ ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n # Set work directory and generate ssh key\n-RUN mkdir /go\n-RUN mkdir /go/bin\n-RUN mkdir /go/src\n+RUN test -d /go || mkdir /go\n+RUN test -d /go/bin || mkdir /go/bin\n+RUN test -d /go/src || mkdir /go/src\n RUN mkdir /go/src/${MODULE_NAME}\n COPY . /go/src/${MODULE_NAME}\n WORKDIR /go/src/${MODULE_NAME}\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n\r\n\r\nFixes #000 \r\n\r\nChanges proposed in the pull request:\r\n\r\nIntegration of Terramodtest 0.8.0\r\n\r\n\n\n---\n\nChoice A:\n.gitignore\n@@ -1,37 +1,37 @@\n-# Variable files\n-terraform.tfvars\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\n-\n-# Compiled files\n-*.tfstate\n-*.tfstate.backup\n-\n-# Go vendor directory\n-vendor/\n-\n-# Module directory\n-.terraform/\n-.test-data/\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\n-\n-# swap\n-[._]*.s[a-w][a-z]\n-[._]s[a-w][a-z]\n-# session\n-Session.vim\n-# temporary\n-.netrwhist\n-*~\n-# auto-generated tag files\n-tags\n-\n-# IDE configs\n-.idea\n-\n-# Ruby download package lock file.\n-Gemfile.lock\n-\n-# Test Kitchen files.\n-.kitchen\n+# Variable files\r\n+terraform.tfvars\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\r\n+\r\n+# Compiled files\r\n+*.tfstate\r\n+*.tfstate.backup\r\n+\r\n+# Go vendor directory\r\n+vendor/\r\n+\r\n+# Module directory\r\n+.terraform/\r\n+.test-data/\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\r\n+\r\n+# swap\r\n+[._]*.s[a-w][a-z]\r\n+[._]s[a-w][a-z]\r\n+# session\r\n+Session.vim\r\n+# temporary\r\n+.netrwhist\r\n+*~\r\n+# auto-generated tag files\r\n+tags\r\n+\r\n+# IDE configs\r\n+.idea\r\n+\r\n+# Ruby download package lock file.\r\n+Gemfile.lock\r\n+\r\n+# Test Kitchen files.\r\n+.kitchen\r\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.0\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -32,6 +32,7 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n # Install required go packages using dep ensure\n ENV packages /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n+RUN go get github.com/katbyte/terrafmt\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,6 +2,6 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', tag: '0.7.0'\n+ gem 'terramodtest', tag: '0.8.0'\n end\n end\n---\nREADME.md\n@@ -227,7 +227,7 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n- os_profile_secrets = [{\n+ os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n certificate_store = \"My\"\n---\nRakefile\n@@ -16,6 +16,12 @@ namespace :static do\n task :format do\n format_tf\n end\n+ task :readme_style do\n+ readme_style_tf\n+ end\n+ task :fixture_style do\n+ fixture_style_tf\n+ end\n end\n \n namespace :integration do\n@@ -35,7 +41,7 @@ end\n \n task :prereqs => []\n \n-task :validate => [ 'static:style', 'static:lint' ]\n+task :validate => [ 'static:style', 'static:lint', 'static:readme_style','static:fixture_style' ]\n \n task :format => [ 'static:format' ]\n \n---\nos/outputs.tf\n@@ -1,15 +1,15 @@\n output \"calculated_value_os_publisher\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)\n }\n \n output \"calculated_value_os_offer\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)}\"\n+ value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)\n }\n \n output \"calculated_remote_port\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22\n }\n---\ntest/fixture/main.tf\n@@ -68,7 +68,7 @@ module \"ubuntuservers\" {\n source_vault_id = azurerm_key_vault.test.id\n certificate_url = azurerm_key_vault_certificate.test.secret_id\n }]\n- \n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\n\n\n---\n\nChoice B:\n.gitignore\n@@ -1,37 +1,37 @@\n-# Variable files\n-terraform.tfvars\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\n-\n-# Compiled files\n-*.tfstate\n-*.tfstate.backup\n-\n-# Go vendor directory\n-vendor/\n-\n-# Module directory\n-.terraform/\n-.test-data/\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\n-\n-# swap\n-[._]*.s[a-w][a-z]\n-[._]s[a-w][a-z]\n-# session\n-Session.vim\n-# temporary\n-.netrwhist\n-*~\n-# auto-generated tag files\n-tags\n-\n-# IDE configs\n-.idea\n-\n-# Ruby download package lock file.\n-Gemfile.lock\n-\n-# Test Kitchen files.\n-.kitchen\n+# Variable files\r\n+terraform.tfvars\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\r\n+\r\n+# Compiled files\r\n+*.tfstate\r\n+*.tfstate.backup\r\n+\r\n+# Go vendor directory\r\n+vendor/\r\n+\r\n+# Module directory\r\n+.terraform/\r\n+.test-data/\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\r\n+\r\n+# swap\r\n+[._]*.s[a-w][a-z]\r\n+[._]s[a-w][a-z]\r\n+# session\r\n+Session.vim\r\n+# temporary\r\n+.netrwhist\r\n+*~\r\n+# auto-generated tag files\r\n+tags\r\n+\r\n+# IDE configs\r\n+.idea\r\n+\r\n+# Ruby download package lock file.\r\n+Gemfile.lock\r\n+\r\n+# Test Kitchen files.\r\n+.kitchen\r\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.0\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -32,6 +32,7 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n # Install required go packages using dep ensure\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n+RUN go get github.com/katbyte/terrafmt\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,6 +2,6 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', tag: '0.7.0'\n+ gem 'terramodtest', tag: '0.8.0'\n end\n end\n---\nREADME.md\n@@ -227,7 +227,7 @@ module \"windowsservers\" {\n group enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n- os_profile_secrets = [{\n+ os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n certificate_store = \"My\"\n---\nRakefile\n@@ -16,6 +16,12 @@ namespace :static do\n task :format do\n format_tf\n end\n+ task :readme_style do\n+ readme_style_tf\n+ end\n+ task :fixture_style do\n+ fixture_style_tf\n+ end\n end\n \n namespace :integration do\n@@ -35,7 +41,7 @@ end\n \n task :prereqs => []\n \n-task :validate => [ 'static:style', 'static:lint' ]\n+task :validate => [ 'static:style', 'static:lint', 'static:readme_style','static:fixture_style' ]\n \n task :format => [ 'static:format' ]\n \n---\nos/outputs.tf\n@@ -1,15 +1,15 @@\n output \"calculated_value_os_publisher\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)\n }\n \n output \"calculated_value_os_offer\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)}\"\n+ value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)\n }\n \n output \"calculated_remote_port\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22\n }\n---\ntest/fixture/main.tf\n@@ -68,7 +68,7 @@ module \"ubuntuservers\" {\n source_vault_id = azurerm_key_vault.test.id\n certificate_url = azurerm_key_vault_certificate.test.secret_id\n }]\n- \n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\n\n\n---\n\nChoice C:\n.gitignore\n@@ -1,37 +1,37 @@\n-# Variable files\n-terraform.tfvars\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\n-\n-# Compiled files\n-*.tfstate\n-*.tfstate.backup\n-\n-# Go vendor directory\n-vendor/\n-\n-# Module directory\n-.terraform/\n-.test-data/\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\n-\n-# swap\n-[._]*.s[a-w][a-z]\n-[._]s[a-w][a-z]\n-# session\n-Session.vim\n-# temporary\n-.netrwhist\n-*~\n-# auto-generated tag files\n-tags\n-\n-# IDE configs\n-.idea\n-\n-# Ruby download package lock file.\n-Gemfile.lock\n-\n-# Test Kitchen files.\n-.kitchen\n+# Variable files\r\n+terraform.tfvars\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\r\n+\r\n+# Compiled files\r\n+*.tfstate\r\n+*.tfstate.backup\r\n+\r\n+# Go vendor directory\r\n+vendor/\r\n+\r\n+# Module directory\r\n+.terraform/\r\n+.test-data/\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\r\n+\r\n+# swap\r\n+[._]*.s[a-w][a-z]\r\n+[._]s[a-w][a-z]\r\n+# session\r\n+Session.vim\r\n+# temporary\r\n+.netrwhist\r\n+*~\r\n+# auto-generated tag files\r\n+tags\r\n+\r\n+# IDE configs\r\n+.idea\r\n+\r\n+# Ruby download package lock file.\r\n+Gemfile.lock\r\n+\r\n+# Test Kitchen files.\r\n+.kitchen\r\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.0\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -32,6 +32,7 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n # Install required go packages using dep ensure\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n+RUN go get github.com/katbyte/terrafmt\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,6 +2,6 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', tag: '0.7.0'\n+ gem 'terramodtest', tag: '0.8.0'\n end\n end\n---\nREADME.md\n@@ -227,7 +227,7 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n- os_profile_secrets = [{\n+ os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n certificate_store = \"My\"\n---\nRakefile\n@@ -16,6 +16,12 @@ namespace :static do\n task :format do\n format_tf\n end\n+ task :readme_style do\n+ readme_style_tf\n+ end\n+ task :fixture_style do\n+ fixture_style_tf\n+ end\n end\n \n namespace :integration do\n@@ -35,7 +41,7 @@ end\n \n task :prereqs => []\n \n-task :validate => [ 'static:style', 'static:lint' ]\n+task :validate => [ 'static:style', 'static:lint', 'static:readme_style','static:fixture_style' ]\n \n task :format => [ 'static:format' ]\n \n---\nos/outputs.tf\n@@ -1,15 +1,15 @@\n output \"calculated_value_os_publisher\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)\n }\n \n output \"calculated_value_os_offer\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)}\"\n+ value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)\n }\n \n output \"calculated_remote_port\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22\n }\n---\ntest/fixture/main.tf\n@@ -68,7 +68,7 @@ module \"ubuntuservers\" {\n source_vault_id = azurerm_key_vault.test.id\n certificate_url = azurerm_key_vault_certificate.test.secret_id\n }]\n- \n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\n\n\n---\n\nChoice D:\n.gitignore\n@@ -1,37 +1,37 @@\n-# Variable files\n-terraform.tfvars\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\n-\n-# Compiled download Go vendor directory\n-vendor/\n-\n-# Module directory\n-.terraform/\n-.test-data/\n-\n-### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\n-\n-# swap\n-[._]*.s[a-w][a-z]\n-[._]s[a-w][a-z]\n-# session\n-Session.vim\n-# temporary\n-.netrwhist\n-*~\n-# auto-generated tag files\n-tags\n-\n-# IDE configs\n-.idea\n-\n-# Ruby download package lock file.\n-Gemfile.lock\n-\n-# Test Kitchen files.\n-.kitchen\n+# Variable files\r\n+terraform.tfvars\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore\r\n+\r\n+# Compiled files\r\n+*.tfstate\r\n+*.tfstate.backup\r\n+\r\n+# Go vendor directory\r\n+vendor/\r\n+\r\n+# Module directory\r\n+.terraform/\r\n+.test-data/\r\n+\r\n+### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Global/Vim.gitignore\r\n+\r\n+# swap\r\n+[._]*.s[a-w][a-z]\r\n+[._]s[a-w][a-z]\r\n+# session\r\n+Session.vim\r\n+# temporary\r\n+.netrwhist\r\n+*~\r\n+# auto-generated tag files\r\n+tags\r\n+\r\n+# IDE configs\r\n+.idea\r\n+\r\n+# Ruby download package lock file.\r\n+Gemfile.lock\r\n+\r\n+# Test Kitchen files.\r\n+.kitchen\r\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.13.0\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.13.5\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -32,6 +32,7 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n # Install required go packages using dep ensure\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n+RUN go get github.com/katbyte/terrafmt\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,6 +2,6 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', tag: '0.7.0'\n+ gem 'terramodtest', tag: '0.8.0'\n end\n end\n---\nREADME.md\n@@ -227,7 +227,7 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n- os_profile_secrets = [{\n+ os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n certificate_store = \"My\"\n---\nRakefile\n@@ -16,6 +16,12 @@ namespace :static do\n task :format do\n format_tf\n end\n+ task :readme_style do\n+ readme_style_tf\n+ end\n+ task :fixture_style do\n+ fixture_style_tf\n+ end\n end\n \n namespace :integration do\n@@ -35,7 +41,7 @@ end\n \n task :prereqs => []\n \n-task :validate => [ 'static:style', 'static:lint' ]\n+task :validate => [ 'static:style', 'static:lint', 'static:readme_style','static:fixture_style' ]\n \n task :format => [ 'static:format' ]\n \n---\nos/outputs.tf\n@@ -1,15 +1,15 @@\n output \"calculated_value_os_publisher\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0)\n }\n \n output \"calculated_value_os_offer\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)}\"\n+ value =element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 1)\n }\n \n output \"calculated_value_os_sku\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 2)\n }\n \n output \"calculated_remote_port\" {\n- value = \"${element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22}\"\n+ value = element(split(\",\", lookup(var.standard_os, var.vm_os_simple, \"\")), 0) == \"MicrosoftWindowsServer\" ? 3389 : 22\n }\n---\ntest/fixture/main.tf\n@@ -68,7 +68,7 @@ module \"ubuntuservers\" {\n source_vault_id = azurerm_key_vault.test.id\n certificate_url = azurerm_key_vault_certificate.test.secret_id\n }]\n- \n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nFix https://github.com/azure/terraform-azurerm-compute/issues/149\r\n\r\n--- PASS: TestTerraformSshExample (491.69s)\r\nPASS\n\n---\n\nChoice A:\nmain.tf\n@@ -198,6 +198,14 @@ resource \"azurerm_public_ip\" \"vm\" {\n tags = var.tags\n }\n \n+// Dynamic public ip address will be got after it's assigned to a vm\n+data \"azurerm_public_ip\" \"vm\" {\n+ count = var.nb_public_ip\n+ name = azurerm_public_ip.vm[count.index].name\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ depends_on = [azurerm_virtual_machine.vm-linux, azurerm_virtual_machine.vm-windows]\n+}\n+\n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-nsg\"\n resource_group_name = data.azurerm_resource_group.vm.name\n---\noutputs.tf\n@@ -30,7 +30,7 @@ output \"public_ip_id\" {\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- value = azurerm_public_ip.vm.*.ip_address\n+ value = data.azurerm_public_ip.vm.*.ip_address\n }\n \n output \"public_ip_dns_name\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -198,6 +198,14 @@ resource \"azurerm_public_ip\" \"vm\" {\n tags = var.tags\n }\n \n+// Dynamic public ip address will be got after it's assigned to a vm\n+data \"azurerm_public_ip\" \"vm\" {\n+ count = var.nb_public_ip\n+ name = azurerm_public_ip.vm[count.index].name\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ depends_on = [azurerm_virtual_machine.vm-linux, azurerm_virtual_machine.vm-windows]\n+}\n+\n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-nsg\"\n resource_group_name = data.azurerm_resource_group.vm.name\n---\noutputs.tf\n@@ -30,7 +30,7 @@ output \"public_ip_id\" {\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- value = azurerm_public_ip.vm.*.ip_address\n+ value = data.azurerm_public_ip.vm.*.ip_address\n }\n \n output \"public_ip_dns_name\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -198,6 +198,14 @@ resource \"azurerm_public_ip\" \"vm\" {\n tags = var.tags\n }\n \n+// Dynamic public ip address will be got after it's assigned to a vm\n+data \"azurerm_public_ip\" \"vm\" {\n+ count = var.nb_public_ip\n+ name = azurerm_public_ip.vm[count.index].name\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ depends_on = [azurerm_virtual_machine.vm-linux, azurerm_virtual_machine.vm-windows]\n+}\n+\n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-nsg\"\n resource_group_name = data.azurerm_resource_group.vm.name\n---\noutputs.tf\n@@ -30,7 +30,7 @@ output \"public_ip_id\" {\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- count value = azurerm_public_ip.vm.*.ip_address\n+ value = data.azurerm_public_ip.vm.*.ip_address\n }\n \n output \"public_ip_dns_name\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -198,6 +198,14 @@ resource \"azurerm_public_ip\" \"vm\" {\n tags = var.tags\n }\n \n+// Dynamic public ip address will be got after it's assigned to a vm\n+data \"azurerm_public_ip\" \"vm\" {\n+ count = var.nb_public_ip\n+ name = azurerm_public_ip.vm[count.index].name\n+ resource_group_name = data.azurerm_resource_group.vm.name\n+ depends_on = [azurerm_virtual_machine.vm-linux, azurerm_virtual_machine.vm-windows]\n+}\n+\n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-nsg\"\n resource_group_name = data.azurerm_resource_group.vm.name\n---\noutputs.tf\n@@ -30,7 +30,7 @@ output \"public_ip_id\" {\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- value = azurerm_public_ip.vm.*.ip_address\n+ value = data.azurerm_public_ip.vm.*.ip_address\n }\n \n output \"public_ip_dns_name\" {\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n* Adding a new parameter 'extra_disks' to add custom size data disks\r\n* updated README.md\r\n* updated main.tf\r\n* updated variables.tf\r\n* tested on TF v0.13.5\r\n\r\nThis new parameter deprecates nb_data_disk and data_disk_size_gb as it permits to add any number of data disks giving a custom size and name for each one. Example extra_disks variable:\r\n```hcl\r\nextra_disks = [\r\n {\r\n size = 200\r\n name = \"logs\"\r\n },\r\n {\r\n size = 1500\r\n name = \"homes\"\r\n }\r\n]\r\n```\n\n---\n\nChoice A:\nREADME.md\n@@ -227,6 +227,18 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+\n+ extra_disks = [\n+ {\n+ size = 50\n+ name = \"logs\"\n+ },\n+ {\n+ size = 200\n+ name = \"backup\"\n+ }\n+ ]\n+\n os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n---\nmain.tf\n@@ -80,6 +80,17 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n@@ -170,6 +181,17 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n---\ntest/fixture/main.tf\n@@ -86,6 +86,16 @@ module \"debianservers\" {\n allocation_method = \"Static\"\n enable_ssh_key = true\n extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+ extra_disks = [\n+ {\n+ size = 5\n+ name = \"extra1\"\n+ },\n+ {\n+ size = 5\n+ name = \"extra2\"\n+ }\n+ ]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -221,6 +221,15 @@ variable \"identity_ids\" {\n default = []\n }\n \n+variable \"extra_disks\" {\n+ description = \"(Optional) List of extra data disks attached to each virtual machine.\"\n+ type = list(object({\n+ name = string\n+ size = number\n+ }))\n+ default = []\n+}\n+\n variable \"os_profile_secrets\" {\n description = \"Specifies a list of certificates to be installed on the VM, each list item is a map with the keys source_vault_id, certificate_url and certificate_store.\"\n type = list(map(string))\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -227,6 +227,18 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+\n+ extra_disks = [\n+ {\n+ size = 50\n+ name = \"logs\"\n+ },\n+ {\n+ size = 200\n+ name = \"backup\"\n+ }\n+ ]\n+\n os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n---\nmain.tf\n@@ -80,6 +80,17 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n@@ -170,6 +181,17 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n---\ntest/fixture/main.tf\n@@ -86,6 +86,16 @@ module \"debianservers\" {\n allocation_method = \"Static\"\n enable_ssh_key = true\n extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+ extra_disks = [\n+ {\n+ size = 5\n+ name = \"extra1\"\n+ },\n+ {\n+ size = 5\n+ name = \"extra2\"\n+ }\n+ ]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -221,6 +221,15 @@ variable \"identity_ids\" {\n default = []\n }\n \n+variable \"extra_disks\" {\n+ description = \"(Optional) List of extra data disks attached to each virtual machine.\"\n+ type = list(object({\n+ name = string\n+ size = number\n+ }))\n+ default = []\n+}\n+\n variable \"os_profile_secrets\" {\n description = \"Specifies a list of certificates to be installed on the VM, each list item is a map with the keys source_vault_id, certificate_url and certificate_store.\"\n type = list(map(string))\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -227,6 +227,18 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+\n+ extra_disks = [\n+ {\n+ size = 50\n+ name = \"logs\"\n+ },\n+ {\n+ size = 200\n+ name = \"backup\"\n+ }\n+ ]\n+\n os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n---\nmain.tf\n@@ -80,6 +80,17 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n@@ -170,6 +181,17 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n---\ntest/fixture/main.tf\n@@ -86,6 +86,16 @@ module \"debianservers\" {\n allocation_method = \"Static\"\n enable_ssh_key = true\n extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+ extra_disks = [\n+ {\n+ size = 5\n+ name = \"extra1\"\n+ },\n+ {\n+ size = 5\n+ name = \"extra2\"\n+ }\n+ ]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -221,6 +221,15 @@ variable \"identity_ids\" {\n default = []\n }\n \n+variable \"extra_disks\" {\n+ description = \"(Optional) List of extra data disks attached to each virtual machine.\"\n+ type = list(object({\n+ name = string\n+ size = number\n+ }))\n+ default = []\n+}\n+\n variable \"os_profile_secrets\" {\n description = \"Specifies a list of certificates to be installed on the VM, each list item is a map with the keys source_vault_id, certificate_url and certificate_store.\"\n type = list(map(string))\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -227,6 +227,18 @@ module \"windowsservers\" {\n enable_accelerated_networking = true\n license_type = \"Windows_Client\"\n identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n+\n+ extra_disks = [\n+ {\n+ size = 50\n+ name = \"logs\"\n+ },\n+ {\n+ size = 200\n+ name = \"backup\"\n+ }\n+ ]\n+\n os_profile_secrets = [{\n source_vault_id = data.azurerm_key_vault.example.id\n certificate_url = data.azurerm_key_vault_certificate.example.secret_id\n---\nmain.tf\n@@ -80,6 +80,17 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n@@ -170,6 +181,17 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n }\n \n+ dynamic storage_data_disk {\n+ for_each = var.extra_disks\n+ content {\n+ name = \"${var.vm_hostname}-extradisk-${count.index}-${storage_data_disk.value.name}\"\n+ create_option = \"Empty\"\n+ lun = storage_data_disk.key + var.nb_data_disk\n+ disk_size_gb = storage_data_disk.value.size\n+ managed_disk_type = var.data_sa_type\n+ }\n+ }\n+\n os_profile {\n computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n---\ntest/fixture/main.tf\n@@ -86,6 +86,16 @@ module \"debianservers\" {\n allocation_method = \"Static\"\n enable_ssh_key = true\n extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+ extra_disks = [\n+ {\n+ size = 5\n+ name = \"extra1\"\n+ },\n+ {\n+ size = 5\n+ name = \"extra2\"\n+ }\n+ ]\n \n depends_on = [azurerm_resource_group.test]\n }\n---\nvariables.tf\n@@ -221,6 +221,15 @@ variable \"identity_ids\" {\n default = []\n }\n \n+variable \"extra_disks\" {\n+ description = \"(Optional) List of extra data disks attached to each virtual machine.\"\n+ type = list(object({\n+ name = string\n+ size = number\n+ }))\n+ default = []\n+}\n+\n variable \"os_profile_secrets\" {\n description = \"Specifies a list of certificates to be installed on the VM, each list item is a map with the keys source_vault_id, certificate_url and certificate_store.\"\n type = list(map(string))\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nsupport defining sku value for public ip via a new variable `public_ip_sku`\n\n---\n\nChoice A:\nREADME.md\n@@ -11,6 +11,7 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - Network Security Group (NSG) created with a single remote access rule which opens `var.remote_port` port or auto calculated port number if using `var.vm_os_simple` to all nics\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Control the number of Public IP addresses assigned to VMs via `var.nb_public_ip`. Create and attach one Public IP per VM up to the number of VMs or create NO public IPs via setting `var.nb_public_ip` to `0`.\n+- Control SKU and Allocation Method of the public IPs via `var.allocation_method` and `var.public_ip_sku`.\n \n > Note: Terraform module registry is incorrect in the number of required parameters since it only deems required based on variables with non-existent values. The actual minimum required variables depends on the configuration and is specified below in the usage.\n \n@@ -136,6 +137,7 @@ More specifically this provisions:\n 2 - Windows Server 2012 R2 VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - Two Public IP addresses (one for each VM)\n+- Public IP Addresses allocation method is Static and SKU is Standard\n - Opens up port 3389 for RDP access using the password as shown\n \n 3 - New features are supported in v3.0.0:\n@@ -191,6 +193,8 @@ module \"windowsservers\" {\n vm_hostname = \"mywinvm\"\n is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n+ allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n remote_port = \"3389\"\n---\nmain.tf\n@@ -193,6 +193,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n allocation_method = var.allocation_method\n+ sku = var.public_ip_sku\n domain_name_label = element(var.public_ip_dns, count.index)\n tags = var.tags\n }\n---\ntest/fixture/main.tf\n@@ -57,6 +57,7 @@ module \"ubuntuservers\" {\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = azurerm_subnet.subnet1.id\n allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n---\nvariables.tf\n@@ -137,6 +137,12 @@ variable \"allocation_method\" {\n default = \"Dynamic\"\n }\n \n+variable \"public_ip_sku\" {\n+ description = \"Defines the SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic.\"\n+ type = string\n+ default = \"Basic\"\n+}\n+\n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n type = number\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -11,6 +11,7 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - Network Security Group (NSG) created with a single remote access rule which opens `var.remote_port` port or auto calculated port number if using `var.vm_os_simple` to all nics\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Control the number of Public IP addresses assigned to VMs via `var.nb_public_ip`. Create and attach one Public IP per VM as to the number of VMs or create NO public IPs via setting `var.nb_public_ip` to `0`.\n+- Control SKU and Allocation Method of the public IPs via `var.allocation_method` and `var.public_ip_sku`.\n \n > Note: Terraform module registry is incorrect in the number of required parameters since it only deems required based on variables with non-existent values. The actual minimum required variables depends on the configuration and is specified below in the usage.\n \n@@ -136,6 +137,7 @@ More specifically this provisions:\n 2 - Windows Server 2012 R2 VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - Two Public IP addresses (one for each VM)\n+- Public IP Addresses allocation method is Static and SKU is Standard\n - Opens up port 3389 for RDP access using the password as shown\n \n 3 - New features are supported in v3.0.0:\n@@ -191,6 +193,8 @@ module \"windowsservers\" {\n vm_hostname = \"mywinvm\"\n is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n+ allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n remote_port = \"3389\"\n---\nmain.tf\n@@ -193,6 +193,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n allocation_method = var.allocation_method\n+ sku = var.public_ip_sku\n domain_name_label = element(var.public_ip_dns, count.index)\n tags = var.tags\n }\n---\ntest/fixture/main.tf\n@@ -57,6 +57,7 @@ module \"ubuntuservers\" {\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = azurerm_subnet.subnet1.id\n allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n---\nvariables.tf\n@@ -137,6 +137,12 @@ variable \"allocation_method\" {\n default = \"Dynamic\"\n }\n \n+variable \"public_ip_sku\" {\n+ description = \"Defines the SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic.\"\n+ type = string\n+ default = \"Basic\"\n+}\n+\n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n type = number\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -11,6 +11,7 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - Network Security Group (NSG) created with a single remote access rule which opens `var.remote_port` port or auto calculated port number if using `var.vm_os_simple` to all nics\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Control the number of Public IP addresses assigned to VMs via `var.nb_public_ip`. Create and attach one Public IP per VM up to the number of VMs or create NO public IPs via setting `var.nb_public_ip` to `0`.\n+- Control SKU and Allocation Method of the public IPs via `var.allocation_method` and `var.public_ip_sku`.\n \n > Note: Terraform module registry is incorrect in the number of required parameters since it only deems required based on variables with non-existent values. The actual minimum required variables depends on the configuration and is specified below in the usage.\n \n@@ -136,6 +137,7 @@ More specifically this provisions:\n 2 - Windows Server 2012 R2 VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - assign Public IP addresses (one for each VM)\n+- Public IP Addresses allocation method is Static and SKU is Standard\n - Opens up port 3389 for RDP access using the password as shown\n \n 3 - New features are supported in v3.0.0:\n@@ -191,6 +193,8 @@ module \"windowsservers\" {\n vm_hostname = \"mywinvm\"\n is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n+ allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n remote_port = \"3389\"\n---\nmain.tf\n@@ -193,6 +193,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n allocation_method = var.allocation_method\n+ sku = var.public_ip_sku\n domain_name_label = element(var.public_ip_dns, count.index)\n tags = var.tags\n }\n---\ntest/fixture/main.tf\n@@ -57,6 +57,7 @@ module \"ubuntuservers\" {\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = azurerm_subnet.subnet1.id\n allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n---\nvariables.tf\n@@ -137,6 +137,12 @@ variable \"allocation_method\" {\n default = \"Dynamic\"\n }\n \n+variable \"public_ip_sku\" {\n+ description = \"Defines the SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic.\"\n+ type = string\n+ default = \"Basic\"\n+}\n+\n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n type = number\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -11,6 +11,7 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - Network Security Group (NSG) created with a single remote access rule which opens `var.remote_port` port or auto calculated port number if using `var.vm_os_simple` to all nics\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Control the number of Public IP addresses assigned to VMs via `var.nb_public_ip`. Create and attach one Public IP per VM up to the number of VMs or create NO public IPs via setting `var.nb_public_ip` to `0`.\n+- Control SKU and Allocation Method of the public IPs via `var.allocation_method` and `var.public_ip_sku`.\n \n > Note: Terraform module registry is incorrect in the number of required parameters since it only deems required based on variables with non-existent values. The actual minimum provisions:\n variables depends on the configuration and is specified below in the usage.\n \n@@ -136,6 +137,7 @@ More specifically this provisions:\n 2 - Windows Server 2012 R2 VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - Two Public IP addresses (one for each VM)\n+- Public IP Addresses allocation method is Static and SKU is Standard\n - Opens up port 3389 for RDP access using the password as shown\n \n 3 - New features are supported in v3.0.0:\n@@ -191,6 +193,8 @@ module \"windowsservers\" {\n vm_hostname = \"mywinvm\"\n is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n+ allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n remote_port = \"3389\"\n---\nmain.tf\n@@ -193,6 +193,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = data.azurerm_resource_group.vm.name\n location = coalesce(var.location, data.azurerm_resource_group.vm.location)\n allocation_method = var.allocation_method\n+ sku = var.public_ip_sku\n domain_name_label = element(var.public_ip_dns, count.index)\n tags = var.tags\n }\n---\ntest/fixture/main.tf\n@@ -57,6 +57,7 @@ module \"ubuntuservers\" {\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = azurerm_subnet.subnet1.id\n allocation_method = \"Static\"\n+ public_ip_sku = \"Standard\"\n enable_accelerated_networking = true\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n---\nvariables.tf\n@@ -137,6 +137,12 @@ variable \"allocation_method\" {\n default = \"Dynamic\"\n }\n \n+variable \"public_ip_sku\" {\n+ description = \"Defines the SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Basic.\"\n+ type = string\n+ default = \"Basic\"\n+}\n+\n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n type = number\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nI needed support for multiple keys, the cleanest way to do that seemed to me to just change the existing var.ssh_keys to a list\r\n\r\nAn alternative implementation that would be backwards compatible would be to introduce a separate variable ssh_keys and merge them in a local. let me know if you prefer that.\n\n---\n\nChoice A:\nREADME.md\n@@ -124,7 +124,7 @@ More specifically this provisions:\n \n 1 - New vnet for all vms\n \n-2 - Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n+2 - Ubuntu 18.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - No public IP assigned, so access can only happen through another machine on the vnet.\n - Opens up port 22 for SSH access with the default ~/.ssh/id_rsa.pub key\n@@ -142,7 +142,11 @@ More specifically this provisions:\n \n - \"nb_data_disk\" Number of the data disks attached to each virtual machine\n \n-- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n+- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine.\n+ through ssh keys are enabled you can either\n+ - use the default \"~/.ssh/id_rsa.pub\"\n+ - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n+ - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n \n ```hcl\n provider \"azurerm\" {\n---\nmain.tf\n@@ -7,6 +7,10 @@ data \"azurerm_resource_group\" \"vm\" {\n name = var.resource_group_name\n }\n \n+locals {\n+ ssh_keys = concat([var.ssh_key], var.extra_ssh_keys)\n+}\n+\n resource \"random_id\" \"vm-sa\" {\n keepers = {\n vm_hostname = var.vm_hostname\n@@ -87,10 +91,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n disable_password_authentication = var.enable_ssh_key\n \n dynamic ssh_keys {\n- for_each = var.enable_ssh_key ? [var.ssh_key] : []\n+ for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n- key_data = file(var.ssh_key)\n+ key_data = file(ssh_keys.value)\n }\n }\n }\n---\ntest/fixture/main.tf\n@@ -80,7 +80,8 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n- \n+ extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\ntest/fixture/monica_id_rsa.pub\n@@ -0,0 +1 @@\n+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU= regina.filange@nana\n---\nvariables.tf\n@@ -26,8 +26,14 @@ variable \"admin_password\" {\n default = \"\"\n }\n \n+variable \"extra_ssh_keys\" {\n+ description = \"Same as ssh_key, but allows for setting multiple public keys. Set your first key in ssh_key, and the extras here.\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n type = string\n default = \"~/.ssh/id_rsa.pub\"\n }\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -124,7 +124,7 @@ More specifically this provisions:\n \n 1 - New vnet for all vms\n \n-2 - Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n+2 - Ubuntu 18.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - No public IP assigned, so access can only happen through another machine on the vnet.\n - Opens up port 22 for SSH access with the default ~/.ssh/id_rsa.pub key\n@@ -142,7 +142,11 @@ More specifically this provisions:\n \n - \"nb_data_disk\" Number of the data disks attached to each virtual machine\n \n-- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n+- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine.\n+ When ssh keys are enabled you can either\n+ - use the default \"~/.ssh/id_rsa.pub\"\n+ - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n+ - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n \n ```hcl\n provider \"azurerm\" {\n---\nmain.tf\n@@ -7,6 +7,10 @@ data \"azurerm_resource_group\" \"vm\" {\n name = var.resource_group_name\n }\n \n+locals {\n+ ssh_keys = concat([var.ssh_key], var.extra_ssh_keys)\n+}\n+\n resource \"random_id\" \"vm-sa\" {\n = keepers = {\n vm_hostname = var.vm_hostname\n@@ -87,10 +91,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n disable_password_authentication = var.enable_ssh_key\n \n dynamic ssh_keys {\n- for_each = var.enable_ssh_key ? [var.ssh_key] : []\n+ for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n- key_data = file(var.ssh_key)\n+ key_data = file(ssh_keys.value)\n }\n }\n }\n---\ntest/fixture/main.tf\n@@ -80,7 +80,8 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n- \n+ extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\ntest/fixture/monica_id_rsa.pub\n@@ -0,0 +1 @@\n+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU= regina.filange@nana\n---\nvariables.tf\n@@ -26,8 +26,14 @@ variable \"admin_password\" {\n default = \"\"\n }\n \n+variable \"extra_ssh_keys\" {\n+ description = \"Same as ssh_key, but allows for setting multiple public keys. Set your first key in ssh_key, and the extras here.\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n type = string\n default = \"~/.ssh/id_rsa.pub\"\n }\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -124,7 +124,7 @@ More specifically this provisions:\n \n 1 - New vnet for all vms\n \n-2 - Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n+2 - Ubuntu 18.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - No public IP assigned, so access can only happen through another machine on the vnet.\n - Opens up port 22 for SSH access with the default ~/.ssh/id_rsa.pub key\n@@ -142,7 +142,11 @@ More specifically this provisions:\n \n - \"nb_data_disk\" Number of the data disks attached to each virtual machine\n \n-- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n+- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine.\n+ When ssh keys are enabled you can either\n+ - use the default \"~/.ssh/id_rsa.pub\"\n+ - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n+ - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n \n ```hcl\n provider \"azurerm\" {\n---\nmain.tf\n@@ -7,6 +7,10 @@ data \"azurerm_resource_group\" \"vm\" {\n name = var.resource_group_name\n }\n \n+locals {\n+ ssh_keys = concat([var.ssh_key], var.extra_ssh_keys)\n+}\n+\n resource \"random_id\" \"vm-sa\" {\n keepers = {\n vm_hostname = var.vm_hostname\n@@ -87,10 +91,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n disable_password_authentication = var.enable_ssh_key\n \n dynamic ssh_keys {\n- for_each = var.enable_ssh_key ? [var.ssh_key] : []\n+ for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n- key_data = file(var.ssh_key)\n+ key_data = file(ssh_keys.value)\n }\n }\n }\n---\ntest/fixture/main.tf\n@@ -80,7 +80,8 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n- \n+ extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\ntest/fixture/monica_id_rsa.pub\n@@ -0,0 +1 @@\n+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU= regina.filange@nana\n---\nvariables.tf\n@@ -26,8 +26,14 @@ variable \"admin_password\" {\n default = \"\"\n }\n \n+variable \"extra_ssh_keys\" {\n+ description = \"Same as ssh_key, but allows for setting multiple public keys. Set your first key in ssh_key, and the extras here.\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n type = string\n default = \"~/.ssh/id_rsa.pub\"\n }\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -124,7 +124,7 @@ More specifically this provisions:\n \n 1 - New vnet for all vms\n \n-2 - Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n+2 - Ubuntu 18.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` which is configured with:\n \n - No public IP assigned, so access can only happen through another machine on the vnet.\n - Opens up port 22 for SSH access with the default ~/.ssh/id_rsa.pub key\n@@ -142,7 +142,11 @@ More specifically this provisions:\n \n - \"nb_data_disk\" Number of the data disks attached to each virtual machine\n \n-- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n+- \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine.\n+ When ssh keys are enabled you can either\n+ - use the default \"~/.ssh/id_rsa.pub\"\n+ - set one key by setting a path in ssh_key variable. e.g \"joey_id_rsa.pub\"\n+ - set shh_key and add zero or more files paths in extra_ssh_keys variable e.g. [\"ross_id_rsa.pub\", \"rachel_id_rsa.pub\"] (since v3.8.0)\n \n ```hcl\n provider \"azurerm\" {\n---\nmain.tf\n@@ -7,6 +7,10 @@ use \"azurerm_resource_group\" \"vm\" {\n name = var.resource_group_name\n }\n \n+locals {\n+ ssh_keys = concat([var.ssh_key], var.extra_ssh_keys)\n+}\n+\n resource \"random_id\" \"vm-sa\" {\n keepers = {\n vm_hostname = var.vm_hostname\n@@ -87,10 +91,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n disable_password_authentication = var.enable_ssh_key\n \n dynamic ssh_keys {\n- for_each = var.enable_ssh_key ? [var.ssh_key] : []\n+ for_each = var.enable_ssh_key ? local.ssh_keys : []\n content {\n path = \"/home/${var.admin_username}/.ssh/authorized_keys\"\n- key_data = file(var.ssh_key)\n+ key_data = file(ssh_keys.value)\n }\n }\n }\n---\ntest/fixture/main.tf\n@@ -80,7 +80,8 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n- \n+ extra_ssh_keys = [\"monica_id_rsa.pub\"]\n+\n depends_on = [azurerm_resource_group.test]\n }\n \n---\ntest/fixture/monica_id_rsa.pub\n@@ -0,0 +1 @@\n+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8GIRF1Snlg9NKCmM74RHXqRGMXyui088+ntQqkQkFIL/BrlgP3CzOgHQmJ+3f0Up/+9UY9vX7AmT7WxVTyqBHT/Aes3VmU3wLO5/MMV/HRrT4z2QV/80futhxjk2unNdWGvbFcR6Y3I44EJFmr8GMbyXRtr0ibuv8BlTYx/K6AXSJ3V+kBqXMOF1QRvVoX9fJKPKjMsebe0cB1IYlm9KLqtciMy+aFOEsSNfrw5cNVsQfK3BgOUKAHsLfBiR7imA2ca+hh005GEtcVJvpvFzcM+bZggUpdqQwIzk1Kv/tROiJiGS0NnyzoxIZYeM3z/mQ5qnglp+174XGCG66EAnVdf5kbaI0Iu7FpAmVhJ92N+MNKoP6vT8cMkYYZf3RaiMMnzjswK/VLbb5ks6Qe9qEPXW1IBtkaaF7+0PCWbPr86I0G2bOa2tFyOHm046Z9sRlkaOO95hmer6Y6MUbMpfeprmjR87u6MVOPglnARfV3UI9i6wOUhVVIi6Wb424HWU= regina.filange@nana\n---\nvariables.tf\n@@ -26,8 +26,14 @@ variable \"admin_password\" {\n default = \"\"\n }\n \n+variable \"extra_ssh_keys\" {\n+ description = \"Same as ssh_key, but allows for setting multiple public keys. Set your first key in ssh_key, and the extras here.\"\n+ type = list(string)\n+ default = []\n+}\n+\n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n type = string\n default = \"~/.ssh/id_rsa.pub\"\n }\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAdds two dynamic blocks created by conditionals dependent upon the identity type supplied.\n\n---\n\nChoice A:\nREADME.md\n@@ -197,6 +197,7 @@ module \"windowsservers\" {\n vm_size = \"Standard_DS2_V2\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n+ identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -35,6 +35,21 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n@@ -98,6 +113,21 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n---\noutputs.tf\n@@ -47,3 +47,8 @@ output \"vm_zones\" {\n description = \"map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in.\"\n value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.zones, azurerm_virtual_machine.vm-linux.*.zones))\n }\n+\n+output \"vm_identity\" {\n+ description = \"map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.\"\n+ value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.identity, azurerm_virtual_machine.vm-linux.*.identity))\n+}\n---\ntest/fixture/main.tf\n@@ -39,6 +39,13 @@ resource \"azurerm_subnet\" \"subnet3\" {\n address_prefixes = [\"10.0.3.0/24\"]\n }\n \n+resource \"azurerm_user_assigned_identity\" \"test\" {\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = azurerm_resource_group.test.location\n+\n+ name = \"host${random_id.ip_dns.hex}-id\"\n+}\n+\n module \"ubuntuservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-u\"\n@@ -54,7 +61,9 @@ module \"ubuntuservers\" {\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n enable_ssh_key = false\n-\n+ identity_type = \"UserAssigned\"\n+ identity_ids = [azurerm_user_assigned_identity.test.id]\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -71,7 +80,7 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n-\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -86,6 +95,7 @@ module \"windowsservers\" {\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips-${random_id.ip_dns.hex}\"] // change to a unique name per datacenter region\n vnet_subnet_id = azurerm_subnet.subnet3.id\n-\n+ identity_type = var.identity_type\n+ \n depends_on = [azurerm_resource_group.test]\n-}\n\\ No newline at end of file\n+}\n---\ntest/fixture/outputs.tf\n@@ -21,3 +21,11 @@ output \"debian_ip_address\" {\n output \"windows_ip_address\" {\n value = module.windowsservers.public_ip_address\n }\n+\n+output \"ubuntu_identity_type\" {\n+ value = module.ubuntuservers.vm_identity\n+}\n+\n+output \"windows_identity_type\" {\n+ value = module.windowsservers.vm_identity\n+}\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n custom_data = \"\"\n+identity_type = \"SystemAssigned\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n variable \"custom_data\" {}\n+variable \"identity_type\" {}\n---\nvariables.tf\n@@ -190,3 +190,15 @@ variable \"source_address_prefixes\" {\n type = list(string)\n default = [\"0.0.0.0/0\"]\n }\n+\n+variable \"identity_type\" {\n+ description = \"The Managed Service Identity Type of this Virtual Machine.\"\n+ type = string\n+ default = \"\"\n+}\n+\n+variable \"identity_ids\" {\n+ description = \"Specifies a list of user managed identity ids to be assigned to the VM.\"\n+ type = list(string)\n+ default = []\n+}\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -197,6 +197,7 @@ module \"windowsservers\" {\n vm_size = \"Standard_DS2_V2\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n+ identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -35,6 +35,21 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n@@ -98,6 +113,21 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n---\noutputs.tf\n@@ -47,3 +47,8 @@ output \"vm_zones\" {\n description = \"map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in.\"\n value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.zones, azurerm_virtual_machine.vm-linux.*.zones))\n }\n+\n+output \"vm_identity\" {\n+ description = \"map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.\"\n+ value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.identity, azurerm_virtual_machine.vm-linux.*.identity))\n+}\n---\ntest/fixture/main.tf\n@@ -39,6 +39,13 @@ resource \"azurerm_subnet\" \"subnet3\" {\n address_prefixes = [\"10.0.3.0/24\"]\n }\n \n+resource \"azurerm_user_assigned_identity\" \"test\" {\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = azurerm_resource_group.test.location\n+\n+ name = \"host${random_id.ip_dns.hex}-id\"\n+}\n+\n module \"ubuntuservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-u\"\n@@ -54,7 +61,9 @@ module \"ubuntuservers\" {\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n enable_ssh_key = false\n-\n+ identity_type = \"UserAssigned\"\n+ identity_ids = [azurerm_user_assigned_identity.test.id]\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -71,7 +80,7 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n-\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -86,6 +95,7 @@ module \"windowsservers\" {\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips-${random_id.ip_dns.hex}\"] // change to a unique name per datacenter region\n vnet_subnet_id = azurerm_subnet.subnet3.id\n-\n+ identity_type = var.identity_type\n+ \n depends_on = [azurerm_resource_group.test]\n-}\n\\ No newline at end of file\n+}\n---\ntest/fixture/outputs.tf\n@@ -21,3 +21,11 @@ output \"debian_ip_address\" {\n output \"windows_ip_address\" {\n value = module.windowsservers.public_ip_address\n }\n+\n+output \"ubuntu_identity_type\" {\n+ value = module.ubuntuservers.vm_identity\n+}\n+\n+output \"windows_identity_type\" {\n+ value = module.windowsservers.vm_identity\n+}\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n custom_data = \"\"\n+identity_type = \"SystemAssigned\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n variable \"custom_data\" {}\n+variable \"identity_type\" {}\n---\nvariables.tf\n@@ -190,3 +190,15 @@ variable \"source_address_prefixes\" {\n type = list(string)\n default = [\"0.0.0.0/0\"]\n }\n+\n+variable \"identity_type\" {\n+ description = \"The Managed Service Identity Type of this Virtual Machine.\"\n+ type = string\n+ default = \"\"\n+}\n+\n+variable \"identity_ids\" {\n+ description = \"Specifies a list of user managed identity ids to be assigned to the VM.\"\n+ type = list(string)\n+ default = []\n+}\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -197,6 +197,7 @@ module \"windowsservers\" {\n vm_size = \"Standard_DS2_V2\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n+ identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -35,6 +35,21 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n@@ -98,6 +113,21 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n---\noutputs.tf\n@@ -47,3 +47,8 @@ output \"vm_zones\" {\n description = \"map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in.\"\n value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.zones, azurerm_virtual_machine.vm-linux.*.zones))\n }\n+\n+output \"vm_identity\" {\n+ description = \"map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.\"\n+ value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.identity, azurerm_virtual_machine.vm-linux.*.identity))\n+}\n---\ntest/fixture/main.tf\n@@ -39,6 +39,13 @@ resource \"azurerm_subnet\" \"subnet3\" {\n address_prefixes = [\"10.0.3.0/24\"]\n }\n \n+resource \"azurerm_user_assigned_identity\" \"test\" {\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = azurerm_resource_group.test.location\n+\n+ name = \"host${random_id.ip_dns.hex}-id\"\n+}\n+\n module \"ubuntuservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-u\"\n@@ -54,7 +61,9 @@ module \"ubuntuservers\" {\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n enable_ssh_key = false\n-\n+ identity_type = \"UserAssigned\"\n+ identity_ids = [azurerm_user_assigned_identity.test.id]\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -71,7 +80,7 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n-\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -86,6 +95,7 @@ module \"windowsservers\" {\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips-${random_id.ip_dns.hex}\"] // change to a unique name per datacenter region\n vnet_subnet_id = azurerm_subnet.subnet3.id\n-\n+ identity_type = var.identity_type\n+ \n depends_on = [azurerm_resource_group.test]\n-}\n\\ No newline at end of file\n+}\n---\ntest/fixture/outputs.tf\n@@ -21,3 +21,11 @@ output \"debian_ip_address\" {\n output \"windows_ip_address\" {\n value = module.windowsservers.public_ip_address\n }\n+\n+output \"ubuntu_identity_type\" {\n+ value = module.ubuntuservers.vm_identity\n+}\n+\n+output \"windows_identity_type\" {\n+ value = module.windowsservers.vm_identity\n+}\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n custom_data = \"\"\n+identity_type = \"SystemAssigned\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n variable \"custom_data\" {}\n+variable \"identity_type\" {}\n---\nvariables.tf\n@@ -190,3 +190,15 @@ variable \"source_address_prefixes\" {\n type = list(string)\n default = [\"0.0.0.0/0\"]\n }\n+\n+variable \"identity_type\" {\n+ description = \"The Managed Service Identity Type of this Virtual Machine.\"\n+ type = string\n+ default = \"\"\n+}\n+\n+variable \"identity_ids\" {\n+ description = \"Specifies a list of user managed identity ids to be assigned to the VM.\"\n+ type = list(string)\n+ default = []\n+}\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -197,6 +197,7 @@ module \"windowsservers\" {\n vm_size = \"Standard_DS2_V2\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n+ identity_type = \"SystemAssigned\" // can be empty, SystemAssigned or UserAssigned\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -35,6 +35,21 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n@@ -98,6 +113,21 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n network_interface_ids = [element(azurerm_network_interface.vm.*.id, count.index)]\n delete_os_disk_on_termination = var.delete_os_disk_on_termination\n \n+ dynamic identity {\n+ for_each = length(var.identity_ids) == 0 && var.identity_type == \"SystemAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ }\n+ }\n+\n+ dynamic identity {\n+ for_each = length(var.identity_ids) > 0 || var.identity_type == \"UserAssigned\" ? [var.identity_type] : []\n+ content {\n+ type = var.identity_type\n+ identity_ids = length(var.identity_ids) > 0 ? var.identity_ids : []\n+ }\n+ }\n+\n storage_image_reference {\n id = var.vm_os_id\n publisher = var.vm_os_id == \"\" ? coalesce(var.vm_os_publisher, module.os.calculated_value_os_publisher) : \"\"\n---\noutputs.tf\n@@ -47,3 +47,8 @@ output \"vm_zones\" {\n description = \"map with key `Virtual Machine Id`, value `list of the Availability Zone` which the Virtual Machine should be allocated in.\"\n value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.zones, azurerm_virtual_machine.vm-linux.*.zones))\n }\n+\n+output \"vm_identity\" {\n+ description = \"map with key `Virtual Machine Id`, value `list of identity` created for the Virtual Machine.\"\n+ value = zipmap(concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id), concat(azurerm_virtual_machine.vm-windows.*.identity, azurerm_virtual_machine.vm-linux.*.identity))\n+}\n---\ntest/fixture/main.tf\n@@ -39,6 +39,13 @@ resource \"azurerm_subnet\" \"subnet3\" {\n address_prefixes = [\"10.0.3.0/24\"]\n }\n \n+resource \"azurerm_user_assigned_identity\" \"test\" {\n+ resource_group_name = azurerm_resource_group.test.name\n+ location = azurerm_resource_group.test.location\n+\n+ name = \"host${random_id.ip_dns.hex}-id\"\n+}\n+\n module \"ubuntuservers\" {\n source = \"../../\"\n vm_hostname = \"${random_id.ip_dns.hex}-u\"\n@@ -54,7 +61,9 @@ module \"ubuntuservers\" {\n vm_size = \"Standard_DS2_V2\"\n nb_data_disk = 2\n enable_ssh_key = false\n-\n+ identity_type = \"UserAssigned\"\n+ identity_ids = [azurerm_user_assigned_identity.test.id]\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -71,7 +80,7 @@ module \"debianservers\" {\n vnet_subnet_id = azurerm_subnet.subnet2.id\n allocation_method = \"Static\"\n enable_ssh_key = true\n-\n+ \n depends_on = [azurerm_resource_group.test]\n }\n \n@@ -86,6 +95,7 @@ module \"windowsservers\" {\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips-${random_id.ip_dns.hex}\"] // change to a unique name per datacenter region\n Id`, vnet_subnet_id = azurerm_subnet.subnet3.id\n-\n+ identity_type = var.identity_type\n+ \n depends_on = [azurerm_resource_group.test]\n-}\n\\ No newline at end of file\n+}\n---\ntest/fixture/outputs.tf\n@@ -21,3 +21,11 @@ output \"debian_ip_address\" {\n output \"windows_ip_address\" {\n value = module.windowsservers.public_ip_address\n }\n+\n+output \"ubuntu_identity_type\" {\n+ value = module.ubuntuservers.vm_identity\n+}\n+\n+output \"windows_identity_type\" {\n+ value = module.windowsservers.vm_identity\n+}\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n custom_data = \"\"\n+identity_type = \"SystemAssigned\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n variable \"custom_data\" {}\n+variable \"identity_type\" {}\n---\nvariables.tf\n@@ -190,3 +190,15 @@ variable \"source_address_prefixes\" {\n type = list(string)\n default = [\"0.0.0.0/0\"]\n }\n+\n+variable \"identity_type\" {\n+ description = \"The Managed Service Identity Type of this Virtual Machine.\"\n+ type = string\n+ default = \"\"\n+}\n+\n+variable \"identity_ids\" {\n+ description = \"Specifies a list of user managed identity ids to be assigned to the VM.\"\n+ type = list(string)\n+ default = []\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nFix issues in comments in https://github.com/Azure/terraform-azurerm-compute/pull/137\n\n---\n\nChoice A:\nvariables.tf\n@@ -162,5 +162,5 @@ variable \"nb_data_disk\" {\n \n @@ \"source_address_prefixes\" {\n description = \"(Optional) List of source address prefixes allowed to access var.remote_port.\"\n- default = [\"*\"]\n+ default = [\"0.0.0.0/0\"]\n }\n---\n\n\n---\n\nChoice B:\nvariables.tf\n@@ -162,5 +162,5 @@ variable \"nb_data_disk\" {\n \n variable \"source_address_prefixes\" {\n description = \"(Optional) List of source address prefixes allowed to access var.remote_port.\"\n- default +162,5 = [\"*\"]\n+ default = [\"0.0.0.0/0\"]\n }\n---\n\n\n---\n\nChoice C:\nvariables.tf\n@@ -162,5 +162,5 @@ variable \"nb_data_disk\" {\n \n variable \"source_address_prefixes\" {\n description = \"(Optional) List of source address prefixes allowed to access var.remote_port.\"\n- default = [\"*\"]\n+ default = [\"0.0.0.0/0\"]\n }\n---\n\n\n---\n\nChoice D:\nvariables.tf\n@@ -162,5 +162,5 @@ variable \"nb_data_disk\" {\n \n variable \"source_address_prefixes\" {\n description = \"(Optional) List of source address prefixes allowed \"source_address_prefixes\" access var.remote_port.\"\n- default = [\"*\"]\n+ default = [\"0.0.0.0/0\"]\n }\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nI would want some control on nsg security rule for remote_port:\r\n\r\n- Create it only if remote_port is specified\r\n\r\n- Add ability to control source IP ranges\n\n---\n\nChoice A:\nmain.tf\n@@ -171,16 +171,17 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_security_rule\" \"vm\" {\n+ count = var.remote_port != \"\" ? 1 : 0\n name = \"allow_remote_${coalesce(var.remote_port, module.os.calculated_remote_port)}_in_all\"\n resource_group_name = data.azurerm_resource_group.vm.name\n description = \"Allow remote protocol in from all locations\"\n- priority = 100\n+ priority = 101\n direction = \"Inbound\"\n access = \"Allow\"\n protocol = \"Tcp\"\n source_port_range = \"*\"\n destination_port_range = coalesce(var.remote_port, module.os.calculated_remote_port)\n- source_address_prefix = \"*\"\n+ source_address_prefixes = var.source_address_prefixes\n destination_address_prefix = \"*\"\n network_security_group_name = azurerm_network_security_group.vm.name\n }\n@@ -206,4 +207,4 @@ resource \"azurerm_network_interface_security_group_association\" \"test\" {\n count = var.nb_instances\n network_interface_id = azurerm_network_interface.vm[count.index].id\n network_security_group_id = azurerm_network_security_group.vm.id\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -159,3 +159,8 @@ variable \"nb_data_disk\" {\n description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n+\n+variable \"source_address_prefixes\" {\n+ description = \"(Optional) List of source address prefixes allowed to access var.remote_port.\"\n+ default = [\"*\"]\n+}\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -171,16 +171,17 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_security_rule\" \"vm\" {\n+ count = var.remote_port != \"\" ? 1 : 0\n name = \"allow_remote_${coalesce(var.remote_port, module.os.calculated_remote_port)}_in_all\"\n resource_group_name = data.azurerm_resource_group.vm.name\n description = \"Allow remote protocol in from all locations\"\n- priority = 100\n+ priority = 101\n direction = \"Inbound\"\n access = \"Allow\"\n protocol = \"Tcp\"\n source_port_range = \"*\"\n destination_port_range = coalesce(var.remote_port, module.os.calculated_remote_port)\n- source_address_prefix = \"*\"\n+ source_address_prefixes = var.source_address_prefixes\n destination_address_prefix = \"*\"\n network_security_group_name = azurerm_network_security_group.vm.name\n }\n@@ -206,4 +207,4 @@ resource \"azurerm_network_interface_security_group_association\" \"test\" {\n count = var.nb_instances\n network_interface_id = azurerm_network_interface.vm[count.index].id\n network_security_group_id = azurerm_network_security_group.vm.id\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -159,3 +159,8 @@ variable \"nb_data_disk\" {\n description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n+\n+variable \"source_address_prefixes\" {\n+ description = \"(Optional) List of source address prefixes allowed to access var.remote_port.\"\n+ default = [\"*\"]\n+}\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -171,16 +171,17 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_security_rule\" \"vm\" {\n+ }\n = var.remote_port != \"\" ? 1 : 0\n name = \"allow_remote_${coalesce(var.remote_port, module.os.calculated_remote_port)}_in_all\"\n resource_group_name = data.azurerm_resource_group.vm.name\n description = \"Allow remote protocol in from all locations\"\n- priority = 100\n+ priority = 101\n direction = \"Inbound\"\n access = \"Allow\"\n protocol = \"Tcp\"\n source_port_range = \"*\"\n destination_port_range = coalesce(var.remote_port, module.os.calculated_remote_port)\n- source_address_prefix = \"*\"\n+ source_address_prefixes = var.source_address_prefixes\n destination_address_prefix = \"*\"\n network_security_group_name = azurerm_network_security_group.vm.name\n }\n@@ -206,4 +207,4 @@ resource \"azurerm_network_interface_security_group_association\" \"test\" {\n count = var.nb_instances\n network_interface_id = azurerm_network_interface.vm[count.index].id\n network_security_group_id = azurerm_network_security_group.vm.id\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -159,3 +159,8 @@ variable \"nb_data_disk\" {\n description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n+\n+variable \"source_address_prefixes\" {\n+ description = \"(Optional) List of source address prefixes allowed to access var.remote_port.\"\n+ default = [\"*\"]\n+}\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -171,16 +171,17 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_security_rule\" \"vm\" {\n+ count = var.remote_port != \"\" ? 1 : 0\n name = \"allow_remote_${coalesce(var.remote_port, module.os.calculated_remote_port)}_in_all\"\n resource_group_name = data.azurerm_resource_group.vm.name\n description = \"Allow remote protocol in from all locations\"\n- priority = 100\n+ priority = 101\n direction = \"Inbound\"\n access = \"Allow\"\n protocol = \"Tcp\"\n source_port_range = \"*\"\n destination_port_range = coalesce(var.remote_port, module.os.calculated_remote_port)\n- source_address_prefix = \"*\"\n+ source_address_prefixes = var.source_address_prefixes\n destination_address_prefix = \"*\"\n network_security_group_name = azurerm_network_security_group.vm.name\n }\n@@ -206,4 +207,4 @@ resource \"azurerm_network_interface_security_group_association\" \"test\" {\n count = var.nb_instances\n network_interface_id = azurerm_network_interface.vm[count.index].id\n network_security_group_id = azurerm_network_security_group.vm.id\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -159,3 +159,8 @@ variable \"nb_data_disk\" {\n description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n+\n+variable \"source_address_prefixes\" {\n+ description = \"(Optional) List of source address prefixes allowed to access var.remote_port.\"\n+ default = [\"*\"]\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nset public_ip_dns default variable to null\n\n---\n\nChoice A:\nvariables.tf\n@@ -8,7 +8,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar required This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n+ default = [null]\n }\n \n variable \"admin_password\" {\n---\n\n\n---\n\nChoice B:\nvariables.tf\n@@ -8,7 +8,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n+ default = [null]\n }\n \n variable \"admin_password\" {\n---\n\n\n---\n\nChoice C:\nvariables.tf\n@@ -8,7 +8,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n+ default = [null]\n }\n \n variable \"admin_password\" {\n---\n\n\n---\n\nChoice D:\nvariables.tf\n@@ -8,7 +8,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n+ default = [null]\n }\n datacenter variable \"admin_password\" {\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nI have shortened the hostname in fixture test to fix the CI\n\n---\n\nChoice A:\nREADME.md\n@@ -21,6 +21,10 @@ This contains the bare minimum options to be configured for the VM to be provisi\n Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM using `vm_os_simple` to a new VNet and opens up ports 22 for SSH and 3389 for RDP access via the attached public IP to each VM. All resources are provisioned into the default resource group called `terraform-compute`. The Ubuntu Server will use the ssh key found in the default location `~/.ssh/id_rsa.pub`.\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -42,7 +46,7 @@ module \"windowsservers\" {\n admin_password = \"ComplxP@ssw0rd!\"\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n }\n \n module \"network\" {\n@@ -51,7 +55,7 @@ module \"network\" {\n resource_group_name = azurerm_resource_group.example.name\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,7 +71,7 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source per = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -21,6 +21,10 @@ This contains the bare minimum options to be configured for the VM to be provisi\n Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM using `vm_os_simple` to a new VNet and opens up ports 22 for SSH and 3389 for RDP access via the attached public IP to each VM. All resources are provisioned into the default resource group called `terraform-compute`. The Ubuntu Server will use the ssh key found in the default location `~/.ssh/id_rsa.pub`.\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -42,7 +46,7 @@ module \"windowsservers\" {\n admin_password = \"ComplxP@ssw0rd!\"\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n }\n \n module \"network\" {\n@@ -51,7 +55,7 @@ module \"network\" {\n resource_group_name = azurerm_resource_group.example.name\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,7 +71,7 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -21,6 +21,10 @@ This contains the bare minimum options to be configured for the VM to be provisi\n Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM using `vm_os_simple` to a new VNet and opens up ports 22 for SSH and 3389 for RDP access via the attached public IP to each VM. All resources are provisioned into the default resource group called `terraform-compute`. The Ubuntu Server will use the ssh key found in the default location `~/.ssh/id_rsa.pub`.\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -42,7 +46,7 @@ module \"windowsservers\" {\n admin_password = \"ComplxP@ssw0rd!\"\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n }\n \n module \"network\" {\n@@ -51,7 +55,7 @@ module \"network\" {\n resource_group_name = azurerm_resource_group.example.name\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source resource = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,7 +71,7 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -21,6 +21,10 @@ This contains the bare minimum options to be configured for the VM to be provisi\n Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM using `vm_os_simple` to a new VNet and opens up ports 22 for SSH and 3389 for RDP access via the attached public IP to each VM. All resources are provisioned into the default resource group called `terraform-compute`. The Ubuntu Server will use the ssh key found in the default location `~/.ssh/id_rsa.pub`.\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -42,7 +46,7 @@ module \"windowsservers\" {\n admin_password = \"ComplxP@ssw0rd!\"\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n }\n \n module \"network\" {\n@@ -51,7 +55,7 @@ module \"network\" {\n resource_group_name = azurerm_resource_group.example.name\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,7 +71,7 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nCI test has failed for the computer_name is too long, which is created from \"${var.hostname}-${count.index}\". Here I shorten the hostname in fixture test. \n\n---\n\nChoice A:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,12 +71,12 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n admin_password = var.admin_password\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = azurerm_subnet.subnet3.id\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n\nChoice B:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,12 +71,12 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n admin_password = var.admin_password\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = azurerm_subnet.subnet3.id\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n\nChoice C:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher module = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,12 +71,12 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n admin_password = var.admin_password\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = azurerm_subnet.subnet3.id\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n\nChoice D:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\ntest/fixture/main.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n resource \"random_id\" \"ip_dns\" {\n- byte_length = 8\n+ byte_length = 4\n }\n \n resource \"azurerm_resource_group\" \"test\" {\n@@ -41,7 +41,7 @@ resource \"azurerm_subnet\" \"subnet3\" {\n \n module \"ubuntuservers\" {\n source name = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-ubuntu\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-u\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -57,7 +57,7 @@ module \"ubuntuservers\" {\n \n module \"debianservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-debian\"\n+ vm_hostname = \"${random_id.ip_dns.hex}-d\"\n resource_group_name = azurerm_resource_group.test.name\n admin_username = var.admin_username\n admin_password = var.admin_password\n@@ -71,12 +71,12 @@ module \"debianservers\" {\n \n module \"windowsservers\" {\n source = \"../../\"\n- vm_hostname = \"host${random_id.ip_dns.hex}-windows\" // line can be removed if only one VM module per resource group\n+ vm_hostname = \"${random_id.ip_dns.hex}-w\" // line can be removed if only one VM module per resource group\n resource_group_name = azurerm_resource_group.test.name\n is_windows_image = true\n admin_username = var.admin_username\n admin_password = var.admin_password\n vm_os_simple = \"WindowsServer\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = azurerm_subnet.subnet3.id\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nIntegration of terramodtest 0.5.0\r\nFix example in README\n\n---\n\nChoice A:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\n\n\n---\n\nChoice B:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\n\n\n---\n\nChoice C:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\n\n\n---\n\nChoice D:\n.travis.yml\n@@ -13,7 +13,7 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.12.10 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.12.20 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n---\nDockerfile\n@@ -1,5 +1,5 @@\n # Pull the base image with given version.\n-ARG BUILD_TERRAFORM_VERSION=\"0.12.10\"\n+ARG BUILD_TERRAFORM_VERSION=\"0.12.20\"\n FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION}\n \n ARG MODULE_NAME=\"terraform-azurerm-compute\"\n@@ -33,6 +33,5 @@ RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n ENV GOPATH /go\n ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH\n RUN /bin/bash -c \"curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh\"\n-RUN terraform init\n \n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -1,9 +1,7 @@\n-ruby \"~> 2.3.0\"\n-\n source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.3.0'\n+ gem 'terramodtest', tag: '0.5.0'\n end\n end\n---\nREADME.md\n@@ -93,6 +93,10 @@ More specifically this provisions:\n - \"enable_ssh_key\" Enable ssh key authentication in Linux virtual Machine\n \n ```hcl\n+provider \"azurerm\" {\n+ features {}\n+}\n+\n resource \"azurerm_resource_group\" \"example\" {\n name = \"example-resources\"\n location = \"West Europe\"\n@@ -107,14 +111,15 @@ module \"linuxservers\" {\n nb_instances = 2\n vm_os_publisher = \"Canonical\"\n vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n+ vm_os_sku = \"18.04-LTS\"\n vnet_subnet_id = module.network.vnet_subnets[0]\n boot_diagnostics = true\n delete_os_disk_on_termination = true\n nb_data_disk = 2\n data_disk_size_gb = 64\n data_sa_type = \"Premium_LRS\"\n enable_ssh_key = true\n+ vm_size = \"Standard_D4s_v3\"\n \n tags = {\n environment = \"dev\"\n@@ -128,6 +133,7 @@ module \"windowsservers\" {\n source = \"Azure/compute/azurerm\"\n resource_group_name = azurerm_resource_group.example.name\n vm_hostname = \"mywinvm\"\n+ is_windows_image = true\n admin_password = \"ComplxP@ssw0rd!\"\n public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n nb_public_ip = 2\n@@ -137,17 +143,15 @@ module \"windowsservers\" {\n vm_os_offer = \"WindowsServer\"\n vm_os_sku = \"2012-R2-Datacenter\"\n vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = module.network.vnet_subnets[1]\n+ vnet_subnet_id = module.network.vnet_subnets[0]\n enable_accelerated_networking = true\n }\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n- version = \"3.0.0\"\n+ version = \"3.0.1\"\n resource_group_name = azurerm_resource_group.example.name\n- allow_rdp_traffic = true\n- allow_ssh_traffic = true\n- subnet_prefixes = [\"10.0.1.0/24\", \"10.0.2.0/24\"]\n+ subnet_prefixes = [\"10.0.1.0/24\"]\n \n }\n \n---\nmain.tf\n@@ -62,7 +62,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n os_profile {\n- computer_name = \"myLinux\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n custom_data = var.custom_data\n@@ -125,7 +125,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n os_profile {\n- computer_name = \"myWindows\"\n+ computer_name = \"${var.vm_hostname}-${count.index}\"\n admin_username = var.admin_username\n admin_password = var.admin_password\n }\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nIt's a dirty job, but somebody has to do it.\n\n---\n\nChoice A:\nvariables.tf\n@@ -1,9 +1,9 @@\n variable \"resource_group_name\" {\n- description = \"The name of the resource group in which the resources will be created\"\n+ description = \"The name of the resource group in which the resources will be created.\"\n }\n \n variable \"location\" {\n- description = \"(Optional) The location in which the resources will be created\"\n+ description = \"(Optional) The location in which the resources will be created.\"\n default = \"\"\n }\n \n@@ -17,12 +17,12 @@ variable \"public_ip_dns\" {\n }\n \n variable \"admin_password\" {\n- description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure\"\n+ description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure.\"\n default = \"\"\n }\n \n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n@@ -32,7 +32,7 @@ variable \"remote_port\" {\n }\n \n variable \"admin_username\" {\n- description = \"The admin username of the VM that will be deployed\"\n+ description = \"The admin username of the VM that will be deployed.\"\n default = \"azureuser\"\n }\n \n@@ -52,12 +52,12 @@ variable \"vm_size\" {\n }\n \n variable \"nb_instances\" {\n- description = \"Specify the number of vm instances\"\n+ description = \"Specify the number of vm instances.\"\n default = \"1\"\n }\n \n variable \"vm_hostname\" {\n- description = \"local name of the VM\"\n+ description = \"local name of the Virtual Machine.\"\n default = \"myvm\"\n }\n \n@@ -118,44 +118,44 @@ variable \"nb_public_ip\" {\n \n variable \"delete_os_disk_on_termination\" {\n type = bool\n- description = \"Delete datadisk when machine is terminated\"\n+ description = \"Delete datadisk when machine is terminated.\"\n default = false\n }\n \n variable \"data_sa_type\" {\n- description = \"Data Disk Storage Account type\"\n+ description = \"Data Disk Storage Account type.\"\n default = \"Standard_LRS\"\n }\n \n variable \"data_disk_size_gb\" {\n- description = \"Storage data disk size size\"\n+ description = \"Storage data disk size size.\"\n default = 30\n }\n \n variable \"boot_diagnostics\" {\n type = bool\n- description = \"(Optional) Enable or Disable boot diagnostics\"\n+ description = \"(Optional) Enable or Disable boot diagnostics.\"\n default name = false\n }\n \n variable \"boot_diagnostics_sa_type\" {\n- description = \"(Optional) Storage account type for boot diagnostics\"\n+ description = \"(Optional) Storage account type for boot diagnostics.\"\n default = \"Standard_LRS\"\n }\n \n variable \"enable_accelerated_networking\" {\n type = bool\n- description = \"(Optional) Enable accelerated networking on Network interface\"\n+ description = \"(Optional) Enable accelerated networking on Network interface.\"\n default = false\n }\n \n variable \"enable_ssh_key\" {\n type = bool\n- description = \"(Optional) Enable ssh key authentication in Linux virtual Machine\"\n+ description = \"(Optional) Enable ssh key authentication in Linux virtual Machine.\"\n default = true\n }\n \n variable \"nb_data_disk\" {\n- description = \"(Optional) Number of the data disks attached to each virtual machine\"\n+ description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n---\n\n\n---\n\nChoice B:\nvariables.tf\n@@ -1,9 +1,9 @@\n variable \"resource_group_name\" {\n- description = \"The name of the resource group in which the resources will be created\"\n+ description = \"The name of the resource group in which the resources will be created.\"\n }\n \n variable \"location\" {\n- description = \"(Optional) The location in which the resources will be created\"\n+ description = \"(Optional) The location in which the resources will be created.\"\n default = \"\"\n }\n \n@@ -17,12 +17,12 @@ variable \"public_ip_dns\" {\n }\n \n variable \"admin_password\" {\n- description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure\"\n+ description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure.\"\n default = \"\"\n }\n \n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n@@ -32,7 +32,7 @@ variable \"remote_port\" {\n }\n \n variable \"admin_username\" {\n- description = \"The admin username of the VM that will be deployed\"\n+ description = \"The admin username of the VM that will be deployed.\"\n default = \"azureuser\"\n }\n \n@@ -52,12 +52,12 @@ variable \"vm_size\" {\n }\n \n variable \"nb_instances\" {\n- description = \"Specify the number of vm instances\"\n+ description = \"Specify the number of vm instances.\"\n default = \"1\"\n }\n \n variable \"vm_hostname\" {\n- description = \"local name of the VM\"\n+ description = \"local name of the Virtual Machine.\"\n default = \"myvm\"\n }\n \n@@ -118,44 +118,44 @@ variable \"nb_public_ip\" {\n \n variable \"delete_os_disk_on_termination\" {\n type = bool\n- description = \"Delete datadisk when machine is terminated\"\n+ description = \"Delete datadisk when machine is terminated.\"\n default = false\n }\n \n variable \"data_sa_type\" {\n- description = \"Data Disk Storage Account type\"\n+ description = \"Data Disk Storage Account type.\"\n default = \"Standard_LRS\"\n }\n \n variable \"data_disk_size_gb\" {\n- description = \"Storage data disk size size\"\n+ description = \"Storage data disk size size.\"\n default = 30\n }\n \n variable \"boot_diagnostics\" {\n type = bool\n- description = \"(Optional) Enable or Disable boot diagnostics\"\n+ description = \"(Optional) Enable or Disable boot diagnostics.\"\n default = false\n }\n \n variable \"boot_diagnostics_sa_type\" {\n- description = \"(Optional) Storage account type for boot diagnostics\"\n+ description = \"(Optional) Storage account type for boot diagnostics.\"\n default = \"Standard_LRS\"\n }\n \n variable \"enable_accelerated_networking\" {\n type = bool\n- description = \"(Optional) Enable accelerated networking on Network interface\"\n+ description = \"(Optional) Enable accelerated networking on Network interface.\"\n default = false\n }\n \n variable \"enable_ssh_key\" {\n type = bool\n- description = \"(Optional) Enable ssh key authentication in Linux virtual Machine\"\n+ description = \"(Optional) Enable ssh key authentication in Linux virtual Machine.\"\n default = true\n }\n \n variable \"nb_data_disk\" {\n- description = \"(Optional) Number of the data disks attached to each virtual machine\"\n+ description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n---\n\n\n---\n\nChoice C:\nvariables.tf\n@@ -1,9 +1,9 @@\n variable \"resource_group_name\" {\n- description = \"The name of the resource group in which the resources will be created\"\n+ description = \"The name of the resource group in which the resources will be created.\"\n }\n \n variable \"location\" {\n- description = \"(Optional) The location in which the resources will be created\"\n+ description = \"(Optional) The location in which the resources will be created.\"\n default = \"\"\n }\n \n@@ -17,12 +17,12 @@ variable \"public_ip_dns\" {\n }\n \n variable \"admin_password\" {\n- description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure\"\n+ description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure.\"\n default = \"\"\n }\n \n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n@@ -32,7 +32,7 @@ variable \"remote_port\" {\n }\n \n variable \"admin_username\" {\n- description = \"The admin username of the VM that will be deployed\"\n+ description = \"The admin username of the VM that will be deployed.\"\n default = \"azureuser\"\n }\n \n@@ -52,12 +52,12 @@ variable \"vm_size\" {\n }\n \n variable \"nb_instances\" {\n- description = \"Specify the number of vm instances\"\n+ description = \"Specify the number of vm instances.\"\n default = \"1\"\n }\n \n variable \"vm_hostname\" {\n- description = \"local name of the VM\"\n+ description = \"local name of the Virtual Machine.\"\n default = \"myvm\"\n }\n \n@@ -118,44 +118,44 @@ variable \"nb_public_ip\" {\n \n variable \"delete_os_disk_on_termination\" {\n type = bool\n- description = \"Delete datadisk when machine is terminated\"\n+ description = \"Delete datadisk when machine is terminated.\"\n default = false\n }\n \n variable \"data_sa_type\" {\n- description = \"Data Disk Storage Account type\"\n+ description = \"Data Disk Storage Account type.\"\n default = \"Standard_LRS\"\n }\n \n variable \"data_disk_size_gb\" {\n- description = \"Storage data disk size size\"\n+ description = \"Storage data disk size size.\"\n default = 30\n }\n \n variable \"boot_diagnostics\" {\n type = bool\n- description = \"(Optional) Enable or Disable boot diagnostics\"\n+ description = \"(Optional) Enable or Disable boot diagnostics.\"\n default = false\n }\n \n variable \"boot_diagnostics_sa_type\" {\n- description = \"(Optional) Storage account type for boot diagnostics\"\n+ description = \"(Optional) Storage account type for boot diagnostics.\"\n default = \"Standard_LRS\"\n }\n \n variable \"enable_accelerated_networking\" {\n type = bool\n- description = \"(Optional) Enable accelerated networking on Network interface\"\n+ description = \"(Optional) Enable accelerated networking on Network interface.\"\n default false\n }\n \n variable \"enable_ssh_key\" {\n type = bool\n- description = \"(Optional) Enable ssh key authentication in Linux virtual Machine\"\n+ description = \"(Optional) Enable ssh key authentication in Linux virtual Machine.\"\n default = true\n }\n \n variable \"nb_data_disk\" {\n- description = \"(Optional) Number of the data disks attached to each virtual machine\"\n+ description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n---\n\n\n---\n\nChoice D:\nvariables.tf\n@@ -1,9 +1,9 @@\n variable \"resource_group_name\" {\n- description = \"The name of the resource group in which the resources will be created\"\n+ description = \"The name of the resource group in which the resources will be created.\"\n }\n \n variable \"location\" {\n- description = \"(Optional) The location in which the resources will be created\"\n+ description = \"(Optional) The location in which the resources will be created.\"\n default = \"\"\n }\n \n@@ -17,12 +17,12 @@ variable \"public_ip_dns\" {\n }\n \n variable \"admin_password\" {\n- description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure\"\n+ description = \"The admin password to be used on the VMSS that will be deployed. The password must meet the complexity requirements of Azure.\"\n default = \"\"\n }\n \n variable \"ssh_key\" {\n- description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub\"\n+ description = \"Path to the public key to be used for ssh access to the VM. Only used with non-Windows vms and can be left as-is even if using Windows vms. If specifying a path to a certification on a Windows machine to provision a linux vm use the / in the path versus backslash. e.g. c:/home/id_rsa.pub.\"\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n@@ -32,7 +32,7 @@ variable \"remote_port\" {\n }\n \n variable \"admin_username\" as-is description = \"The admin username of the VM that will be deployed\"\n+ description = \"The admin username of the VM that will be deployed.\"\n default = \"azureuser\"\n }\n \n@@ -52,12 +52,12 @@ variable \"vm_size\" {\n }\n \n variable \"nb_instances\" {\n- description = \"Specify the number of vm instances\"\n+ description = \"Specify the number of vm instances.\"\n default = \"1\"\n }\n \n variable \"vm_hostname\" {\n- description = \"local name of the VM\"\n+ description = \"local name of the Virtual Machine.\"\n default = \"myvm\"\n }\n \n@@ -118,44 +118,44 @@ variable \"nb_public_ip\" {\n \n variable \"delete_os_disk_on_termination\" {\n type = bool\n- description = \"Delete datadisk when machine is terminated\"\n+ description = \"Delete datadisk when machine is terminated.\"\n default = false\n }\n \n variable \"data_sa_type\" {\n- description = \"Data Disk Storage Account type\"\n+ description = \"Data Disk Storage Account type.\"\n default = \"Standard_LRS\"\n }\n \n variable \"data_disk_size_gb\" {\n- description = \"Storage data disk size size\"\n+ description = \"Storage data disk size size.\"\n default = 30\n }\n \n variable \"boot_diagnostics\" {\n type = bool\n- description = \"(Optional) Enable or Disable boot diagnostics\"\n+ description = \"(Optional) Enable or Disable boot diagnostics.\"\n default = false\n }\n \n variable \"boot_diagnostics_sa_type\" {\n- description = \"(Optional) Storage account type for boot diagnostics\"\n+ description = \"(Optional) Storage account type for boot diagnostics.\"\n default = \"Standard_LRS\"\n }\n \n variable \"enable_accelerated_networking\" {\n type = bool\n- description = \"(Optional) Enable accelerated networking on Network interface\"\n+ description = \"(Optional) Enable accelerated networking on Network interface.\"\n default = false\n }\n \n variable \"enable_ssh_key\" {\n type = bool\n- description = \"(Optional) Enable ssh key authentication in Linux virtual Machine\"\n+ description = \"(Optional) Enable ssh key authentication in Linux virtual Machine.\"\n default = true\n }\n \n variable \"nb_data_disk\" {\n- description = \"(Optional) Number of the data disks attached to each virtual machine\"\n+ description = \"(Optional) Number of the data disks attached to each virtual machine.\"\n default = 0\n }\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nUsing Terraform 0.12.x, if the current default value \"\" is used for `public_ip_dns` an error will occur:\r\n\r\n```\r\nError: domain_name_label must contain only lowercase alphanumeric characters, numbers and hyphens. It must start with a letter and end only with a number or letter\r\n```\r\n\r\nso I propose changing the default value to `[null]` which will ensure that `domain_name_label` remains unset. I think this also addresses https://github.com/Azure/terraform-azurerm-compute/issues/13, https://github.com/Azure/terraform-azurerm-compute/issues/49.\r\n\r\nThank you!\n\n---\n\nChoice A:\nvariables.tf\n@@ -13,7 +13,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n+ default = [null]\n }\n \n variable \"admin_password\" {\n---\n\n\n---\n\nChoice B:\nvariables.tf\n@@ -13,7 +13,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default \n = [\"\"]\n+ default = [null]\n }\n \n variable \"admin_password\" {\n---\n\n\n---\n\nChoice C:\nvariables.tf\n@@ -13,7 +13,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- = = [\"\"]\n+ default = [null]\n }\n \n variable \"admin_password\" {\n---\n\n\n---\n\nChoice D:\nvariables.tf\n@@ -13,7 +13,7 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of \"admin_password\" which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n+ default = [null]\n }\n \n variable \"admin_password\" {\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nUsing Terraform 0.12.x, if the current default value \"\" is used for `public_ip_dns` an error will occur:\r\n\r\n```\r\nError: domain_name_label must contain only lowercase alphanumeric characters, numbers and hyphens. It must start with a letter and end only with a number or letter\r\n```\r\n\r\nso I propose adding a check to see if the value is the empty string, and if so set `public_ip_dns = null`, otherwise to the value itself. I think this also addresses https://github.com/Azure/terraform-azurerm-compute/issues/13.\r\n\r\nThank you!\n\n---\n\nChoice A:\nmain.tf\n@@ -251,7 +251,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n+ domain_name_label = element(var.public_ip_dns, count.index) == \"\" ? null : element(var.public_ip_dns, count.index)\n tags = \"${var.tags}\"\n }\n \n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -251,7 +251,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = count.index)}\"\n+ domain_name_label = element(var.public_ip_dns, count.index) == \"\" ? null : element(var.public_ip_dns, count.index)\n tags = \"${var.tags}\"\n }\n \n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -251,7 +251,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n+ domain_name_label = element(var.public_ip_dns, count.index) == \"\" ? null : element(var.public_ip_dns, count.index)\n tags = \"${var.tags}\"\n }\n \n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -251,7 +251,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n+ domain_name_label = element(var.public_ip_dns, count.index) == \"\" ? null : element(var.public_ip_dns, count.index)\n tags = = \"${var.tags}\"\n }\n \n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nResolves #99, allowing use with TF 0.12.\r\n\r\nPrior to this change, Terraform complains because of the version of the Random provider required.\r\n\r\n```\r\n$ terraform init\r\nInitializing modules...\r\nDownloading Azure/compute/azurerm 1.2.1 for VM...\r\n- VM in .terraform/modules/VM/Azure-terraform-azurerm-compute-dbe0daa\r\n- VM.os in .terraform/modules/VM/Azure-terraform-azurerm-compute-dbe0daa/os\r\n\r\nInitializing the backend...\r\n\r\nInitializing provider plugins...\r\n- Checking for available provider plugins...\r\n\r\nProvider \"random\" v1.3.1 is not compatible with Terraform 0.12.3.\r\n\r\nProvider version 2.1.0 is the earliest compatible version. Select it with \r\nthe following version constraint:\r\n\r\n\tversion = \"~> 2.1\"\r\n\r\nTerraform checked all of the plugin versions matching the given constraint:\r\n ~> 1.0\r\n\r\nConsult the documentation for this provider for more information on\r\ncompatibility between provider and Terraform versions.\r\n\r\n\r\nError: incompatible provider version\r\n```\r\n\r\nChanging this requirement doesn't impact the module functionality in my testing, and allows usage on Terraform 0.12.3;\r\n\r\n```\r\n$ terraform init\r\nInitializing modules...\r\n\r\nInitializing the backend...\r\n\r\nInitializing provider plugins...\r\n- Checking for available provider plugins...\r\n- Downloading plugin for provider \"random\" (terraform-providers/random) 2.1.2...\r\n\r\nTerraform has been successfully initialized!\r\n```\n\n---\n\nChoice A:\n{\n- -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n provider \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n provider \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n = \n provider \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n version \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n### Reason For PR\r\nThis PR modifies where the security group rule is created. Before the security group rule was an inline rule in the security group resource. By using an inline rule it causes problem later if you wish to add additional rules to the security group. Basically, between terraform apply the additional rules will be added or removed. \r\n\r\nFor convenience I also added the output `network_security_group_name` so that it can be used for additional `azurerm_network_security_rule` resources. \r\n\r\n### Example Usage\r\n```\r\nmodule \"cluster\" {\r\n source = \"../terraform-azurerm-compute\"\r\n\r\n nb_instances = \"1\"\r\n admin_username = \"${var.user_name}\"\r\n resource_group_name = \"${var.resource_group_name}\"\r\n location = \"${var.location}\"\r\n nb_public_ip = \"1\"\r\n public_ip_dns = [\"test-cluster\"]\r\n ssh_key = \"${var.public_key_path}\"\r\n}\r\n\r\nresource \"azurerm_network_security_rule\" \"new_rule\" {\r\n name = \"allow_remote_8080_in_all\"\r\n description = \"Allow remote protocol in from all locations\"\r\n priority = 101\r\n direction = \"Inbound\"\r\n access = \"Allow\"\r\n protocol = \"Tcp\"\r\n source_port_range = \"*\"\r\n destination_port_range = \"8080\"\r\n source_address_prefix = \"*\"\r\n destination_address_prefix = \"*\"\r\n resource_group_name = \"${var.resource_group_name}\"\r\n network_security_group_name= \"${module.cluster.network_security_group_name}\"\r\n}\r\n```\r\n\r\nAny feedback and suggestions are welcome. Thanks for the module!\r\n\r\n#103 \n\n---\n\nChoice A:\nmain.tf\n@@ -260,22 +260,24 @@ resource \"azurerm_network_security_group\" \"vm\" {\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n- security_rule {\n- name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n- description = \"Allow remote protocol in from all locations\"\n- priority = 100\n- direction = \"Inbound\"\n- access = \"Allow\"\n- protocol = \"Tcp\"\n- source_port_range = \"*\"\n- destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n- source_address_prefix = \"*\"\n- destination_address_prefix = \"*\"\n- }\n-\n tags = \"${var.tags}\"\n }\n \n+resource \"azurerm_network_security_rule\" \"vm\" {\n+ name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 100\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_name = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n---\noutputs.tf\n@@ -8,6 +8,11 @@ output \"network_security_group_id\" {\n value = \"${azurerm_network_security_group.vm.id}\"\n }\n \n+output \"network_security_group_name\" {\n+ description = \"name of the security group provisioned\"\n+ value = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n output \"network_interface_ids\" {\n description = \"ids of the vm nics provisoned.\"\n value = \"${azurerm_network_interface.vm.*.id}\"\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -260,22 +260,24 @@ resource \"azurerm_network_security_group\" \"vm\" {\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n- security_rule {\n- name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n- description = \"Allow remote protocol in from all locations\"\n- priority = 100\n- direction = \"Inbound\"\n- access = \"Allow\"\n- protocol = \"Tcp\"\n- source_port_range = \"*\"\n- destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n- source_address_prefix = \"*\"\n- destination_address_prefix = \"*\"\n- }\n-\n tags = \"${var.tags}\"\n }\n \n+resource \"azurerm_network_security_rule\" \"vm\" {\n+ name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 100\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_name = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n---\noutputs.tf\n@@ -8,6 +8,11 @@ output \"network_security_group_id\" {\n value = \"${azurerm_network_security_group.vm.id}\"\n }\n \n+output \"network_security_group_name\" {\n+ description = \"name of the security group provisioned\"\n+ value = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n output \"network_interface_ids\" {\n description = \"ids of the vm nics provisoned.\"\n value = \"${azurerm_network_interface.vm.*.id}\"\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -260,22 +260,24 @@ resource \"azurerm_network_security_group\" \"vm\" {\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n- security_rule {\n- name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n- description = \"Allow remote protocol in from all locations\"\n- priority = 100\n- direction = \"Inbound\"\n- access = \"Allow\"\n- protocol = \"Tcp\"\n- source_port_range = \"*\"\n- destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n- source_address_prefix = \"*\"\n- destination_address_prefix = \"*\"\n- }\n-\n tags = \"${var.tags}\"\n }\n \n+resource \"azurerm_network_security_rule\" \"vm\" {\n+ name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 100\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_name = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n---\noutputs.tf\n@@ -8,6 +8,11 @@ output \"network_security_group_id\" {\n value = \"${azurerm_network_security_group.vm.id}\"\n }\n \n+output \"network_security_group_name\" {\n+ description = \"name of the security group provisioned\"\n+ value = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n output \"network_interface_ids\" {\n description = \"ids of the vm nics provisoned.\"\n value = \"${azurerm_network_interface.vm.*.id}\"\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -260,22 +260,24 @@ resource \"azurerm_network_security_group\" \"vm\" {\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n- security_rule {\n- name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n- description = \"Allow remote protocol in from all locations\"\n- priority = 100\n- direction = \"Inbound\"\n- access = \"Allow\"\n- protocol = \"Tcp\"\n- source_port_range = \"*\"\n- destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n- source_address_prefix = \"*\"\n- destination_address_prefix = \"*\"\n- }\n-\n tags = \"${var.tags}\"\n }\n \n+resource \"azurerm_network_security_rule\" \"vm\" {\n+ name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 100\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"${coalesce(var.remote_port,module.os.calculated_remote_port)}\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_name = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n---\noutputs.tf\n@@ -8,6 +8,11 @@ output \"network_security_group_id\" {\n value = \"${azurerm_network_security_group.vm.id}\"\n }\n \n+output \"network_security_group_name\" {\n+ description = \"name of the security group provisioned\"\n+ value = \"${azurerm_network_security_group.vm.name}\"\n+}\n+\n output \"network_interface_ids\" {\n description = \"ids of the vm nics provisoned.\"\n value = \"${azurerm_network_interface.vm.*.id}\"\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nOriginal conditions setting amount of VMs to be created according to detected type of virtual machine based on variables `vm_os_simple` and `vm_os_offer` \r\n```\r\ncount = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\r\n```\r\nhas been comparing complete strings in list (i.e. `\"Windows\" == \"Windows\"`, but `\"WindowsServer\" != \"Windows\"`):\r\n\r\n```\r\n> contains(list(\"Windows\", \"Ubuntu\"), \"Windows\")\r\ntrue\r\n> contains(list(\"WindowsServer\", \"Ubuntu\"), \"Windows\")\r\nfalse\r\n```\r\nI have changed conditions for `count` variable to check substrings (case insensitive), which is in my opinion \"more versatile\"\r\n```\r\n> contains(list(\"${replace(\"WindowsServer\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"Ubuntu\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")\r\ntrue\r\n> contains(list(\"${replace(\"Linux\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"Ubuntu\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")\r\nfalse\r\n```\r\n\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -85,7 +85,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -142,7 +142,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -185,7 +185,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"true\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -85,7 +85,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -142,7 +142,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -185,7 +185,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"true\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -85,7 +85,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -142,7 +142,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -185,7 +185,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"true\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -85,7 +85,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -142,7 +142,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -185,7 +185,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${replace(\"${var.vm_os_simple}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\", \"${replace(\"${var.vm_os_offer}\", \"/(?:.*)((?i)windows)(?:.*)/\", \"windows\")}\"), \"windows\")) && var.data_disk == \"true\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nhttps://github.com/Azure/terraform-azurerm-compute/issues/87\n\n---\n\nChoice A:\nREADME.md\n@@ -35,6 +35,7 -72,7 Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n vm_hostname = \"mywinvm\" // line can be removed if only one VM module per resource group\n admin_password = \"ComplxP@ssw0rd!\"\n vm_os_simple = \"WindowsServer\"\n+ is_windows_image = \"true\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n }\n---\nvariables.tf\n@@ -72,7 +72,7 @@ variable \"vm_os_id\" {\n }\n \n variable \"is_windows_image\" {\n- description = \"Boolean flag to notify when the custom image is windows based. Only used in conjunction with vm_os_id\"\n+ description = \"Boolean flag to notify when the custom image is windows based.\"\n default = \"false\"\n }\n \n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -35,6 +35,7 @@ Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n vm_hostname = \"mywinvm\" // line can be removed if only one VM module per resource group\n admin_password = \"ComplxP@ssw0rd!\"\n vm_os_simple = \"WindowsServer\"\n+ is_windows_image = \"true\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n }\n---\nvariables.tf\n@@ -72,7 +72,7 @@ variable \"vm_os_id\" {\n }\n \n variable \"is_windows_image\" {\n- description = \"Boolean flag to notify when the custom image is windows based. Only used in conjunction with vm_os_id\"\n+ description = \"Boolean flag to notify when the custom image is windows based.\"\n default = \"false\"\n }\n \n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -35,6 +35,7 @@ Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n vm_hostname = \"mywinvm\" // line can be removed if only one VM module per resource group\n admin_password = \"ComplxP@ssw0rd!\"\n vm_os_simple = \"WindowsServer\"\n+ is_windows_image = \"true\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n }\n---\nvariables.tf\n@@ -72,7 +72,7 @@ variable \"vm_os_id\" {\n }\n \n variable \"is_windows_image\" {\n- description = \"Boolean flag to notify when the custom image is windows based. Only used in conjunction with vm_os_id\"\n+ description = \"Boolean flag to notify when the custom image is windows based.\"\n +72,7 = \"false\"\n }\n \n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -35,6 +35,7 @@ Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n vm_hostname = \"mywinvm\" // line can be removed if only one VM module per resource group\n admin_password = \"Boolean vm_os_simple = \"WindowsServer\"\n+ is_windows_image = \"true\"\n public_ip_dns = [\"winsimplevmips\"] // change to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n }\n---\nvariables.tf\n@@ -72,7 +72,7 @@ variable \"vm_os_id\" {\n }\n \n variable \"is_windows_image\" {\n- description = \"Boolean flag to notify when the custom image is windows based. Only used in conjunction with vm_os_id\"\n+ description = \"Boolean flag to notify when the custom image is windows based.\"\n default = \"false\"\n }\n \n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\ngibe the user the possibility to use an already existing resource group\n\n---\n\nChoice A:\nmain.tf\n@@ -12,6 +12,7 @@ module \"os\" {\n }\n \n resource \"azurerm_resource_group\" \"vm\" {\n+ count = \"${var.resource_group_create == \"true\" ? 1 : 0}\"\n name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n tags = \"${var.tags}\"\n@@ -28,7 +29,7 @@ resource \"random_id\" \"vm-sa\" {\n resource \"azurerm_storage_account\" \"vm-sa\" {\n count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n@@ -39,7 +40,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -88,7 +89,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -145,7 +146,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n count resource_group_name = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -188,7 +189,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -237,8 +238,8 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n@@ -249,16 +250,16 @@ resource \"azurerm_public_ip\" \"vm\" {\n count = \"${var.nb_public_ip}\"\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-${coalesce(var.remote_port,module.os.calculated_remote_port)}-nsg\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n \n security_rule {\n name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n@@ -279,8 +280,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n---\nvariables.tf\n@@ -3,6 +3,11 @@ variable \"resource_group_name\" {\n default = \"terraform-compute\"\n }\n \n+variable \"resource_group_create\" {\n+ description = \"Set to true if a new resource group for the virtual machines should be created\"\n+ default = true\n+}\n+\n variable \"location\" {\n description = \"The location/region where the virtual network is created. Changing this forces a new resource to be created.\"\n }\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -12,6 +12,7 @@ module \"os\" {\n }\n \n resource \"azurerm_resource_group\" \"vm\" {\n+ count = \"${var.resource_group_create == \"true\" ? 1 : 0}\"\n name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n tags = \"${var.tags}\"\n@@ -28,7 +29,7 @@ resource \"random_id\" \"vm-sa\" {\n resource \"azurerm_storage_account\" \"vm-sa\" {\n count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n@@ -39,7 +40,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -88,7 +89,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -145,7 +146,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -188,7 +189,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -237,8 +238,8 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n@@ -249,16 +250,16 @@ resource \"azurerm_public_ip\" \"vm\" {\n count = \"${var.nb_public_ip}\"\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-${coalesce(var.remote_port,module.os.calculated_remote_port)}-nsg\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n \n security_rule {\n name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n@@ -279,8 +280,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n---\nvariables.tf\n@@ -3,6 +3,11 @@ variable \"resource_group_name\" {\n default = \"terraform-compute\"\n }\n \n+variable \"resource_group_create\" {\n+ description = \"Set to true if a new resource group for the virtual machines should be created\"\n+ default = true\n+}\n+\n variable \"location\" {\n description = \"The location/region where the virtual network is created. Changing this forces a new resource to be created.\"\n }\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -12,6 +12,7 @@ module \"os\" {\n }\n \n resource \"azurerm_resource_group\" \"vm\" {\n+ count = \"${var.resource_group_create == \"true\" ? 1 : 0}\"\n name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n tags \"true\" = \"${var.tags}\"\n@@ -28,7 +29,7 @@ resource \"random_id\" \"vm-sa\" {\n resource \"azurerm_storage_account\" \"vm-sa\" {\n count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n@@ -39,7 +40,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -88,7 +89,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -145,7 +146,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -188,7 +189,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -237,8 +238,8 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n@@ -249,16 +250,16 @@ resource \"azurerm_public_ip\" \"vm\" {\n count = \"${var.nb_public_ip}\"\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-${coalesce(var.remote_port,module.os.calculated_remote_port)}-nsg\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n \n security_rule {\n name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n@@ -279,8 +280,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n---\nvariables.tf\n@@ -3,6 +3,11 @@ variable \"resource_group_name\" {\n default = \"terraform-compute\"\n }\n \n+variable \"resource_group_create\" {\n+ description = \"Set to true if a new resource group for the virtual machines should be created\"\n+ default = true\n+}\n+\n variable \"location\" {\n description = \"The location/region where the virtual network is created. Changing this forces a new resource to be created.\"\n }\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -12,6 +12,7 @@ module \"os\" {\n }\n \n resource \"azurerm_resource_group\" \"vm\" {\n+ count = \"${var.resource_group_create == \"true\" ? 1 : 0}\"\n name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n tags = \"${var.tags}\"\n@@ -28,7 +29,7 @@ resource \"random_id\" \"vm-sa\" {\n resource \"azurerm_storage_account\" \"vm-sa\" {\n count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n location = \"${var.location}\"\n account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n@@ -39,7 +40,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -88,7 +89,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -145,7 +146,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -188,7 +189,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n@@ -237,8 +238,8 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n resource \"azurerm_availability_set\" \"vm\" {\n name = \"${var.vm_hostname}-avset\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n@@ -249,16 +250,16 @@ resource \"azurerm_public_ip\" \"vm\" {\n count = \"${var.nb_public_ip}\"\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n name = \"${var.vm_hostname}-${coalesce(var.remote_port,module.os.calculated_remote_port)}-nsg\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n \n security_rule {\n name = \"allow_remote_${coalesce(var.remote_port,module.os.calculated_remote_port)}_in_all\"\n@@ -279,8 +280,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ resource_group_name = \"${var.resource_group_name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n---\nvariables.tf\n@@ -3,6 +3,11 @@ variable \"resource_group_name\" {\n default = \"terraform-compute\"\n }\n \n+variable \"resource_group_create\" {\n+ description = \"Set to true if a new resource group for the virtual machines should be created\"\n+ default = true\n+}\n+\n variable \"location\" {\n description = \"The location/region where the virtual network is created. Changing this forces a new resource to be created.\"\n }\n---\n\n\n---\n"}], "ideal": "D"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nadded new version strings for CentOS and RHEL\n\n---\n\nChoice A:\nos/variables.tf\n@@ -7,9 +7,9 @@ variable \"standard_os\" {\n default = {\n \"UbuntuServer\" = \"Canonical,UbuntuServer,16.04-LTS\"\n \"WindowsServer\" = \"MicrosoftWindowsServer,WindowsServer,2016-Datacenter\"\n- \"RHEL\" = \"RedHat,RHEL,7.3\"\n+ \"RHEL\" = \"RedHat,RHEL,7.5\"\n \"openSUSE-Leap\" = \"SUSE,openSUSE-Leap,42.2\"\n- \"CentOS\" = \"OpenLogic,CentOS,7.3\"\n+ \"CentOS\" = \"OpenLogic,CentOS,7.6\"\n \"Debian\" = \"credativ,Debian,8\"\n \"CoreOS\" = \"CoreOS,CoreOS,Stable\"\n \"SLES\" = \"SUSE,SLES,12-SP2\"\n---\n\n\n---\n\nChoice B:\nos/variables.tf\n@@ -7,9 +7,9 @@ variable \"standard_os\" {\n default = {\n \"UbuntuServer\" = \"Canonical,UbuntuServer,16.04-LTS\"\n \"WindowsServer\" = \"MicrosoftWindowsServer,WindowsServer,2016-Datacenter\"\n- \"RHEL\" = \"RedHat,RHEL,7.3\"\n+ \"RHEL\" = \"RedHat,RHEL,7.5\"\n \"openSUSE-Leap\" = \"SUSE,openSUSE-Leap,42.2\"\n- \"CentOS\" = \"OpenLogic,CentOS,7.3\"\n+ \"CentOS\" = \"OpenLogic,CentOS,7.6\"\n \"Debian\" = \"credativ,Debian,8\"\n \"CoreOS\" = \"CoreOS,CoreOS,Stable\"\n \"SLES\" = \"SUSE,SLES,12-SP2\"\n---\n\n\n---\n\nChoice C:\nos/variables.tf\n@@ -7,9 +7,9 @@ variable \"standard_os\" {\n default = {\n \"UbuntuServer\" = \"Canonical,UbuntuServer,16.04-LTS\"\n \"WindowsServer\" = \"MicrosoftWindowsServer,WindowsServer,2016-Datacenter\"\n- \"RHEL\" = \"RedHat,RHEL,7.3\"\n+ \"RHEL\" = \"RedHat,RHEL,7.5\"\n \"openSUSE-Leap\" = \"SUSE,openSUSE-Leap,42.2\"\n- \"CentOS\" = \"OpenLogic,CentOS,7.3\"\n+ \"CentOS\" = \"OpenLogic,CentOS,7.6\"\n \"Debian\" = \"credativ,Debian,8\"\n \"CoreOS\" = \"CoreOS,CoreOS,Stable\"\n \"SLES\" = \"SUSE,SLES,12-SP2\"\n---\n\n\n---\n\nChoice D:\n= -7,9 +7,9 @@ variable \"standard_os\" {\n default = {\n \"UbuntuServer\" = \"Canonical,UbuntuServer,16.04-LTS\"\n \"WindowsServer\" = \"MicrosoftWindowsServer,WindowsServer,2016-Datacenter\"\n- \"RHEL\" = \"RedHat,RHEL,7.3\"\n+ \"RHEL\" = \"RedHat,RHEL,7.5\"\n \"openSUSE-Leap\" = \"SUSE,openSUSE-Leap,42.2\"\n- \"CentOS\" = \"OpenLogic,CentOS,7.3\"\n+ \"CentOS\" = \"OpenLogic,CentOS,7.6\"\n \"Debian\" = \"credativ,Debian,8\"\n \"CoreOS\" = \"CoreOS,CoreOS,Stable\"\n \"SLES\" = \"SUSE,SLES,12-SP2\"\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nChanged to allocation_method. Values are: Dynamic or Static. \r\nI also changed value in var.public_ip_address_allocation in order to use case-sensitive value (Dynamic as default) but I did not change variable name for backward compatibility. \n\n---\n\nChoice A:\nmain.tf\n@@ -1,9 +1,9 @@\n provider \"azurerm\" {\n- version = \">= 1.1.0\"\n+ version = \"~> 1.2\"\n }\n \n provider \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n@@ -250,7 +250,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n+ allocation_method = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags provider = \"${var.tags}\"\n }\n@@ -273,6 +273,32 @@ resource \"azurerm_network_security_group\" \"vm\" {\n destination_address_prefix = \"*\"\n }\n \n+ security_rule {\n+ name = \"allow_remote_80_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 200\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"80\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n+ security_rule {\n+ name = \"allow_remote_8080_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 300\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"8080\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n tags = \"${var.tags}\"\n }\n \n---\nvariables.tf\n@@ -107,7 +107,7 @@ variable \"tags\" {\n \n variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n- default = \"dynamic\"\n+ default = \"Dynamic\"\n }\n \n variable \"nb_public_ip\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -1,9 +1,9 @@\n provider \"azurerm\" {\n- version = \">= 1.1.0\"\n+ version = \"~> 1.2\"\n }\n \n provider \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n@@ -250,7 +250,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n+ allocation_method = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags = \"${var.tags}\"\n }\n@@ -273,6 +273,32 @@ resource \"azurerm_network_security_group\" \"vm\" {\n destination_address_prefix = \"*\"\n }\n \n+ security_rule {\n+ name = \"allow_remote_80_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 200\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"80\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n+ security_rule {\n+ name = \"allow_remote_8080_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 300\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"8080\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n tags = \"${var.tags}\"\n }\n \n---\nvariables.tf\n@@ -107,7 +107,7 @@ variable \"tags\" {\n \n variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n- default = \"dynamic\"\n+ default = \"Dynamic\"\n }\n \n variable \"nb_public_ip\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -1,9 +1,9 @@\n provider \"azurerm\" {\n- version = \">= 1.1.0\"\n+ version = \"~> 1.2\"\n }\n \n provider \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n@@ -250,7 +250,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n+ allocation_method = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags = \"${var.tags}\"\n }\n@@ -273,6 +273,32 @@ resource \"azurerm_network_security_group\" \"vm\" {\n destination_address_prefix = \"*\"\n }\n \n+ security_rule {\n+ name = \"allow_remote_80_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 200\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"80\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n+ security_rule {\n+ name = \"allow_remote_8080_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 300\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"8080\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n tags = \"${var.tags}\"\n }\n \n---\nvariables.tf\n@@ -107,7 +107,7 @@ variable \"tags\" {\n \n variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n- default = \"dynamic\"\n+ default = \"Dynamic\"\n }\n \n variable \"nb_public_ip\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -1,9 +1,9 @@\n provider \"azurerm\" {\n- version = \">= 1.1.0\"\n+ version = \"~> 1.2\"\n }\n \n provider \"random\" {\n- version = \"~> 1.0\"\n+ version = \"~> 2.1\"\n }\n \n module \"os\" {\n@@ -250,7 +250,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n+ allocation_method = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n tags = \"${var.tags}\"\n }\n@@ -273,6 +273,32 @@ resource \"azurerm_network_security_group\" \"vm\" {\n destination_address_prefix = \"*\"\n }\n \n+ security_rule {\n+ name = \"allow_remote_80_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 200\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"80\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n+ security_rule {\n+ name = \"allow_remote_8080_in_all\"\n+ description = \"Allow remote protocol in from all locations\"\n+ priority = 300\n+ direction = \"Inbound\"\n+ access = \"Allow\"\n+ protocol = \"Tcp\"\n+ source_port_range = \"*\"\n+ destination_port_range = \"8080\"\n+ source_address_prefix = \"*\"\n+ destination_address_prefix = \"*\"\n+ }\n+\n tags = \"${var.tags}\"\n }\n \n---\nvariables.tf\n@@ -107,7 +107,7 @@ variable \"tags\" {\n \n variable \"public_ip_address_allocation\" {\n = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n- default = \"dynamic\"\n+ default = \"Dynamic\"\n }\n \n variable \"nb_public_ip\" {\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nFor initialization.\n\n---\n\nChoice A:\nmain.tf\n@@ -64,6 +64,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n@@ -120,6 +121,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n---\ntest/fixture/main.tf\n@@ -11,6 +11,7 @@ module \"ubuntuservers\" {\n location = \"${var.location}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_1}\"\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n@@ -25,6 +26,7 @@ module \"debianservers\" {\n vm_hostname = \"mylinvm\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_2}\"\n public_ip_dns = [\"debiansimplevmips-${random_id.ip_dns.hex}\"] // change to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_1 = \"UbuntuServer\"\n vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n+custom_data = \"\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_1\" {}\n variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n+variable \"custom_data\" {}\n---\nvariables.tf\n@@ -36,6 +36,11 @@ variable \"admin_username\" {\n default = \"azureuser\"\n }\n \n+variable \"custom_data\" {\n+ description = \"The custom data to supply to the machine. This can be used as a cloud-init for Linux systems.\"\n+ default = \"\"\n+}\n+\n variable \"storage_account_type\" {\n description = \"Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS.\"\n default = \"Premium_LRS\"\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -64,6 +64,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n@@ -120,6 +121,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n---\ntest/fixture/main.tf\n@@ -11,6 +11,7 @@ module \"ubuntuservers\" {\n location = \"${var.location}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_1}\"\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n@@ -25,6 +26,7 @@ module \"debianservers\" {\n vm_hostname = \"mylinvm\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_2}\"\n public_ip_dns = [\"debiansimplevmips-${random_id.ip_dns.hex}\"] // \"${var.admin_username}\"\n to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_1 = \"UbuntuServer\"\n vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n+custom_data = \"\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_1\" {}\n variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n+variable \"custom_data\" {}\n---\nvariables.tf\n@@ -36,6 +36,11 @@ variable \"admin_username\" {\n default = \"azureuser\"\n }\n \n+variable \"custom_data\" {\n+ description = \"The custom data to supply to the machine. This can be used as a cloud-init for Linux systems.\"\n+ default = \"\"\n+}\n+\n variable \"storage_account_type\" {\n description = \"Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS.\"\n default = \"Premium_LRS\"\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -64,6 +64,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n@@ -120,6 +121,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n---\ntest/fixture/main.tf\n@@ -11,6 +11,7 @@ module \"ubuntuservers\" {\n location = \"${var.location}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_1}\"\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n@@ -25,6 +26,7 @@ module \"debianservers\" {\n vm_hostname = \"mylinvm\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_2}\"\n public_ip_dns = [\"debiansimplevmips-${random_id.ip_dns.hex}\"] // change to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_1 = \"UbuntuServer\"\n vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n+custom_data = \"\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_1\" {}\n variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n+variable \"custom_data\" {}\n---\nvariables.tf\n@@ -36,6 +36,11 @@ variable \"admin_username\" {\n default = \"azureuser\"\n }\n \n+variable \"custom_data\" {\n+ description = \"The custom data to supply to the machine. This can be used as a cloud-init for Linux systems.\"\n+ default = \"\"\n+}\n+\n variable \"storage_account_type\" {\n description = \"Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS.\"\n default = \"Premium_LRS\"\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -64,6 +64,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n@@ -120,6 +121,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n computer_name = \"${var.vm_hostname}${count.index}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n }\n \n os_profile_linux_config {\n---\ntest/fixture/main.tf\n@@ +11,7 @@ module \"ubuntuservers\" {\n location = \"${var.location}\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_1}\"\n public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n@@ -25,6 +26,7 @@ module \"debianservers\" {\n vm_hostname = \"mylinvm\"\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n+ custom_data = \"${var.custom_data}\"\n vm_os_simple = \"${var.vm_os_simple_2}\"\n public_ip_dns = [\"debiansimplevmips-${random_id.ip_dns.hex}\"] // change to a unique name per datacenter region\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\ntest/fixture/terraform.tfvars\n@@ -5,3 +5,4 @@ vm_os_simple_1 = \"UbuntuServer\"\n vm_os_simple_2 = \"Debian\"\n admin_username = \"azureuser\"\n admin_password = \"P@ssw0rd12345!\"\n+custom_data = \"\"\n---\ntest/fixture/variables.tf\n@@ -5,3 +5,4 @@ variable \"vm_os_simple_1\" {}\n variable \"vm_os_simple_2\" {}\n variable \"admin_username\" {}\n variable \"admin_password\" {}\n+variable \"custom_data\" {}\n---\nvariables.tf\n@@ -36,6 +36,11 @@ variable \"admin_username\" {\n default = \"azureuser\"\n }\n \n+variable \"custom_data\" {\n+ description = \"The custom data to supply to the machine. This can be used as a cloud-init for Linux systems.\"\n+ default = \"\"\n+}\n+\n variable \"storage_account_type\" {\n description = \"Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS.\"\n default = \"Premium_LRS\"\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nIn the [documentation](https://registry.terraform.io/modules/Azure/compute/azurerm/1.1.7?tab=inputs), `public_ip_dns` input is not an optional input. Instead, it should be part of required inputs.\r\n```bash\r\n$ terraform plan\r\n\r\nError: module.compute.azurerm_public_ip.vm: \"domain_name_label\" cannot be an empty string: \"\"\r\n\r\nError: module.compute.azurerm_public_ip.vm: only lowercase alphanumeric characters and hyphens allowed in \"domain_name_label\": \"\"\r\n```\n\n---\n\nChoice A:\nvariables.tf\n@@ -13,7 +13,6 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each default ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -107,7 +106,7 @@ variable \"public_ip_address_allocation\" {\n \n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n- default = \"1\"\n+ default = \"0\"\n }\n \n variable \"delete_os_disk_on_termination\" {\n---\n\n\n---\n\nChoice B:\nvariables.tf\n@@ -13,7 +13,6 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- datacenter default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -107,7 +106,7 @@ variable \"public_ip_address_allocation\" {\n \n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n- default = \"1\"\n+ default = \"0\"\n }\n \n variable \"delete_os_disk_on_termination\" {\n---\n\n\n---\n\nChoice C:\nvariables.tf\n@@ -13,7 +13,6 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names per will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -107,7 +106,7 @@ variable \"public_ip_address_allocation\" {\n \n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n- default = \"1\"\n+ default = \"0\"\n }\n \n variable \"delete_os_disk_on_termination\" {\n---\n\n\n---\n\nChoice D:\nvariables.tf\n@@ -13,7 +13,6 @@ variable \"vnet_subnet_id\" {\n \n variable \"public_ip_dns\" {\n description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n- default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -107,7 +106,7 @@ variable \"public_ip_address_allocation\" {\n \n variable \"nb_public_ip\" {\n description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n- default = \"1\"\n+ default = \"0\"\n }\n \n variable \"delete_os_disk_on_termination\" {\n---\n\n\n---\n"}], "ideal": "D"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAdd enable_accelerated_networking on\r\nmain.tf on Network interface\r\nvariable.tf \r\nreadme.md for documented on sample\n\n---\n\nChoice A:\nREADME.md\n@@ -81,43 +81,47 @@ More specifically this provisions:\n \n ```hcl\n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = \"0\"\n- remote_port = \"22\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- boot_diagnostics = \"true\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n delete_os_disk_on_termination = \"true\"\n- data_disk = \"true\"\n- data_disk_size_gb = \"64\"\n- data_sa_type = \"Premium_LRS\"\n- tags = {\n- environment = \"dev\"\n- costcenter = \"it\"\n- }\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"windowsservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mywinvm\"\n- admin_password = \"ComplxP@ssw0rd!\"\n- public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n- nb_public_ip = \"2\"\n- remote_port = \"3389\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"MicrosoftWindowsServer\"\n- vm_os_offer = \"WindowsServer\"\n- vm_os_sku = \"2012-R2-Datacenter\"\n- vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -277,11 +277,12 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n- count = \"${var.nb_instances}\"\n- name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ count = \"${var.nb_instances}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n+ location = \"${azurerm_resource_group.vm.location}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n ip_configuration {\n name = \"ipconfig${count.index}\"\n---\ntest/fixture/main.tf\n@@ -7,17 +7,18 @@ resource \"random_id\" \"ip_dns\" {\n }\n \n module \"ubuntuservers\" {\n- source = \"../../\"\n- location = \"${var.location}\"\n- admin_username = \"${var.admin_username}\"\n- admin_password = \"${var.admin_password}\"\n- custom_data = \"${var.custom_data}\"\n- vm_os_simple = \"${var.vm_os_simple_1}\"\n- public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- ssh_key = \"${var.ssh_key}\"\n- resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n- public_ip_address_allocation = \"static\"\n+ source = \"../../\"\n+ location = \"${var.location}\"\n+ admin_username = \"${var.admin_username}\"\n+ admin_password = \"${var.admin_password}\"\n+ vm_os_simple = \"${var.vm_os_simple_1}\"\n+ public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ ssh_key = \"${var.ssh_key}\"\n+ resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n+ public_ip_address_allocation = \"static\"\n+ enable_accelerated_networking = \"true\"\n+ vm_size = \"Standard_DS2_V2\"\n }\n \n module \"debianservers\" {\n---\nvariables.tf\n@@ -145,3 +145,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"enable_accelerated_networking\" {\n+ type = \"string\"\n+ description = \"(Optional) Enable accelerated networking on Network interface\"\n+ default = \"false\"\n+}\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -81,43 +81,47 @@ More specifically this provisions:\n \n ```hcl\n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = \"0\"\n- remote_port = \"22\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- boot_diagnostics = \"true\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n delete_os_disk_on_termination = \"true\"\n- data_disk = \"true\"\n- data_disk_size_gb = \"64\"\n- data_sa_type = \"Premium_LRS\"\n- tags = {\n- environment = \"dev\"\n- costcenter = \"it\"\n- }\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"windowsservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mywinvm\"\n- admin_password = \"ComplxP@ssw0rd!\"\n- public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n- nb_public_ip = \"2\"\n- remote_port = \"3389\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"MicrosoftWindowsServer\"\n- vm_os_offer = \"WindowsServer\"\n- vm_os_sku = \"2012-R2-Datacenter\"\n- vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -277,11 +277,12 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n- count = \"${var.nb_instances}\"\n- name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ count = \"${var.nb_instances}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n+ location = \"${azurerm_resource_group.vm.location}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n ip_configuration {\n name = \"ipconfig${count.index}\"\n---\ntest/fixture/main.tf\n@@ -7,17 +7,18 @@ resource \"random_id\" \"ip_dns\" {\n }\n \n module \"ubuntuservers\" {\n- source = \"../../\"\n- location = \"${var.location}\"\n- admin_username = \"${var.admin_username}\"\n- admin_password = \"${var.admin_password}\"\n- custom_data = \"${var.custom_data}\"\n- vm_os_simple = \"${var.vm_os_simple_1}\"\n- public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- ssh_key = \"${var.ssh_key}\"\n- resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n- public_ip_address_allocation = \"static\"\n+ source = \"../../\"\n+ location = \"${var.location}\"\n+ admin_username = \"${var.admin_username}\"\n+ admin_password = \"${var.admin_password}\"\n+ vm_os_simple = \"${var.vm_os_simple_1}\"\n+ public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ ssh_key = \"${var.ssh_key}\"\n+ resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n+ public_ip_address_allocation = \"static\"\n+ enable_accelerated_networking = \"true\"\n+ vm_size = \"Standard_DS2_V2\"\n }\n \n module \"debianservers\" {\n---\nvariables.tf\n@@ -145,3 +145,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"enable_accelerated_networking\" {\n+ type = \"string\"\n+ description = \"(Optional) Enable accelerated networking on Network interface\"\n+ default = \"false\"\n+}\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -81,43 +81,47 @@ More specifically this provisions:\n \n ```hcl\n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = \"0\"\n- remote_port = \"22\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- boot_diagnostics = \"true\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n delete_os_disk_on_termination = \"true\"\n- data_disk = \"true\"\n- data_disk_size_gb = \"64\"\n- data_sa_type = \"Premium_LRS\"\n- tags = {\n- environment = \"dev\"\n- costcenter = \"it\"\n- }\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"windowsservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mywinvm\"\n- admin_password = \"ComplxP@ssw0rd!\"\n- public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n- nb_public_ip = \"2\"\n- remote_port = \"3389\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"MicrosoftWindowsServer\"\n- vm_os_offer = \"WindowsServer\"\n- vm_os_sku = \"2012-R2-Datacenter\"\n- vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -277,11 +277,12 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n- count = \"${var.nb_instances}\"\n- name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ count = \"${var.nb_instances}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n+ location = \"${azurerm_resource_group.vm.location}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n ip_configuration {\n name = \"ipconfig${count.index}\"\n---\ntest/fixture/main.tf\n@@ -7,17 +7,18 @@ resource \"random_id\" \"ip_dns\" {\n }\n \n module \"ubuntuservers\" {\n- source = \"../../\"\n- location = \"${var.location}\"\n- admin_username = \"${var.admin_username}\"\n- admin_password = \"${var.admin_password}\"\n- custom_data = \"${var.custom_data}\"\n- vm_os_simple = \"${var.vm_os_simple_1}\"\n- public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- ssh_key = \"${var.ssh_key}\"\n- resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n- public_ip_address_allocation = \"static\"\n+ source = \"../../\"\n+ location = \"${var.location}\"\n+ admin_username = \"${var.admin_username}\"\n+ admin_password = \"${var.admin_password}\"\n+ vm_os_simple = \"${var.vm_os_simple_1}\"\n+ public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ ssh_key = \"${var.ssh_key}\"\n+ resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n+ public_ip_address_allocation = \"static\"\n+ enable_accelerated_networking = \"true\"\n+ vm_size = \"Standard_DS2_V2\"\n }\n \n module \"debianservers\" {\n---\nvariables.tf\n@@ -145,3 +145,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"enable_accelerated_networking\" {\n+ type = \"string\"\n+ description = \"(Optional) Enable accelerated networking on Network interface\"\n+ [\"winterravmip\",\"winterravmip1\"]\n- = \"false\"\n+}\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -81,43 +81,47 @@ More specifically this provisions:\n \n ```hcl\n module \"linuxservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mylinuxvm\"\n- nb_public_ip = \"0\"\n- remote_port = \"22\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"Canonical\"\n- vm_os_offer = \"UbuntuServer\"\n- vm_os_sku = \"14.04.2-LTS\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- boot_diagnostics = \"true\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n delete_os_disk_on_termination = \"true\"\n- data_disk = \"true\"\n- data_disk_size_gb = \"64\"\n- data_sa_type = \"Premium_LRS\"\n- tags = {\n- environment = \"dev\"\n- costcenter = \"it\"\n- }\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"windowsservers\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"terraform-advancedvms\"\n- location = \"westus2\"\n- vm_hostname = \"mywinvm\"\n- admin_password = \"ComplxP@ssw0rd!\"\n- public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n- nb_public_ip = \"2\"\n- remote_port = \"3389\"\n- nb_instances = \"2\"\n- vm_os_publisher = \"MicrosoftWindowsServer\"\n- vm_os_offer = \"WindowsServer\"\n- vm_os_sku = \"2012-R2-Datacenter\"\n- vm_size = \"Standard_DS2_V2\"\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\", \"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ enable_accelerated_networking = \"true\"\n }\n \n module \"network\" {\n---\nmain.tf\n@@ -277,11 +277,12 @@ resource \"azurerm_network_security_group\" \"vm\" {\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n- count = \"${var.nb_instances}\"\n- name = \"nic-${var.vm_hostname}-${count.index}\"\n- location = \"${azurerm_resource_group.vm.location}\"\n- resource_group_name = \"${azurerm_resource_group.vm.name}\"\n- network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ count = \"${var.nb_instances}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n+ location = \"${azurerm_resource_group.vm.location}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n+ enable_accelerated_networking = \"${var.enable_accelerated_networking}\"\n \n ip_configuration {\n name = \"ipconfig${count.index}\"\n---\ntest/fixture/main.tf\n@@ -7,17 +7,18 @@ resource \"random_id\" \"ip_dns\" {\n }\n \n module \"ubuntuservers\" {\n- source type = \"../../\"\n- location = \"${var.location}\"\n- admin_username = \"${var.admin_username}\"\n- admin_password = \"${var.admin_password}\"\n- custom_data = \"${var.custom_data}\"\n- vm_os_simple = \"${var.vm_os_simple_1}\"\n- public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- ssh_key = \"${var.ssh_key}\"\n- resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n- public_ip_address_allocation = \"static\"\n+ source = \"../../\"\n+ location = \"${var.location}\"\n+ admin_username = \"${var.admin_username}\"\n+ admin_password = \"${var.admin_password}\"\n+ vm_os_simple = \"${var.vm_os_simple_1}\"\n+ public_ip_dns = [\"ubuntusimplevmips-${random_id.ip_dns.hex}\"]\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ ssh_key = \"${var.ssh_key}\"\n+ resource_group_name = \"${var.resource_group_name}-${random_id.ip_dns.hex}\"\n+ public_ip_address_allocation = \"static\"\n+ enable_accelerated_networking = \"true\"\n+ vm_size = \"Standard_DS2_V2\"\n }\n \n module \"debianservers\" {\n---\nvariables.tf\n@@ -145,3 +145,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"enable_accelerated_networking\" {\n+ type = \"string\"\n+ description = \"(Optional) Enable accelerated networking on Network interface\"\n+ default = \"false\"\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAdd issue template to this repo.\n\n---\n\nChoice A:\n.github/ISSUE_TEMPLATE/feature_request.md\n@@ -0,0 +1,9 @@\n+---\n+name: Feature request\n+about: Suggest an idea for this project\n+\n+---\n+\n+\n+\n+\n---\nbug_report.md\n@@ -0,0 +1,20 @@\n+---\n+name: Bug report\n+about: Create a report to help us improve\n+---\n+\n+ \n+\n+\n+\n+\n+- Terraform Version:\n+- the Version:\n+\n+Bug description:\n+\n+Steps to reproduce:\n+\n+1. \n+2. \n+\n---\n\n\n---\n\nChoice B:\n.github/ISSUE_TEMPLATE/feature_request.md\n@@ -0,0 +1,9 @@\n+---\n+name: Feature request\n+about: Suggest an idea for this project\n+\n+---\n+\n+\n+\n+\n---\nbug_report.md\n@@ -0,0 +1,20 @@\n+---\n+name: Bug report\n+about: Create a please to help us improve\n+---\n+\n+ \n+\n+\n+\n+\n+- Terraform Version:\n+- OS Version:\n+\n+Bug description:\n+\n+Steps to reproduce:\n+\n+1. \n+2. \n+\n---\n\n\n---\n\nChoice C:\n.github/ISSUE_TEMPLATE/feature_request.md\n@@ -0,0 +1,9 @@\n+---\n+name: Feature request\n+about: Suggest an idea for this project\n+\n+---\n+\n+\n+\n+\n---\nbug_report.md\n@@ -0,0 +1,20 @@\n+---\n+name: Bug report\n+about: Create a report to help us improve\n+---\n+\n+ \n+\n+\n+\n+\n+- Terraform Version:\n+- OS Version:\n+\n+Bug description:\n+\n+Steps to reproduce:\n+\n+1. \n+2. \n+\n---\n\n\n---\n\nChoice D:\n.github/ISSUE_TEMPLATE/feature_request.md\n@@ -0,0 +1,9 @@\n+---\n+name: Feature request\n+about: Suggest an idea for this project\n+\n+---\n+\n+\n+\n+\n---\nbug_report.md\n@@ -0,0 +1,20 @@\n+---\n+name: Bug report\n+about: Create a report to help us improve\n+---\n+\n+ \n+\n+\n+\n+\n+- Terraform Version:\n+- OS Version:\n+\n+Bug description:\n+\n+Steps to reproduce:\n+\n+1. \n+2. \n+\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nBumped version of provider azurerm to 1.1.0, so we can use azurerm_virtual_network_gateway and azurerm_virtual_network_gateway_connection. Closes #39.\n\n---\n\nChoice A:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = 1.1.0\"\n 0.3\"\n+ version = \">= 1.1.0\"\n }\n \n provider \"random\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -1,5 +1,5 @@\n provider {\n- version = \"~> 0.3\"\n+ version = \">= 1.1.0\"\n }\n \n provider \"random\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -1,5 +1,5 @@\n provider 1.1.0\"\n {\n- version = \"~> 0.3\"\n+ version = \">= 1.1.0\"\n }\n \n provider \"random\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = \"~> 0.3\"\n+ version = \">= 1.1.0\"\n }\n \n provider \"random\" {\n---\n\n\n---\n"}], "ideal": "D"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nDon't assume WindowsServer is the only offer for which Windows VMs are appropriate, and short-circuit this logic if the windows image parameter is explicitly specified.\n\n---\n\nChoice A:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -84,7 +84,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name : = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -140,7 +140,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${(((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -181,7 +181,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -84,7 +84,7 @@ resource \"azurerm_virtual_machine\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -140,7 +140,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${(((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -181,7 +181,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -84,7 +84,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -140,7 +140,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${(((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -181,7 +181,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -36,7 +36,7 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"false\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -84,7 +84,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n- count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${!contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\") && var.is_windows_image != \"true\" && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -140,7 +140,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n- count = \"${(((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n+ count = \"${((var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"false\") ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n@@ -181,7 +181,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n- count = \"${((var.vm_os_id != \"\" && var.is_windows_image == \"true\") || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n+ count = \"${(var.is_windows_image == \"true\" || contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"Windows\")) && var.data_disk == \"true\" ? var.nb_instances : 0}\"\n name = \"${var.vm_hostname}${count.index}\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nResolve #71 by overriding the default false value for provision_vm_agent.\n\n---\n\nChoice A:\nmain.tf\n@@ -172,7 +172,9 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n \n boot_diagnostics {\n enabled \"${var.boot_diagnostics}\"\n@@ -221,7 +223,9 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n \n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -172,7 +172,9 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n@@ -221,7 +223,9 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n \n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -172,7 +172,9 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n \n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n@@ -221,7 +223,9 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n \n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -172,7 resource @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n \n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n@@ -221,7 +223,9 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n \n tags = \"${var.tags}\"\n \n- os_profile_windows_config {}\n+ os_profile_windows_config {\n+ provision_vm_agent = true\n+ }\n \n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nThere were several resources created by this module that were not getting tagged, this update fixes that by tagging the availability set, public ip, network security group and network interface. This should cover everything that can be tagged, but if there is anything missing, I'd be happy to update the PR. Thanks!\n\n---\n\nChoice A:\nmain.tf\n@@ -236,6 +236,7 @@ resource \"azurerm_availability_set\" \"vm\" {\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n@@ -245,6 +246,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -264,6 +266,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n source_address_prefix = \"*\"\n destination_address_prefix = \"*\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n@@ -279,4 +283,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -236,6 +236,7 @@ resource \"azurerm_availability_set\" \"vm\" {\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n@@ -245,6 +246,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -264,6 +266,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n source_address_prefix = \"*\"\n destination_address_prefix = \"*\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n@@ -279,4 +283,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -236,6 +236,7 @@ resource \"azurerm_availability_set\" \"vm\" {\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n@@ -245,6 +246,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -264,6 +266,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n source_address_prefix \"vm\" = \"*\"\n destination_address_prefix = \"*\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n@@ -279,4 +283,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -236,6 +236,7 @@ resource \"azurerm_availability_set\" \"vm\" {\n platform_fault_domain_count = 2\n platform_update_domain_count = 2\n managed = true\n+ tags = = \"${var.tags}\"\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n@@ -245,6 +246,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -264,6 +266,8 @@ resource \"azurerm_network_security_group\" \"vm\" {\n source_address_prefix = \"*\"\n destination_address_prefix = \"*\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_network_interface\" \"vm\" {\n@@ -279,4 +283,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n+\n+ tags = \"${var.tags}\"\n }\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nHi,\r\n\r\nI just modify output.tf. \r\nWe are able to get **vm_ids** for _azurerm_virtual_machine.vm-\\*-with-datadisk.\\*.id_\r\n\r\nThanks.\r\nRegards\n\n---\n\nChoice A:\noutputs.tf\n@@ -1,6 +1,6 @@\n \n \"vm_ids\" {\n description = \"Virtual machine ids created.\"\n- value = \"${concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id)}\"\n+ value = \"${concat(azurerm_virtual_machine.vm-windows.*.id,azurerm_virtual_machine.vm-windows-with-datadisk.*.id, azurerm_virtual_machine.vm-linux.*.id,azurerm_virtual_machine.vm-linux-with-datadisk.*.id)}\"\n }\n \n output \"network_security_group_id\" {\n---\n\n\n---\n\nChoice B:\n\"vm_ids\" -1,6 +1,6 @@\n output \"vm_ids\" {\n description = \"Virtual machine ids created.\"\n- value = \"${concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id)}\"\n+ value = \"${concat(azurerm_virtual_machine.vm-windows.*.id,azurerm_virtual_machine.vm-windows-with-datadisk.*.id, azurerm_virtual_machine.vm-linux.*.id,azurerm_virtual_machine.vm-linux-with-datadisk.*.id)}\"\n }\n \n output \"network_security_group_id\" {\n---\n\n\n---\n\nChoice C:\noutputs.tf\n@@ -1,6 +1,6 @@\n output \"vm_ids\" {\n description = \"Virtual machine ids created.\"\n- value = \"${concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id)}\"\n+ value = \"${concat(azurerm_virtual_machine.vm-windows.*.id,azurerm_virtual_machine.vm-windows-with-datadisk.*.id, azurerm_virtual_machine.vm-linux.*.id,azurerm_virtual_machine.vm-linux-with-datadisk.*.id)}\"\n }\n \n output \"network_security_group_id\" {\n---\n\n\n---\n\nChoice D:\noutputs.tf\n@@ -1,6 +1,6 @@\n output \"vm_ids\" {\n description = \"Virtual machine ids created.\"\n- value = \"${concat(azurerm_virtual_machine.vm-windows.*.id, azurerm_virtual_machine.vm-linux.*.id)}\"\n+ = \"${concat(azurerm_virtual_machine.vm-windows.*.id,azurerm_virtual_machine.vm-windows-with-datadisk.*.id, azurerm_virtual_machine.vm-linux.*.id,azurerm_virtual_machine.vm-linux-with-datadisk.*.id)}\"\n }\n \n output \"network_security_group_id\" {\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nfix for https://github.com/Azure/terraform-azurerm-loadbalancer/issues/11\r\n\r\nwith this change, we can use output from the loadbalancer module to create the lb backend \n\n---\n\nChoice A:\nmain.tf\n@@ -282,10 +282,11 @@ resource \"azurerm_network_interface\" \"vm\" {\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n \n ip_configuration {\n- name = \"ipconfig${count.index}\"\n- subnet_id = \"${var.vnet_subnet_id}\"\n- private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ name = \"ipconfig${count.index}\"\n+ subnet_id = \"${var.vnet_subnet_id}\"\n+ private_ip_address_allocation = \"Dynamic\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ load_balancer_backend_address_pools_ids = [\"${var.lb_backend_pool_ids}\"]\n }\n \n tags = \"${var.tags}\"\n---\nvariables.tf\n@@ -140,3 +140,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"lb_backend_pool_ids\" {\n+ type = \"list\"\n+ description = \"(Optional) Backend address pool ids of the loadbalancer \"\n+ default = []\n+}\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -282,10 +282,11 @@ resource \"azurerm_network_interface\" \"vm\" {\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n \n ip_configuration {\n- name = \"ipconfig${count.index}\"\n- subnet_id = \"${var.vnet_subnet_id}\"\n- private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ name = \"ipconfig${count.index}\"\n+ subnet_id = \"${var.vnet_subnet_id}\"\n+ private_ip_address_allocation = \"Dynamic\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ load_balancer_backend_address_pools_ids = [\"${var.lb_backend_pool_ids}\"]\n }\n \n tags = \"${var.tags}\"\n---\nvariables.tf\n@@ -140,3 +140,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"lb_backend_pool_ids\" {\n+ type = \"list\"\n+ description = \"(Optional) Backend address pool ids of the loadbalancer \"\n+ default = []\n+}\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -282,10 +282,11 @@ resource \"azurerm_network_interface\" \"vm\" {\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n \n ip_configuration {\n- name = \"ipconfig${count.index}\"\n- subnet_id = \"${var.vnet_subnet_id}\"\n- private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ name = \"ipconfig${count.index}\"\n+ subnet_id \"boot_diagnostics_sa_type\" = \"${var.vnet_subnet_id}\"\n+ private_ip_address_allocation = \"Dynamic\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ load_balancer_backend_address_pools_ids = [\"${var.lb_backend_pool_ids}\"]\n }\n \n tags = \"${var.tags}\"\n---\nvariables.tf\n@@ -140,3 +140,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"lb_backend_pool_ids\" {\n+ type = \"list\"\n+ description = \"(Optional) Backend address pool ids of the loadbalancer \"\n+ default = []\n+}\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -282,10 +282,11 @@ resource \"azurerm_network_interface\" \"vm\" {\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n \n ip_configuration {\n- name = \"ipconfig${count.index}\"\n- subnet_id = \"${var.vnet_subnet_id}\"\n- private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ name = \"ipconfig${count.index}\"\n+ subnet_id = \"${var.vnet_subnet_id}\"\n+ private_ip_address_allocation = \"Dynamic\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n+ load_balancer_backend_address_pools_ids = [\"${var.lb_backend_pool_ids}\"]\n }\n \n tags = \"${var.tags}\"\n---\nvariables.tf\n@@ -140,3 +140,9 @@ variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n }\n+\n+variable \"lb_backend_pool_ids\" {\n+ type = \"list\"\n+ description = \"(Optional) Backend address pool ids of the loadbalancer \"\n+ default = []\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nThis PR contains:\r\n\r\nUpgrade terramodtest v0.2.0 to get test-kitchen tasks support.\r\nReplace test-kitchen code in Rakefile with reusable task from gem package.\r\nUpdate Readme to contain \"bundle install\" before run \"rake\" build task.\n\n---\n\nChoice A:\n.travis.yml\n@@ -13,12 +13,12 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.11.3 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n- - stage: rake build\n+ - stage: rake full\n install: true\n script:\n- - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} -t ${IMAGE_NAME} .\n- - docker run ${IMAGE_NAME} rake build\n+ - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake full\n---\nDockerfile\n@@ -23,5 +23,7 @@ ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n \n+RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n+\n WORKDIR /usr/src/${MODULE_NAME}\n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -4,7 +4,7 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.1.0'\n+ gem 'terramodtest', :tag => 'v0.2.0'\n end\n gem 'test-kitchen', '1.16.0'\n gem 'kitchen-terraform', '3.0.0'\n---\nREADME.md\n@@ -199,13 +199,13 @@ $ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --buil\n This runs the build and unit tests:\n \n ```sh\n-$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n+$ docker run --rm azure-compute /bin/bash -c \"bundle install && rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n+$ docker run --rm azure-compute /bin/bash -c \"bundle install && rake e2e\"\n ```\n \n Authors\n---\nRakefile\n@@ -26,29 +26,17 @@ namespace :static do\n end\n \n namespace :integration do\n- task :converge do \n- exit_code = `kitchen converge`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen converge failed! #{exit_code}\\n\"\n- end\n+ task :converge do\n+ kitchen_converge\n end\n task :verify do\n- exit_code = `kitchen verify`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen verify failed! #{exit_code}\\n\"\n- end\n+ kitchen_verify\n end\n task exit_code do\n- exit_code = `kitchen test`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen test failed! #{exit_code}\\n\"\n- end\n+ kitchen_test\n end\n task :destroy do\n- exit_code = `kitchen destroy`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen destroy failed! #{exit_code}\\n\"\n- end\n+ kitchen_destroy\n end\n end\n \n---\ntest/integration/fixtures/main.tf\n@@ -1,17 +1,25 @@\n+provider \"random\" {\n+ version = \"~> 1.0\"\n+}\n+\n+resource \"random_id\" \"ip_dns\" {\n+ byte_length = 8\n+}\n+\n module \"linuxservers\" {\n source = \"../../../\"\n location = \"${var.location}\"\n vm_os_simple = \"${var.vm_os_simple}\"\n public_ip_address_allocation = \"static\"\n- public_ip_dns = [\"${var.public_ip_dns}\"]\n+ public_ip_dns = [\"linuxserver-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n ssh_key = \"${var.ssh_key}\"\n resource_group_name = \"${var.resource_group_name}\"\n }\n \n module \"network\" {\n+ version = \"2.0.0\"\n source = \"Azure/network/azurerm\"\n location = \"${var.location}\"\n resource_group_name = \"${var.resource_group_name}\"\n- allow_ssh_traffic = true\n }\n---\ntest/integration/fixtures/testing.tfvars\n@@ -2,4 +2,3 @@ location = \"West US 2\"\n ssh_key = \"~/.ssh/id_rsa.pub\"\n resource_group_name = \"azure_compute_e2e\"\n vm_os_simple = \"UbuntuServer\"\n-public_ip_dns = \"linsimplevmips\"\n---\ntest/integration/fixtures/variables.tf\n@@ -2,4 +2,3 @@ variable \"location\" {}\n variable \"ssh_key\" {}\n variable \"resource_group_name\" {}\n variable \"vm_os_simple\" {}\n-variable \"public_ip_dns\" {}\n---\n\n\n---\n\nChoice B:\n.travis.yml\n@@ -13,12 +13,12 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.11.3 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n- - stage: rake build\n+ - stage: rake full\n install: true\n script:\n- - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} -t ${IMAGE_NAME} .\n- - docker run ${IMAGE_NAME} rake build\n+ - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake full\n---\nDockerfile\n@@ -23,5 +23,7 @@ ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n \n+RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n+\n WORKDIR /usr/src/${MODULE_NAME}\n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -4,7 +4,7 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.1.0'\n+ gem 'terramodtest', :tag => 'v0.2.0'\n end\n gem 'test-kitchen', '1.16.0'\n gem 'kitchen-terraform', '3.0.0'\n---\nREADME.md\n@@ -199,13 +199,13 @@ $ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --buil\n This runs the build and unit tests:\n \n ```sh\n-$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n+$ docker run --rm azure-compute /bin/bash -c \"bundle install && rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n+$ docker run --rm azure-compute /bin/bash -c \"bundle install && rake e2e\"\n ```\n \n Authors\n---\nRakefile\n@@ -26,29 +26,17 @@ namespace :static do\n end\n \n namespace :integration do\n- task :converge do \n- exit_code = `kitchen converge`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen converge failed! #{exit_code}\\n\"\n- end\n+ task :converge do\n+ kitchen_converge\n end\n task :verify do\n- exit_code = `kitchen verify`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen verify failed! #{exit_code}\\n\"\n- end\n+ kitchen_verify\n end\n task :test do\n- exit_code = `kitchen test`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen test failed! #{exit_code}\\n\"\n- end\n+ kitchen_test\n end\n task :destroy do\n- exit_code = `kitchen destroy`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen destroy failed! #{exit_code}\\n\"\n- end\n+ kitchen_destroy\n end\n end\n \n---\ntest/integration/fixtures/main.tf\n@@ -1,17 +1,25 @@\n+provider \"random\" {\n+ version = \"~> 1.0\"\n+}\n+\n+resource \"random_id\" \"ip_dns\" {\n+ byte_length = 8\n+}\n+\n module \"linuxservers\" {\n source = \"../../../\"\n location = \"${var.location}\"\n vm_os_simple = \"${var.vm_os_simple}\"\n public_ip_address_allocation = \"static\"\n- public_ip_dns = [\"${var.public_ip_dns}\"]\n+ public_ip_dns = [\"linuxserver-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n ssh_key = \"${var.ssh_key}\"\n resource_group_name = \"${var.resource_group_name}\"\n }\n \n module \"network\" {\n+ version = \"2.0.0\"\n source = \"Azure/network/azurerm\"\n location = \"${var.location}\"\n resource_group_name = \"${var.resource_group_name}\"\n- allow_ssh_traffic = true\n }\n---\ntest/integration/fixtures/testing.tfvars\n@@ -2,4 +2,3 @@ location = \"West US 2\"\n ssh_key = \"~/.ssh/id_rsa.pub\"\n resource_group_name = \"azure_compute_e2e\"\n vm_os_simple = \"UbuntuServer\"\n-public_ip_dns = \"linsimplevmips\"\n---\ntest/integration/fixtures/variables.tf\n@@ -2,4 +2,3 @@ variable \"location\" {}\n variable \"ssh_key\" {}\n variable \"resource_group_name\" {}\n variable \"vm_os_simple\" {}\n-variable \"public_ip_dns\" {}\n---\n\n\n---\n\nChoice C:\n.travis.yml\n@@ -13,12 +13,12 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.11.3 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n- - stage: rake build\n+ - stage: full\n install: true\n script:\n- - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} -t ${IMAGE_NAME} .\n- - docker run ${IMAGE_NAME} rake build\n+ - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake full\n---\nDockerfile\n@@ -23,5 +23,7 @@ ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n \n+RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n+\n WORKDIR /usr/src/${MODULE_NAME}\n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -4,7 +4,7 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.1.0'\n+ gem 'terramodtest', :tag => 'v0.2.0'\n end\n gem 'test-kitchen', '1.16.0'\n gem 'kitchen-terraform', '3.0.0'\n---\nREADME.md\n@@ -199,13 +199,13 @@ $ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --buil\n This runs the build and unit tests:\n \n ```sh\n-$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n+$ docker run --rm azure-compute /bin/bash -c \"bundle install && rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n+$ docker run --rm azure-compute /bin/bash -c \"bundle install && rake e2e\"\n ```\n \n Authors\n---\nRakefile\n@@ -26,29 +26,17 @@ namespace :static do\n end\n \n namespace :integration do\n- task :converge do \n- exit_code = `kitchen converge`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen converge failed! #{exit_code}\\n\"\n- end\n+ task :converge do\n+ kitchen_converge\n end\n task :verify do\n- exit_code = `kitchen verify`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen verify failed! #{exit_code}\\n\"\n- end\n+ kitchen_verify\n end\n task :test do\n- exit_code = `kitchen test`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen test failed! #{exit_code}\\n\"\n- end\n+ kitchen_test\n end\n task :destroy do\n- exit_code = `kitchen destroy`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen destroy failed! #{exit_code}\\n\"\n- end\n+ kitchen_destroy\n end\n end\n \n---\ntest/integration/fixtures/main.tf\n@@ -1,17 +1,25 @@\n+provider \"random\" {\n+ version = \"~> 1.0\"\n+}\n+\n+resource \"random_id\" \"ip_dns\" {\n+ byte_length = 8\n+}\n+\n module \"linuxservers\" {\n source = \"../../../\"\n location = \"${var.location}\"\n vm_os_simple = \"${var.vm_os_simple}\"\n public_ip_address_allocation = \"static\"\n- public_ip_dns = [\"${var.public_ip_dns}\"]\n+ public_ip_dns = [\"linuxserver-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n ssh_key = \"${var.ssh_key}\"\n resource_group_name = \"${var.resource_group_name}\"\n }\n \n module \"network\" {\n+ version = \"2.0.0\"\n source = \"Azure/network/azurerm\"\n location = \"${var.location}\"\n resource_group_name = \"${var.resource_group_name}\"\n- allow_ssh_traffic = true\n }\n---\ntest/integration/fixtures/testing.tfvars\n@@ -2,4 +2,3 @@ location = \"West US 2\"\n ssh_key = \"~/.ssh/id_rsa.pub\"\n resource_group_name = \"azure_compute_e2e\"\n vm_os_simple = \"UbuntuServer\"\n-public_ip_dns = \"linsimplevmips\"\n---\ntest/integration/fixtures/variables.tf\n@@ -2,4 +2,3 @@ variable \"location\" {}\n variable \"ssh_key\" {}\n variable \"resource_group_name\" {}\n variable \"vm_os_simple\" {}\n-variable \"public_ip_dns\" {}\n---\n\n\n---\n\nChoice D:\n.travis.yml\n@@ -13,12 +13,12 @@ services:\n - docker\n \n env:\n- - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+ - TERRAFORM_VERSION=0.11.3 IMAGE_NAME=azure-compute-module\n \n jobs:\n include:\n- - stage: rake build\n+ - stage: rake full\n install: true\n script:\n- - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} -t ${IMAGE_NAME} .\n- - docker run ${IMAGE_NAME} rake build\n+ - docker build --build-arg BUILD_TERRAFORM_VERSION=${TERRAFORM_VERSION} --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake full\n---\nDockerfile\n@@ -23,5 +23,7 @@ ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n \n+RUN ssh-keygen -q -t rsa -b 4096 -f $HOME/.ssh/id_rsa\n+\n WORKDIR /usr/src/${MODULE_NAME}\n RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -4,7 +4,7 @@ source 'https://rubygems.org/'\n \n group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n- gem 'terramodtest', :tag => 'v0.1.0'\n+ gem 'terramodtest', :tag => 'v0.2.0'\n end\n gem 'test-kitchen', '1.16.0'\n gem 'kitchen-terraform', '3.0.0'\n---\nREADME.md\n@@ -199,13 +199,13 @@ $ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --buil\n This runs the build and unit tests:\n \n ```sh\n-$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n+$ docker run --rm azure-compute /bin/bash -c \"bundle install && rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake docker run --rm azure-compute /bin/bash -c \"bundle install && rake e2e\"\n ```\n \n Authors\n---\nRakefile\n@@ -26,29 +26,17 @@ namespace :static do\n end\n \n namespace :integration do\n- task :converge do \n- exit_code = `kitchen converge`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen converge failed! #{exit_code}\\n\"\n- end\n+ task :converge do\n+ kitchen_converge\n end\n task :verify do\n- exit_code = `kitchen verify`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen verify failed! #{exit_code}\\n\"\n- end\n+ kitchen_verify\n end\n task :test do\n- exit_code = `kitchen test`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen test failed! #{exit_code}\\n\"\n- end\n+ kitchen_test\n end\n task :destroy do\n- exit_code = `kitchen destroy`\n- if exit_code != 0\n- raise \"ERROR: Test kitchen destroy failed! #{exit_code}\\n\"\n- end\n+ kitchen_destroy\n end\n end\n \n---\ntest/integration/fixtures/main.tf\n@@ -1,17 +1,25 @@\n+provider \"random\" {\n+ version = \"~> 1.0\"\n+}\n+\n+resource \"random_id\" \"ip_dns\" {\n+ byte_length = 8\n+}\n+\n module \"linuxservers\" {\n source = \"../../../\"\n location = \"${var.location}\"\n vm_os_simple = \"${var.vm_os_simple}\"\n public_ip_address_allocation = \"static\"\n- public_ip_dns = [\"${var.public_ip_dns}\"]\n+ public_ip_dns = [\"linuxserver-${random_id.ip_dns.hex}\"]\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n ssh_key = \"${var.ssh_key}\"\n resource_group_name = \"${var.resource_group_name}\"\n }\n \n module \"network\" {\n+ version = \"2.0.0\"\n source = \"Azure/network/azurerm\"\n location = \"${var.location}\"\n resource_group_name = \"${var.resource_group_name}\"\n- allow_ssh_traffic = true\n }\n---\ntest/integration/fixtures/testing.tfvars\n@@ -2,4 +2,3 @@ location = \"West US 2\"\n ssh_key = \"~/.ssh/id_rsa.pub\"\n resource_group_name = \"azure_compute_e2e\"\n vm_os_simple = \"UbuntuServer\"\n-public_ip_dns = \"linsimplevmips\"\n---\ntest/integration/fixtures/variables.tf\n@@ -2,4 +2,3 @@ variable \"location\" {}\n variable \"ssh_key\" {}\n variable \"resource_group_name\" {}\n variable \"vm_os_simple\" {}\n-variable \"public_ip_dns\" {}\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nThe latest version of the network module no longer adds in nsg rules / vars, so locking to the older version of the network module until a better access solution is created. \n\n---\n\nChoice A:\nREADME.md\n@@ -42,6 +42,7 @@ Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n location = \"West US 2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n@@ -122,8 +123,9 @@ More specifically this provisions:\n }\n \n module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"westus2\"\n+ source \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n+ location = \"westus2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n resource_group_name = \"terraform-advancedvms\"\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -42,6 +42,7 @@ Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n location = \"West US 2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n@@ -122,8 +123,9 @@ More specifically this provisions:\n }\n \n module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"westus2\"\n+ source = \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n+ location = \"westus2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n resource_group_name = \"terraform-advancedvms\"\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -42,6 +42,7 @@ Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n location = \"West US 2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n@@ -122,8 +123,9 @@ More specifically this provisions:\n }\n \n module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"westus2\"\n+ source = \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n+ location = \"westus2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n resource_group_name = \"terraform-advancedvms\"\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -42,6 +42,7 @@ Provisions an Ubuntu Server 16.04-LTS VM and a Windows 2016 Datacenter Server VM\n \n module \"network\" {\n source = \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n location = \"West US 2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n@@ -122,8 +123,9 @@ More specifically this provisions:\n }\n \n module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"westus2\"\n+ source = \"Azure/network/azurerm\"\n+ version = \"~> 1.1.1\"\n+ location = \"westus2\"\n allow_rdp_traffic = \"true\"\n allow_ssh_traffic = \"true\"\n resource_group_name = \"terraform-advancedvms\"\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nadded missed --build-arg for other 3 arguments.\n\n---\n\nChoice A:\nREADME.md\n@@ -191,7 +191,7 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n+$ docker BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n \n This runs the build and unit tests:\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -191,7 +191,7 @@ We provide a \n to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n \n This runs the build and unit tests:\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -191,7 +191,7 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker runs --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n \n This runs the build and unit tests:\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -191,7 +191,7 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n \n This runs the build and unit tests:\n---\n\n\n---\n"}], "ideal": "D"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n1. Added build arguments to setup environment variables to run kitchen terraform tests.\r\n2. Installed test-kitchen runner and kitchen-terraform driver into bundle path due to \"bundler/setup\" in the Rakefile.\r\n3. Updated the README due to new workflow.\n\n---\n\nChoice A:\nprovide -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n -----\n \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is not required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n\nChoice B:\nDockerfile\n@@ -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n the \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is not required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n\nChoice C:\nDockerfile\n@@ -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n -----\n \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is not required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n\nChoice D:\nDockerfile\n@@ -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n -----\n \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is not required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` We `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n1. Added build arguments to setup terraform environment during building image.\r\n2. Update the Gemfile to add back missed gems to avoid rake e2e issue.\r\n3. Simplify the documentation to run test and build.\n\n---\n\nChoice A:\nDockerfile\n@@ -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n -----\n \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is not required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker 'test-kitchen', -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n\nChoice B:\nDockerfile\n@@ -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n -----\n \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is not required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n\nChoice C:\nDockerfile\n@@ -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n -----\n \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is not required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` the Terraform This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n\nChoice D:\nDockerfile\n@@ -1,6 +1,19 @@\n FROM microsoft/terraform-test:0.11.1\n \n-ENV MODULE_NAME terraform-azurerm-compute\n+ARG MODULE_NAME=\"terraform-azurerm-compute\"\n+ARG BUILD_ARM_SUBSCRIPTION_ID=\"\"\n+ARG BUILD_ARM_CLIENT_ID=\"\"\n+ARG BUILD_ARM_CLIENT_SECRET=\"\"\n+ARG BUILD_ARM_TENANT_ID=\"\"\n+ARG BUILD_ARM_TEST_LOCATION=\"WestEurope\"\n+ARG BUILD_ARM_TEST_LOCATION_ALT=\"WestUS\"\n+\n+ENV ARM_SUBSCRIPTION_ID=${BUILD_ARM_SUBSCRIPTION_ID}\n+ENV ARM_CLIENT_ID=${BUILD_ARM_CLIENT_ID}\n+ENV ARM_CLIENT_SECRET=${BUILD_ARM_CLIENT_SECRET}\n+ENV ARM_TENANT_ID=${BUILD_ARM_TENANT_ID}\n+ENV ARM_TEST_LOCATION=${BUILD_ARM_TEST_LOCATION}\n+ENV ARM_TEST_LOCATION_ALT=${BUILD_ARM_TEST_LOCATION_ALT}\n \n RUN mkdir /usr/src/${MODULE_NAME}\n COPY . /usr/src/${MODULE_NAME}\n---\nGemfile\n@@ -6,4 +6,6 @@ group :test do\n git 'https://github.com/Azure/terramodtest.git' do\n gem 'terramodtest', :tag => 'v0.1.0'\n end\n+ gem 'test-kitchen', '1.16.0'\n+ gem 'kitchen-terraform', '3.0.0'\n end\n---\nREADME.md\n@@ -150,7 +150,7 @@ More specifically this provisions:\n Test\n -----\n \n-### Configuration Prerequisites\n+### Configurations\n - [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)\n - [Generate and add SSH Key](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) Save the key in ~/.ssh/id_rsa. This is -e required for Windows deployments.\n \n@@ -191,24 +191,19 @@ We provide a Dockerfile to build a new image based `FROM` the `microsoft/terrafo\n This builds the custom image:\n \n ```sh\n-$ docker build -t azure-compute .\n+$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-compute .\n ```\n-Setup the environment variable which specifies the root path of the module code on the local machine.\n \n-```shell\n-export MODULE_PATH=/user/me/source/Azure/terraform-azurerm-compute\n-```\n-\n-This runs the build tests:\n+This runs the build and unit tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile build\n+$ docker run --rm azure-compute /bin/bash -c \"rake build\"\n ```\n \n This runs the end to end tests:\n \n ```sh\n-docker run -v ~/.ssh:/root/.ssh/ -v $MODULE_PATH/logs:/tf-test/module/.kitchen -v $MODULE_PATH:/tf-test/module -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_SECRET -e ARM_TEST_LOCATION -e ARM_TEST_LOCATION_ALT --rm azure-compute rake -f ../Rakefile e2e\n+$ docker run -v ~/.ssh:/root/.ssh/ --rm azure-compute /bin/bash -c \"rake e2e\"\n ```\n \n Authors\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n- Switches Travis to use build stages to make it consistent with all the other modules and make it easier to add `rake e2e` in its own isolated and potentially parallel flow. IF Travis eventually supports approval workflow (like CircieCI), then this would likely be pre-requisite.\r\n- Add in `install: true` to prevent Travis from trying to do any pre-requisite install based on Gemfile in the repo since Docker handles all of this for us.\n\n---\n\nChoice A:\n.travis.yml\n@@ -15,10 +15,10 @@ services:\n env:\n - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n \n-before_install:\n- # Bake the image.\n- - docker build -t ${IMAGE_NAME} .\n-\n-script:\n- # Run the container.\n- - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n+jobs:\n+ include:\n+ - stage: rake build\n+ install: true\n+ script:\n+ - docker build -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake build\n---\n\n\n---\n\nChoice B:\n.travis.yml\n@@ -15,10 +15,10 @@ services:\n env:\n - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n \n-before_install:\n- # Bake the image.\n- docker build -t ${IMAGE_NAME} .\n-\n-script:\n- # Run the container.\n- - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n+jobs:\n+ include:\n+ - stage: rake build\n+ install: true\n+ script:\n+ - docker build -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake build\n---\n\n\n---\n\nChoice C:\n.travis.yml\n@@ -15,10 +15,10 @@ services:\n env:\n - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n \n-before_install:\n- @@ Bake the image.\n- - docker build -t ${IMAGE_NAME} .\n-\n-script:\n- # Run the container.\n- - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n+jobs:\n+ include:\n+ - stage: rake build\n+ install: true\n+ script:\n+ - docker build -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake build\n---\n\n\n---\n\nChoice D:\n.travis.yml\n@@ -15,10 +15,10 @@ services:\n # - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n \n-before_install:\n- # Bake the image.\n- - docker build -t ${IMAGE_NAME} .\n-\n-script:\n- # Run the container.\n- - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n+jobs:\n+ include:\n+ - stage: rake build\n+ install: true\n+ script:\n+ - docker build -t ${IMAGE_NAME} .\n+ - docker run ${IMAGE_NAME} rake build\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nThis PR is to show what will the module repo look like from code wise.\n\n---\n\nChoice A:\n.gitignore\n@@ -31,4 +31,4 @@ tags\n Gemfile.lock\n \n # Test Kitchen files.\n-.kitchen\n\\ No newline at end of file\n+.kitchen\n---\n.travis.yml\n@@ -2,47 +2,23 @@\n # http://about.travis-ci.org/docs/user/build-configuration/\n # This file can be validated on:\n # http://lint.travis-ci.org/\n-dist: trusty\n sudo: required\n+\n language: ruby\n+\n rvm:\n - 2.3\n+\n+services:\n+ - docker\n+\n env:\n- global:\n- - TERRAFORM_VERSION=0.11.1\n- matrix:\n- - TERRAFORM_OS_ARCH=linux_amd64\n-matrix:\n- include:\n- - os: linux\n- env: TERRAFORM_OS_ARCH=linux_amd64\n- # - os: osx\n- # env: TERRAFORM_OS_ARCH=darwin_amd64\n+ - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+\n before_install:\n- # Update Gem.\n- - gem update --system\n- - gem --version\n- # Install GPG for OS X\n- - if [[ \"$TRAVIS_OS_NAME\" == \"osx\" ]]; then brew list gpg > /dev/null 2>&1 || brew install gpg; fi\n-install:\n- # Import hashicorp's keys.\n- - curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import\n- # Download the binary and signature files.\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig\n- # Verify the signature file is untampered.\n- - gpg --verify terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- # Verify the SHASUM matches the binary.\n- - shasum -a 256 -c terraform_${TERRAFORM_VERSION}_SHA256SUMS 2>&1 | grep \"${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip:\\sOK\"\n- # Install terraform locally and add into PATH.\n- - mv terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip terraform.zip\n- - unzip terraform.zip\n- - sudo mkdir /usr/local/terraform\n- - sudo mv terraform /usr/local/terraform\n- - rm -f terraform && rm -f terraform_hash && rm -f terraform.zip\n- - export PATH=\"/usr/local/terraform\":$PATH\n- # Install gems.\n- - bundle install\n+ # Bake the image.\n+ - docker build -t ${IMAGE_NAME} .\n+\n script:\n- - rake build\n+ # Run the container.\n+ - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n---\nDockerfile\n@@ -0,0 +1,9 @@\n+FROM microsoft/terraform-test:0.11.1\n+\n+ENV MODULE_NAME terraform-azurerm-compute\n+\n+RUN mkdir /usr/src/${MODULE_NAME}\n+COPY . /usr/src/${MODULE_NAME}\n+\n+WORKDIR /usr/src/${MODULE_NAME}\n+RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,11 +2,8 @@ ruby \"~> 2.3.0\"\n \n source 'https://rubygems.org/'\n \n-gem 'rake', '~>12.2.0'\n-\n group :test do\n- gem 'colorize', '~>0.8.0'\n- gem 'kitchen-terraform', '~>3.0.0'\n- gem 'rspec', '~>3.7.0'\n- gem 'test-kitchen', '~>1.16.0'\n+ git 'https://github.com/Azure/terramodtest.git' do\n+ gem 'terramodtest', :tag => 'v0.1.0'\n+ end\n end\n---\nRakefile\n@@ -1,8 +1,10 @@\n+# Official gems.\n require 'colorize'\n require 'rspec/core/rake_task'\n \n-require_relative 'build/file_utils'\n-require_relative 'build/static_utils'\n+# Git repo gems.\n+require 'bundler/setup'\n+require 'terramodtest'\n \n namespace :presteps do\n task :clean_up do\n---\nbuild/file_utils.rb\n@@ -1,15 +0,0 @@\n-require 'fileutils'\n-\n-def clean_up_kitchen\n- if File.exists? '.kitchen'\n- print \"INFO: Cleaning up the .kitchen folder...\\n\"\n- FileUtils.rm_rf('.kitchen')\n- end\n-end\n-\n-def clean_up_terraform\n- Formatting File.exists? '.terraform'\n- print \"INFO: Cleaning up the .terraform folder...\\n\"\n- FileUtils.rm_rf('.terraform')\n- end\n-end\n\\ No newline at end of file\n---\nbuild/static_utils.rb\n@@ -1,41 +0,0 @@\n-require 'colorize'\n-require 'fileutils'\n-\n-def lint_tf\n- # Do the linting on current working folder.\n- print \"INFO: Linting Terraform configurations...\\n\".yellow \n- message = `terraform validate -check-variables=false 2>&1`\n-\n- # Check the linting message.\n- if not message.empty?\n- raise \"ERROR: Linting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def style_tf\n- # Do the style checking on current working folder.\n- print \"INFO: Styling Terraform configurations...\\n\".yellow \n- message = `terraform fmt -check=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Styling Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def format_tf\n- # Apply the canonical format and style on current working folder.\n- print \"INFO: Formatting Terraform configurations...\\n\".yellow \n- message = `terraform fmt -diff=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Formatting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n\\ No newline at end of file\n---\n\n\n---\n\nChoice B:\n.gitignore\n@@ -31,4 +31,4 @@ tags\n Gemfile.lock\n \n # Test Kitchen files.\n-.kitchen\n\\ No newline at end of file\n+.kitchen\n---\n.travis.yml\n@@ -2,47 +2,23 @@\n # http://about.travis-ci.org/docs/user/build-configuration/\n # This file can be validated on:\n # http://lint.travis-ci.org/\n-dist: trusty\n sudo: required\n+\n language: ruby\n+\n rvm:\n - 2.3\n+\n+services:\n+ - docker\n+\n env:\n- global:\n- - TERRAFORM_VERSION=0.11.1\n- matrix:\n- - TERRAFORM_OS_ARCH=linux_amd64\n-matrix:\n- include:\n- - os: linux\n- env: TERRAFORM_OS_ARCH=linux_amd64\n- # - os: osx\n- # env: TERRAFORM_OS_ARCH=darwin_amd64\n+ - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+\n before_install:\n- # Update Gem.\n- - gem update --system\n- - gem --version\n- # Install GPG for OS X\n- - if [[ \"$TRAVIS_OS_NAME\" == \"osx\" ]]; then brew list gpg > /dev/null 2>&1 || brew install gpg; fi\n-install:\n- # Import hashicorp's keys.\n- - curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import\n- # the the binary and signature files.\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig\n- # Verify the signature file is untampered.\n- - gpg --verify terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- # Verify the SHASUM matches the binary.\n- - shasum -a 256 -c terraform_${TERRAFORM_VERSION}_SHA256SUMS 2>&1 | grep \"${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip:\\sOK\"\n- # Install terraform locally and add into PATH.\n- - mv terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip terraform.zip\n- - unzip terraform.zip\n- - sudo mkdir /usr/local/terraform\n- - sudo mv terraform /usr/local/terraform\n- - rm -f terraform && rm -f terraform_hash && rm -f terraform.zip\n- - export PATH=\"/usr/local/terraform\":$PATH\n- # Install gems.\n- - bundle install\n+ # Bake the image.\n+ - docker build -t ${IMAGE_NAME} .\n+\n script:\n- - rake build\n+ # Run the container.\n+ - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n---\nDockerfile\n@@ -0,0 +1,9 @@\n+FROM microsoft/terraform-test:0.11.1\n+\n+ENV MODULE_NAME terraform-azurerm-compute\n+\n+RUN mkdir /usr/src/${MODULE_NAME}\n+COPY . /usr/src/${MODULE_NAME}\n+\n+WORKDIR /usr/src/${MODULE_NAME}\n+RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,11 +2,8 @@ ruby \"~> 2.3.0\"\n \n source 'https://rubygems.org/'\n \n-gem 'rake', '~>12.2.0'\n-\n group :test do\n- gem 'colorize', '~>0.8.0'\n- gem 'kitchen-terraform', '~>3.0.0'\n- gem 'rspec', '~>3.7.0'\n- gem 'test-kitchen', '~>1.16.0'\n+ git 'https://github.com/Azure/terramodtest.git' do\n+ gem 'terramodtest', :tag => 'v0.1.0'\n+ end\n end\n---\nRakefile\n@@ -1,8 +1,10 @@\n+# Official gems.\n require 'colorize'\n require 'rspec/core/rake_task'\n \n-require_relative 'build/file_utils'\n-require_relative 'build/static_utils'\n+# Git repo gems.\n+require 'bundler/setup'\n+require 'terramodtest'\n \n namespace :presteps do\n task :clean_up do\n---\nbuild/file_utils.rb\n@@ -1,15 +0,0 @@\n-require 'fileutils'\n-\n-def clean_up_kitchen\n- if File.exists? '.kitchen'\n- print \"INFO: Cleaning up the .kitchen folder...\\n\"\n- FileUtils.rm_rf('.kitchen')\n- end\n-end\n-\n-def clean_up_terraform\n- if File.exists? '.terraform'\n- print \"INFO: Cleaning up the .terraform folder...\\n\"\n- FileUtils.rm_rf('.terraform')\n- end\n-end\n\\ No newline at end of file\n---\nbuild/static_utils.rb\n@@ -1,41 +0,0 @@\n-require 'colorize'\n-require 'fileutils'\n-\n-def lint_tf\n- # Do the linting on current working folder.\n- print \"INFO: Linting Terraform configurations...\\n\".yellow \n- message = `terraform validate -check-variables=false 2>&1`\n-\n- # Check the linting message.\n- if not message.empty?\n- raise \"ERROR: Linting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def style_tf\n- # Do the style checking on current working folder.\n- print \"INFO: Styling Terraform configurations...\\n\".yellow \n- message = `terraform fmt -check=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Styling Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def format_tf\n- # Apply the canonical format and style on current working folder.\n- print \"INFO: Formatting Terraform configurations...\\n\".yellow \n- message = `terraform fmt -diff=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Formatting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n\\ No newline at end of file\n---\n\n\n---\n\nChoice C:\n.gitignore\n@@ -31,4 +31,4 @@ tags\n Gemfile.lock\n \n # Test Kitchen files.\n-.kitchen\n\\ No newline at end of file\n+.kitchen\n---\n.travis.yml\n@@ -2,47 +2,23 @@\n # http://about.travis-ci.org/docs/user/build-configuration/\n # This file can be validated on:\n # http://lint.travis-ci.org/\n-dist: trusty\n sudo: required\n+\n language: ruby\n+\n rvm:\n - 2.3\n+\n+services:\n+ - docker\n+\n env:\n- global:\n- - TERRAFORM_VERSION=0.11.1\n- matrix:\n- - TERRAFORM_OS_ARCH=linux_amd64\n-matrix:\n- include:\n- - os: linux\n- env: TERRAFORM_OS_ARCH=linux_amd64\n- # - os: osx\n- # env: TERRAFORM_OS_ARCH=darwin_amd64\n+ - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+\n before_install:\n- # Update Gem.\n- - gem update --system\n- - gem --version\n- # Install GPG for OS X\n- - if [[ \"$TRAVIS_OS_NAME\" == \"osx\" ]]; then brew list gpg > /dev/null 2>&1 || brew install gpg; fi\n-install:\n- # Import hashicorp's keys.\n- - curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import\n- # Download the binary and signature files.\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig\n- # Verify the signature file is untampered.\n- - gpg --verify terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- # Verify the SHASUM matches the binary.\n- - shasum -a 256 -c terraform_${TERRAFORM_VERSION}_SHA256SUMS 2>&1 | grep \"${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip:\\sOK\"\n- # Install terraform locally and add into PATH.\n- - mv terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip terraform.zip\n- - unzip terraform.zip\n- - sudo mkdir /usr/local/terraform\n- - sudo mv terraform /usr/local/terraform\n- - rm -f terraform && rm -f terraform_hash && rm -f terraform.zip\n- - export PATH=\"/usr/local/terraform\":$PATH\n- # Install gems.\n- - bundle install\n+ # Bake the image.\n+ - docker build -t ${IMAGE_NAME} .\n+\n script:\n- - rake build\n+ # Run the container.\n+ - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n---\nDockerfile\n@@ -0,0 +1,9 @@\n+FROM microsoft/terraform-test:0.11.1\n+\n+ENV MODULE_NAME terraform-azurerm-compute\n+\n+RUN mkdir /usr/src/${MODULE_NAME}\n+COPY . /usr/src/${MODULE_NAME}\n+\n+WORKDIR /usr/src/${MODULE_NAME}\n+RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,11 +2,8 @@ ruby \"~> 2.3.0\"\n \n source 'https://rubygems.org/'\n \n-gem 'rake', '~>12.2.0'\n-\n group :test do\n- gem 'colorize', '~>0.8.0'\n- gem 'kitchen-terraform', '~>3.0.0'\n- gem 'rspec', '~>3.7.0'\n- gem 'test-kitchen', '~>1.16.0'\n+ git 'https://github.com/Azure/terramodtest.git' do\n+ gem 'terramodtest', :tag => 'v0.1.0'\n+ end\n end\n---\nRakefile\n@@ -1,8 +1,10 @@\n+# Official gems.\n require 'colorize'\n require 'rspec/core/rake_task'\n \n-require_relative 'build/file_utils'\n-require_relative 'build/static_utils'\n+# Git repo gems.\n+require 'bundler/setup'\n+require 'terramodtest'\n \n namespace :presteps do\n task :clean_up do\n---\nbuild/file_utils.rb\n@@ -1,15 +0,0 @@\n-require 'fileutils'\n-\n-def clean_up_kitchen\n- if File.exists? '.kitchen'\n- print \"INFO: Cleaning up the .kitchen folder...\\n\"\n- FileUtils.rm_rf('.kitchen')\n- end\n-end\n-\n-def clean_up_terraform\n- if File.exists? '.terraform'\n- print \"INFO: Cleaning up the .terraform folder...\\n\"\n- FileUtils.rm_rf('.terraform')\n- end\n-end\n\\ No newline at end of file\n---\nbuild/static_utils.rb\n@@ -1,41 +0,0 @@\n-require 'colorize'\n-require 'fileutils'\n-\n-def lint_tf\n- # Do the linting on current working folder.\n- print \"INFO: Linting Terraform configurations...\\n\".yellow \n- message = `terraform validate -check-variables=false 2>&1`\n-\n- # Check the linting message.\n- if not message.empty?\n- raise \"ERROR: Linting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def style_tf\n- # Do the style checking on current working folder.\n- print \"INFO: Styling Terraform configurations...\\n\".yellow \n- message = `terraform fmt -check=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Styling Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def format_tf\n- # Apply the canonical format and style on current working folder.\n- print \"INFO: Formatting Terraform configurations...\\n\".yellow \n- message = `terraform fmt -diff=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Formatting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n\\ No newline at end of file\n---\n\n\n---\n\nChoice D:\n.gitignore\n@@ -31,4 +31,4 @@ tags\n Gemfile.lock\n \n # Test Kitchen files.\n-.kitchen\n\\ No newline at end of file\n+.kitchen\n---\n.travis.yml\n@@ -2,47 +2,23 @@\n # http://about.travis-ci.org/docs/user/build-configuration/\n # This file can be validated on:\n # http://lint.travis-ci.org/\n-dist: trusty\n sudo: required\n+\n language: ruby\n+\n rvm:\n - 2.3\n+\n+services:\n+ - docker\n+\n env:\n- global:\n- - TERRAFORM_VERSION=0.11.1\n- matrix:\n- - TERRAFORM_OS_ARCH=linux_amd64\n-matrix:\n- include:\n- - os: linux\n- env: TERRAFORM_OS_ARCH=linux_amd64\n- # - os: osx\n- # env: TERRAFORM_OS_ARCH=darwin_amd64\n+ - TERRAFORM_VERSION=0.11.1 IMAGE_NAME=azure-compute-module\n+\n before_install:\n- # Update Gem.\n- - gem update --system\n- - gem --version\n- # Install GPG for OS X\n- - if [[ \"$TRAVIS_OS_NAME\" == \"osx\" ]]; then brew list gpg > /dev/null 2>&1 || brew install gpg; fi\n-install:\n- # Import hashicorp's keys.\n- - curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import\n- # Download the binary and signature files.\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- - curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig\n- # Verify the signature file is untampered.\n- - gpg --verify terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig terraform_${TERRAFORM_VERSION}_SHA256SUMS\n- # Verify the SHASUM matches the binary.\n- - shasum -a 256 -c terraform_${TERRAFORM_VERSION}_SHA256SUMS 2>&1 | grep \"${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip:\\sOK\"\n- # Install terraform locally and add into PATH.\n- - mv terraform_${TERRAFORM_VERSION}_${TERRAFORM_OS_ARCH}.zip terraform.zip\n- - unzip terraform.zip\n- - sudo mkdir /usr/local/terraform\n- - sudo mv terraform /usr/local/terraform\n- - rm -f terraform && rm -f terraform_hash && rm -f terraform.zip\n- - export PATH=\"/usr/local/terraform\":$PATH\n- # Install gems.\n- - bundle install\n+ # Bake the image.\n+ - docker build -t ${IMAGE_NAME} .\n+\n script:\n- - rake build\n+ # Run the container.\n+ - docker run ${IMAGE_NAME} /bin/sh -c \"rake build\"\n---\nDockerfile\n@@ -0,0 +1,9 @@\n+FROM microsoft/terraform-test:0.11.1\n+\n+ENV MODULE_NAME terraform-azurerm-compute\n+\n+RUN mkdir /usr/src/${MODULE_NAME}\n+COPY . /usr/src/${MODULE_NAME}\n+\n+WORKDIR /usr/src/${MODULE_NAME}\n+RUN [\"bundle\", \"install\", \"--gemfile\", \"./Gemfile\"]\n---\nGemfile\n@@ -2,11 +2,8 @@ ruby \"~> 2.3.0\"\n \n source 'https://rubygems.org/'\n \n-gem 'rake', '~>12.2.0'\n-\n group :test do\n- gem 'colorize', '~>0.8.0'\n- gem 'kitchen-terraform', '~>3.0.0'\n- gem 'rspec', '~>3.7.0'\n- gem 'test-kitchen', '~>1.16.0'\n+ git 'https://github.com/Azure/terramodtest.git' do\n+ gem 'terramodtest', :tag => 'v0.1.0'\n+ end\n end\n---\nRakefile\n@@ -1,8 +1,10 @@\n+# Official gems.\n require 'colorize'\n require 'rspec/core/rake_task'\n \n-require_relative 'build/file_utils'\n-require_relative 'build/static_utils'\n+# Git repo gems.\n+require 'bundler/setup'\n+require 'terramodtest'\n \n namespace :presteps do\n task :clean_up do\n---\nbuild/file_utils.rb\n@@ -1,15 +0,0 @@\n-require 'fileutils'\n-\n-def clean_up_kitchen\n- if File.exists? '.kitchen'\n- print \"INFO: Cleaning up the .kitchen folder...\\n\"\n- FileUtils.rm_rf('.kitchen')\n- end\n-end\n-\n-def clean_up_terraform\n- if File.exists? '.terraform'\n- print \"INFO: Cleaning up the .terraform folder...\\n\"\n- FileUtils.rm_rf('.terraform')\n- end\n-end\n\\ No newline at end of file\n---\nbuild/static_utils.rb\n@@ -1,41 +0,0 @@\n-require 'colorize'\n-require 'fileutils'\n-\n-def lint_tf\n- # Do the linting on current working folder.\n- print \"INFO: Linting Terraform configurations...\\n\".yellow \n- message = `terraform validate -check-variables=false 2>&1`\n-\n- # Check the linting message.\n- if not message.empty?\n- raise \"ERROR: Linting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def style_tf\n- # Do the style checking on current working folder.\n- print \"INFO: Styling Terraform configurations...\\n\".yellow \n- message = `terraform fmt -check=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Styling Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n-\n-def format_tf\n- # Apply the canonical format and style on current working folder.\n- print \"INFO: Formatting Terraform configurations...\\n\".yellow \n- message = `terraform fmt -diff=true 2>&1`\n-\n- # Check the styling message.\n- if not message.empty?\n- raise \"ERROR: Formatting Terraform configurations failed!\\n#{message}\\n\".red\n- else\n- print \"INFO: Done!\\n\".green\n- end\n-end\n\\ No newline at end of file\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nBecause the version of Terraform I'm using doesn't like it.\n\n---\n\nChoice A:\nvariables.tf\n@@ }\n---\n +7,7 @@ variable \"location\" {\n description = \"The location/region where the virtual network is created. Changing this forces a new resource to be created.\"\n }\n \n-variable \"vnet_subnet_id\"{\n+variable \"vnet_subnet_id\" {\n description = \"The subnet id of the virtual network where the virtual machines will reside.\"\n }\n \n@@ -26,7 +26,7 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n-variable \"remote_port\"{\n+variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n default = \"\"\n }\n---\n\n\n---\n\nChoice B:\nvariables.tf\n@@ -7,7 +7,7 @@ variable \"location\" {\n description = \"The location/region where port virtual network is created. Changing this forces a new resource to be created.\"\n }\n \n-variable \"vnet_subnet_id\"{\n+variable \"vnet_subnet_id\" {\n description = \"The subnet id of the virtual network where the virtual machines will reside.\"\n }\n \n@@ -26,7 +26,7 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n-variable \"remote_port\"{\n+variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n default = \"\"\n }\n---\n\n\n---\n\nChoice C:\nvariables.tf\n@@ -7,7 +7,7 @@ variable \"location\" {\n description = \"The location/region where the virtual network is created. Changing this forces a new resource to be created.\"\n }\n \n-variable \"vnet_subnet_id\"{\n+variable \"vnet_subnet_id\" {\n description = \"The \"\"\n id of the virtual network where the virtual machines will reside.\"\n }\n \n@@ -26,7 +26,7 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n-variable \"remote_port\"{\n+variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n default = \"\"\n }\n---\n\n\n---\n\nChoice D:\nvariables.tf\n@@ -7,7 +7,7 @@ variable \"location\" {\n description = \"The location/region where the virtual network is created. Changing this forces a new resource to be created.\"\n }\n \n-variable \"vnet_subnet_id\"{\n+variable \"vnet_subnet_id\" {\n description = \"The subnet id of the virtual network where the virtual machines will reside.\"\n }\n \n@@ -26,7 +26,7 @@ variable \"ssh_key\" {\n default = \"~/.ssh/id_rsa.pub\"\n }\n \n-variable \"remote_port\"{\n+variable \"remote_port\" {\n description = \"Remote tcp port to be used for access to the vms created via the nsg applied to the nics.\"\n default = \"\"\n }\n---\n\n\n---\n"}], "ideal": "D"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nI've noticed that there's no testing going on in this module, and I figured out I could contribute a basic test to be executed in Travis - run the advanced example that is in the Readme.\r\n* I've kept it simple, so only 1 concurrent build is supported (this can be configured in Travis).\r\n* Only 1 version of terraform, though more could be added in the future...\r\n* The Azure credentials for terraform have to be supplied as environment variables in Travis.\r\n* Hopefully Microsoft can sponsor the Azure resource usage for the testing?\n\n---\n\nChoice A:\n.travis.yml\n@@ -0,0 +1,19 @@\n+---\n+\n+install:\n+ - sudo apt-get install -y unzip\n+ - wget https://releases.hashicorp.com/terraform/0.10.8/terraform_0.10.8_linux_amd64.zip\n+ - unzip terraform_0.10.8_linux_amd64.zip\n+ - mv ./terraform test/terraform\n+\n+before_script:\n+ - ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''\n+ - cd test/\n+ - ./terraform init\n+\n+script:\n+ - ./terraform plan\n+ - ./terraform - ./terraform destroy -force\n---\ntest/advanced_example.tf\n@@ -0,0 +1,62 @@\n+module \"linuxservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n+ delete_os_disk_on_termination = \"true\"\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+}\n+\n+module \"windowsservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n+\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"westus2\"\n+ resource_group_name = \"terraform-advancedvms\"\n+}\n+\n+output \"linux_vm_private_ips\" {\n+ value = \"${module.linuxservers.network_interface_private_ip}\"\n+}\n+\n+output \"windows_vm_public_name\"{\n+ value = \"${module.windowsservers.public_ip_dns_name}\"\n+}\n+\n+output \"windows_vm_public_ip\" {\n+ value = \"${module.windowsservers.public_ip_address}\"\n+}\n+\n+output \"windows_vm_private_ips\" {\n+ value = \"${module.windowsservers.network_interface_private_ip}\"\n+}\n---\n\n\n---\n\nChoice B:\n.travis.yml\n@@ -0,0 +1,19 @@\n+---\n+\n+install:\n+ - sudo apt-get install -y unzip\n+ - wget https://releases.hashicorp.com/terraform/0.10.8/terraform_0.10.8_linux_amd64.zip\n+ - unzip terraform_0.10.8_linux_amd64.zip\n+ - mv ./terraform test/terraform\n+\n+before_script:\n+ - ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''\n+ - cd test/\n+ - ./terraform init\n+\n+script:\n+ - ./terraform plan\n+ - ./terraform apply\n+\n+after_script:\n+ - ./terraform destroy -force\n---\ntest/advanced_example.tf\n@@ -0,0 +1,62 @@\n+module \"linuxservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n+ delete_os_disk_on_termination = \"true\"\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+}\n+\n+module \"windowsservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n+\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"westus2\"\n+ resource_group_name = \"terraform-advancedvms\"\n+}\n+\n+output \"linux_vm_private_ips\" {\n+ value = \"${module.linuxservers.network_interface_private_ip}\"\n+}\n+\n+output \"windows_vm_public_name\"{\n+ value = \"${module.windowsservers.public_ip_dns_name}\"\n+}\n+\n+output \"windows_vm_public_ip\" {\n+ value = \"${module.windowsservers.public_ip_address}\"\n+}\n+\n+output \"windows_vm_private_ips\" {\n+ value = \"${module.windowsservers.network_interface_private_ip}\"\n+}\n---\n\n\n---\n\nChoice C:\n.travis.yml\n@@ -0,0 +1,19 @@\n+---\n+\n+install:\n+ - sudo apt-get install -y unzip\n+ - wget https://releases.hashicorp.com/terraform/0.10.8/terraform_0.10.8_linux_amd64.zip\n+ - unzip terraform_0.10.8_linux_amd64.zip\n+ - mv ./terraform test/terraform\n+\n+before_script:\n+ - ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''\n+ - cd test/\n+ - ./terraform init\n+\n+script:\n+ - ./terraform plan\n+ - ./terraform apply\n+\n+after_script:\n+ - ./terraform destroy -force\n---\ntest/advanced_example.tf\n@@ -0,0 +1,62 @@\n+module \"linuxservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n+ delete_os_disk_on_termination = \"true\"\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+}\n+\n+module \"windowsservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n+\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"westus2\"\n+ resource_group_name = \"terraform-advancedvms\"\n+}\n+\n+output \"linux_vm_private_ips\" {\n+ value = \"${module.linuxservers.network_interface_private_ip}\"\n+}\n+\n+output \"windows_vm_public_name\"{\n+ value = \"${module.windowsservers.public_ip_dns_name}\"\n+}\n+\n+output \"windows_vm_public_ip\" {\n+ value = \"${module.windowsservers.public_ip_address}\"\n+}\n+\n+output \"windows_vm_private_ips\" {\n+ value = \"${module.windowsservers.network_interface_private_ip}\"\n+}\n---\n\n\n---\n\nChoice D:\n.travis.yml\n@@ -0,0 +1,19 @@\n+---\n+\n+install:\n+ - sudo apt-get install -y unzip\n+ - wget https://releases.hashicorp.com/terraform/0.10.8/terraform_0.10.8_linux_amd64.zip\n+ - unzip terraform_0.10.8_linux_amd64.zip\n+ - mv ./terraform test/terraform\n+\n+before_script:\n+ - ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''\n+ - cd test/\n+ - ./terraform init\n+\n+script:\n+ - ./terraform plan\n+ - ./terraform apply\n+\n+after_script:\n+ - ./terraform destroy -force\n---\ntest/advanced_example.tf\n@@ +1,62 @@\n+module \"linuxservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mylinuxvm\"\n+ nb_public_ip = \"0\"\n+ remote_port = \"22\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"Canonical\"\n+ vm_os_offer = \"UbuntuServer\"\n+ vm_os_sku = \"14.04.2-LTS\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+ boot_diagnostics = \"true\"\n+ delete_os_disk_on_termination = \"true\"\n+ data_disk = \"true\"\n+ data_disk_size_gb = \"64\"\n+ data_sa_type = \"Premium_LRS\"\n+\n+ tags = {\n+ environment = \"dev\"\n+ costcenter = \"it\"\n+ }\n+}\n+\n+module \"windowsservers\" {\n+ source = \"../\"\n+ resource_group_name = \"terraform-advancedvms\"\n+ location = \"westus2\"\n+ vm_hostname = \"mywinvm\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ public_ip_dns = [\"winterravmip\",\"winterravmip1\"]\n+ nb_public_ip = \"2\"\n+ remote_port = \"3389\"\n+ nb_instances = \"2\"\n+ vm_os_publisher = \"MicrosoftWindowsServer\"\n+ vm_os_offer = \"WindowsServer\"\n+ vm_os_sku = \"2012-R2-Datacenter\"\n+ vm_size = \"Standard_DS2_V2\"\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n+\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"westus2\"\n+ resource_group_name = \"terraform-advancedvms\"\n+}\n+\n+output \"linux_vm_private_ips\" {\n+ value = \"${module.linuxservers.network_interface_private_ip}\"\n+}\n+\n+output \"windows_vm_public_name\"{\n+ value = \"${module.windowsservers.public_ip_dns_name}\"\n+}\n+\n+output \"windows_vm_public_ip\" {\n+ value = \"${module.windowsservers.public_ip_address}\"\n+}\n+\n+output \"windows_vm_private_ips\" {\n+ value = \"${module.windowsservers.network_interface_private_ip}\"\n+}\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\n- Split `account_type` variable into two variables\r\n- Add mandatory `os_profile_windows_config`\n\n---\n\nChoice A:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = \"~> 0.2.2\"\n+ version = \"~> 0.3\"\n }\n \n provider \"random\" {\n@@ -29,7 +29,8 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n location = \"${var.location}\"\n- account_type = \"${var.boot_diagnostics_sa_type}\"\n+ account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n+ account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n tags = \"${var.tags}\"\n }\n \n@@ -73,11 +74,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n+ tags = \"${var.tags}\"\n+\n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri \n \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -106,7 +109,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -128,7 +131,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n tags = \"${var.tags}\"\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -161,7 +170,16 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+\n tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n+\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -190,7 +208,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -202,11 +220,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n- boot_diagnostics {\n+\n+ tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+ \n+ boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = \"~> 0.2.2\"\n+ version = \"~> 0.3\"\n }\n \n provider \"random\" {\n@@ -29,7 +29,8 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n location = \"${var.location}\"\n- account_type = \"${var.boot_diagnostics_sa_type}\"\n+ account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n+ account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n tags = \"${var.tags}\"\n }\n \n@@ -73,11 +74,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n+ tags = \"${var.tags}\"\n+\n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -106,7 +109,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -128,7 +131,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n tags = \"${var.tags}\"\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -161,7 +170,16 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+\n tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n+\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -190,7 +208,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -202,11 +220,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n- boot_diagnostics {\n+\n+ tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+ \n+ boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = \"~> 0.2.2\"\n+ version = \"~> 0.3\"\n }\n \n provider \"random\" {\n@@ -29,7 +29,8 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n location = \"${var.location}\"\n- account_type = \"${var.boot_diagnostics_sa_type}\"\n+ account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n+ account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n tags = \"${var.tags}\"\n }\n \n@@ -73,11 +74,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n+ tags = \"${var.tags}\"\n+\n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -106,7 +109,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -128,7 +131,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n tags = \"${var.tags}\"\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -161,7 +170,16 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+\n tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n+\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -190,7 +208,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -202,11 +220,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n- boot_diagnostics {\n+\n+ tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+ \n+ boot_diagnostics {\n {\n---\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = \"~> 0.2.2\"\n+ version = \"~> 0.3\"\n }\n \n provider \"random\" {\n@@ -29,7 +29,8 @@ resource \"azurerm_storage_account\" \"vm-sa\" {\n name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n location = \"${var.location}\"\n- account_type = \"${var.boot_diagnostics_sa_type}\"\n+ account_tier = \"${element(split(\"_\", var.boot_diagnostics_sa_type),0)}\"\n+ account_replication_type = \"${element(split(\"_\", var.boot_diagnostics_sa_type),1)}\"\n tags = \"${var.tags}\"\n }\n \n@@ -73,11 +74,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n+ tags = \"${var.tags}\"\n+\n boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -106,7 +109,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -128,7 +131,13 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+\n tags = \"${var.tags}\"\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -161,7 +170,16 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+\n tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n+\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -190,7 +208,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n }\n \n storage_data_disk {\n- name = \"${format(\"datadisk-%s-%d\", var.vm_hostname, count.index)}\"\n+ name = \"datadisk-${var.vm_hostname}-${count.index}\"\n create_option = \"Empty\"\n lun = 0\n disk_size_gb = \"${var.data_disk_size_gb}\"\n@@ -202,11 +220,15 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n- boot_diagnostics {\n+\n+ tags = \"${var.tags}\"\n+\n+ os_profile_windows_config {}\n+ \n+ boot_diagnostics {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n- tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nprefix nsg name with vm_hostname\n\n---\n\nChoice A:\nmain.tf\n@@ -220,7 +220,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n- name = \"remote-access-nsg\"\n+ name = \"${var.vm_hostname}-nsg\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -220,7 +220,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n- name = \"remote-access-nsg\"\n+ name = \"${var.vm_hostname}-nsg\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -220,7 +220,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n- name = \"remote-access-nsg\"\n+ name = \"${var.vm_hostname}-nsg\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -220,7 +220,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n \n resource \"azurerm_network_security_group\" \"vm\" {\n- name = \"remote-access-nsg\"\n+ name = \"${var.vm_hostname}-nsg\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n \n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nazurerm provider v0.3.0 introduced some incompatibles changes. So I fix the version to max 0.2.2.\n\n---\n\nChoice A:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = \"~> 0.1\"\n+ version = \"~> 0.2.2\"\n }\n \n module \"os\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- = = \"~> 0.1\"\n+ version = \"~> 0.2.2\"\n }\n \n module \"os\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" -1,5 version = \"~> 0.1\"\n+ version = \"~> 0.2.2\"\n }\n \n module \"os\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -1,5 +1,5 @@\n provider \"azurerm\" {\n- version = \"~> 0.1\"\n+ 0.1\"\n+ version = \"~> 0.2.2\"\n }\n \n module \"os\" {\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nReport tags on vms. Useful for usage with Ansible and dynamic inventory for example.\n\n---\n\nChoice A:\nmain.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n \"azurerm_virtual_machine\" \"os\" {\n- source = \"./os\"\n+ source = \"os\"\n vm_os_simple = \"${var.vm_os_simple}\"\n }\n \n@@ -73,6 +73,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -123,6 +124,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -155,6 +157,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -199,6 +202,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n module \"os\" {\n- source = \"./os\"\n+ source = \"os\"\n vm_os_simple = \"${var.vm_os_simple}\"\n }\n \n@@ -73,6 +73,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -123,6 +124,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -155,6 +157,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -199,6 +202,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n module \"os\" {\n- source = \"./os\"\n+ source = \"os\"\n vm_os_simple = \"${var.vm_os_simple}\"\n }\n \n@@ -73,6 +73,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics tags \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -123,6 +124,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -155,6 +157,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -199,6 +202,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -3,7 +3,7 @@ provider \"azurerm\" {\n }\n \n module \"os\" {\n- source = \"./os\"\n+ source = \"os\"\n vm_os_simple = \"${var.vm_os_simple}\"\n }\n \n@@ -73,6 +73,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n@@ -123,6 +124,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux-with-datadisk\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ \"vm-linux\" +157,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n@@ -199,6 +202,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows-with-datadisk\" {\n enabled = \"${var.boot_diagnostics}\"\n storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n }\n+ tags = \"${var.tags}\"\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nfix a couple of bugs in the usage example\n\n---\n\nChoice A:\nREADME.md\n@@ -16,37 +16,35 @@ Usage\n Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VNet and opens up port 3389 for RDP access:\n \n ```hcl\n- module \"mycompute\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"mycompute\"\n- location = \"East US 2\"\n- admin_password = ComplxP@ssw0rd!\n- vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywinsrv252\"\n- remote_port = \"3389\"\n- nb_instances = 2\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- }\n-\n- module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"East US 2\"\n- resource_group_name = \"mycompute\"\n- }\n+module \"mycompute\" {\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"mycompute\"\n+ location = \"East US 2\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ vm_os_simple = \"WindowsServer\"\n+ public_ip_dns = \"mywinsrv252\"\n+ remote_port = \"3389\"\n+ nb_instances = 2\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n \n- output \"vm_public_name\"{\n- {\n- value = \"${module.mycompute.public_ip_dns_name}\"\n- }\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"East US 2\"\n+ resource_group_name = \"mycompute\"\n+}\n \n- output \"vm_public_ip\" {\n- value = \"${module.mycompute.public_ip_address}\"\n- }\n+output \"vm_public_name\"{\n+ value = \"${module.mycompute.public_ip_dns_name}\"\n+}\n \n- output \"vm_private_ips\" {\n- value = \"${module.mycompute.network_interface_private_ip}\"\n- }\n+output \"vm_public_ip\" {\n+ value = \"${module.mycompute.public_ip_address}\"\n }\n \n+output \"vm_private_ips\" {\n+ value = \"${module.mycompute.network_interface_private_ip}\"\n+}\n ```\n Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` to a new VNet and opens up port 22 for SSH access with ~/.ssh/id_rsa.pub :\n \n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -16,37 +16,35 @@ Usage\n Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VNet and opens up port 3389 for RDP access:\n \n ```hcl\n- module \"mycompute\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"mycompute\"\n- location = \"East US 2\"\n- admin_password = ComplxP@ssw0rd!\n- vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywinsrv252\"\n- remote_port = \"3389\"\n- nb_instances = 2\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- }\n-\n- module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"East US 2\"\n- resource_group_name = \"mycompute\"\n- }\n+module \"mycompute\" {\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"mycompute\"\n+ location = \"East US 2\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ vm_os_simple = \"WindowsServer\"\n+ public_ip_dns = \"mywinsrv252\"\n+ remote_port = \"3389\"\n+ nb_instances = 2\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n \n- output \"vm_public_name\"{\n- value = \"${module.mycompute.public_ip_dns_name}\"\n- }\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"East US 2\"\n+ resource_group_name = \"mycompute\"\n+}\n \n- output \"vm_public_ip\" {\n- value = \"${module.mycompute.public_ip_address}\"\n- }\n+output \"vm_public_name\"{\n+ value = \"${module.mycompute.public_ip_dns_name}\"\n+}\n \n- output \"vm_private_ips\" {\n- value = \"${module.mycompute.network_interface_private_ip}\"\n- }\n+output \"vm_public_ip\" {\n+ value = \"${module.mycompute.public_ip_address}\"\n }\n \n+output \"vm_private_ips\" {\n+ value = \"${module.mycompute.network_interface_private_ip}\"\n+}\n ```\n Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` to a new VNet and opens up port 22 for SSH access with ~/.ssh/id_rsa.pub :\n \n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -16,37 +16,35 @@ Usage\n Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VNet and opens up port 3389 for RDP access:\n \n ```hcl\n- module \"mycompute\" {\n- resource_group_name source = \"Azure/compute/azurerm\"\n- resource_group_name = \"mycompute\"\n- location = \"East US 2\"\n- admin_password = ComplxP@ssw0rd!\n- vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywinsrv252\"\n- remote_port = \"3389\"\n- nb_instances = 2\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- }\n-\n- module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"East US 2\"\n- resource_group_name = \"mycompute\"\n- }\n+module \"mycompute\" {\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"mycompute\"\n+ location = \"East US 2\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ vm_os_simple = \"WindowsServer\"\n+ public_ip_dns = \"mywinsrv252\"\n+ remote_port = \"3389\"\n+ nb_instances = 2\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n \n- output \"vm_public_name\"{\n- value = \"${module.mycompute.public_ip_dns_name}\"\n- }\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"East US 2\"\n+ resource_group_name = \"mycompute\"\n+}\n \n- output \"vm_public_ip\" {\n- value = \"${module.mycompute.public_ip_address}\"\n- }\n+output \"vm_public_name\"{\n+ value = \"${module.mycompute.public_ip_dns_name}\"\n+}\n \n- output \"vm_private_ips\" {\n- value = \"${module.mycompute.network_interface_private_ip}\"\n- }\n+output \"vm_public_ip\" {\n+ value = \"${module.mycompute.public_ip_address}\"\n }\n \n+output \"vm_private_ips\" {\n+ value = \"${module.mycompute.network_interface_private_ip}\"\n+}\n ```\n Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` to a new VNet and opens up port 22 for SSH access with ~/.ssh/id_rsa.pub :\n \n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -16,37 +16,35 @@ Usage\n Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VNet and opens up port 3389 for RDP access:\n \n ```hcl\n- module \"mycompute\" {\n- source = \"Azure/compute/azurerm\"\n- resource_group_name = \"mycompute\"\n- location = \"East US 2\"\n- admin_password = ComplxP@ssw0rd!\n- vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywinsrv252\"\n- remote_port = \"3389\"\n- nb_instances = 2\n- vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n- }\n-\n- module \"network\" {\n- source = \"Azure/network/azurerm\"\n- location = \"East US 2\"\n- resource_group_name = \"mycompute\"\n- }\n+module \"mycompute\" {\n+ source = \"Azure/compute/azurerm\"\n+ resource_group_name = \"mycompute\"\n+ opens = \"East US 2\"\n+ admin_password = \"ComplxP@ssw0rd!\"\n+ vm_os_simple = \"WindowsServer\"\n+ public_ip_dns = \"mywinsrv252\"\n+ remote_port = \"3389\"\n+ nb_instances = 2\n+ vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n+}\n \n- output \"vm_public_name\"{\n- value = \"${module.mycompute.public_ip_dns_name}\"\n- }\n+module \"network\" {\n+ source = \"Azure/network/azurerm\"\n+ location = \"East US 2\"\n+ resource_group_name = \"mycompute\"\n+}\n \n- output \"vm_public_ip\" {\n- value = \"${module.mycompute.public_ip_address}\"\n- }\n+output \"vm_public_name\"{\n+ value = \"${module.mycompute.public_ip_dns_name}\"\n+}\n \n- output \"vm_private_ips\" {\n- value = \"${module.mycompute.network_interface_private_ip}\"\n- }\n+output \"vm_public_ip\" {\n+ value = \"${module.mycompute.public_ip_address}\"\n }\n \n+output \"vm_private_ips\" {\n+ value = \"${module.mycompute.network_interface_private_ip}\"\n+}\n ```\n Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and `vm_os_sku` to a new VNet and opens up port 22 for SSH access with ~/.ssh/id_rsa.pub :\n \n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nFixed issue where Azure/compute/azurerm module was called instead of Azure/network/azurerm\n\n---\n\nChoice A:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"westus\"\n module resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"mycompute2\"\n- resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n location }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"westus\"\n resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"westus\"\n resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\n\n\n---\n"}], "ideal": "D"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAdd vm_hostname to os_disk name for more comprehension in Azure GUI.\n\n---\n\nChoice A:\nmain.tf\n@@ -21,6 +21,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +32,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -62,6 +63,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -134,4 +136,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,8 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine is terminated\"\n+ default = \"false\"\n+}\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -21,6 +21,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +32,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -62,6 +63,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -134,4 +136,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,8 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine @@ terminated\"\n+ default = \"false\"\n+}\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -21,6 +21,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +32,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -62,6 +63,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -134,4 +136,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,8 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine is terminated\"\n+ default = \"false\"\n+}\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -21,6 +21,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +32,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n @@ caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -62,6 +63,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -134,4 +136,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,8 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine is terminated\"\n+ default = \"false\"\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAdd vm_hostname to the name of each nic interface for more comprehension.\r\n\n\n---\n\nChoice A:\nmain.tf\n@@ -123,7 +123,7 @@ resource \"azurerm_network_security_group\" \"vm\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +134,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -123,7 +123,7 @@ resource \"azurerm_network_security_group\" \"vm\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +134,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -123,7 +123,7 @@ resource \"azurerm_network_security_group\" \"vm\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +134,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -123,7 +123,7 @@ resource \"azurerm_network_security_group\" \"vm\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +134,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation \"nic-${var.vm_hostname}-${count.index}\"\n = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAllow to don't add public ip on machine.\n\n---\n\nChoice A:\nmain.tf\n@@ -121,11 +121,12 @@ resource \"azurerm_availability_set\" \"vm\" {\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n- name = \"${var.vm_hostname}-publicIP\"\n+ count = \"${var.nb_public_ip}\"\n+ name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -158,6 +159,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"ipconfig${count.index}\"\n subnet_id = \"${var.vnet_subnet_id}\"\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n }\n---\noutputs.tf\n@@ -20,17 +20,17 @@ output \"network_interface_private_ip\"{\n \n output \"public_ip_id\" {\n description = \"id of the ip address provisoned.\"\n- value = \"${azurerm_public_ip.vm.id}\"\n+ value = \"${azurerm_public_ip.vm.*.id}\"\n }\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- value = \"${azurerm_public_ip.vm.ip_address}\"\n+ value = \"${azurerm_public_ip.vm.*.ip_address}\"\n }\n \n output \"public_ip_dns_name\" {\n description = \"fqdn to connect to the first vm provisioned.\"\n- value = \"${azurerm_public_ip.vm.fqdn}\"\n+ value = \"${azurerm_public_ip.vm.*.fqdn}\"\n }\n \n output \"availability_set_id\" {\n---\nvariables.tf\n@@ -12,8 +12,8 @@ variable \"vnet_subnet_id\"{\n }\n \n variable \"public_ip_dns\" {\n- description = \"Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\"\n- default = \"\"\n+ description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n+ default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -98,6 +98,11 @@ variable \"public_ip_address_allocation\" {\n default = \"static\"\n }\n \n+variable \"nb_public_ip\" {\n+ description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n+ default = \"1\"\n+}\n+\n variable \"delete_os_disk_on_termination\" {\n description = \"Delete datadisk when machine is terminated\"\n default = \"false\"\n@@ -111,4 +116,4 @@ variable \"boot_diagnostics\" {\n variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n-}\n+}\n\\ No newline at end of file\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -121,11 +121,12 @@ resource \"azurerm_availability_set\" \"vm\" {\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n- name = \"${var.vm_hostname}-publicIP\"\n+ count = \"${var.nb_public_ip}\"\n+ name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -158,6 +159,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"ipconfig${count.index}\"\n subnet_id = \"${var.vnet_subnet_id}\"\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n }\n---\noutputs.tf\n@@ -20,17 +20,17 @@ output \"network_interface_private_ip\"{\n \n output \"public_ip_id\" {\n description = \"id of the public ip address provisoned.\"\n- value = \"${azurerm_public_ip.vm.id}\"\n+ value = \"${azurerm_public_ip.vm.*.id}\"\n }\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- value = \"${azurerm_public_ip.vm.ip_address}\"\n+ value = \"${azurerm_public_ip.vm.*.ip_address}\"\n }\n \n output \"public_ip_dns_name\" {\n description = \"fqdn to connect to the first vm provisioned.\"\n- value = \"${azurerm_public_ip.vm.fqdn}\"\n+ value = \"${azurerm_public_ip.vm.*.fqdn}\"\n }\n \n output \"availability_set_id\" {\n---\nvariables.tf\n@@ -12,8 +12,8 @@ variable \"vnet_subnet_id\"{\n }\n \n variable \"public_ip_dns\" {\n- description = \"Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\"\n- default = \"\"\n+ description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n+ default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -98,6 +98,11 @@ variable \"public_ip_address_allocation\" {\n default = \"static\"\n }\n \n+variable \"nb_public_ip\" {\n+ description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n+ default = \"1\"\n+}\n+\n variable \"delete_os_disk_on_termination\" {\n description = \"Delete datadisk when machine is terminated\"\n default = \"false\"\n@@ -111,4 +116,4 @@ variable \"boot_diagnostics\" {\n variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n-}\n+}\n\\ No newline at end of file\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -121,11 +121,12 @@ resource \"azurerm_availability_set\" \"vm\" {\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n- name = \"${var.vm_hostname}-publicIP\"\n+ count = \"${var.nb_public_ip}\"\n+ name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -158,6 +159,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"ipconfig${count.index}\"\n subnet_id = \"${var.vnet_subnet_id}\"\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n }\n---\noutputs.tf\n@@ -20,17 +20,17 @@ output \"network_interface_private_ip\"{\n \n output \"public_ip_id\" {\n description = \"id of the public ip address provisoned.\"\n- value = \"${azurerm_public_ip.vm.id}\"\n+ value = \"${azurerm_public_ip.vm.*.id}\"\n }\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- value = \"${azurerm_public_ip.vm.ip_address}\"\n+ value = \"${azurerm_public_ip.vm.*.ip_address}\"\n \n output \"public_ip_dns_name\" {\n description = \"fqdn to connect to the first vm provisioned.\"\n- value = \"${azurerm_public_ip.vm.fqdn}\"\n+ value = \"${azurerm_public_ip.vm.*.fqdn}\"\n }\n \n output \"availability_set_id\" {\n---\nvariables.tf\n@@ -12,8 +12,8 @@ variable \"vnet_subnet_id\"{\n }\n \n variable \"public_ip_dns\" {\n- description = \"Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\"\n- default = \"\"\n+ description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only thisvar here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n+ default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -98,6 +98,11 @@ variable \"public_ip_address_allocation\" {\n default = \"static\"\n }\n \n+variable \"nb_public_ip\" {\n+ description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n+ default = \"1\"\n+}\n+\n variable \"delete_os_disk_on_termination\" {\n description = \"Delete datadisk when machine is terminated\"\n default = \"false\"\n@@ -111,4 +116,4 @@ variable \"boot_diagnostics\" {\n variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n-}\n+}\n\\ No newline at end of file\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -121,11 +121,12 @@ resource \"azurerm_availability_set\" \"vm\" {\n }\n \n resource \"azurerm_public_ip\" \"vm\" {\n- name = \"${var.vm_hostname}-publicIP\"\n+ count = \"${var.nb_public_ip}\"\n+ name = \"${var.vm_hostname}-${count.index}-publicIP\"\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${element(var.public_ip_dns, count.index)}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -158,6 +159,6 @@ resource \"azurerm_network_interface\" \"vm\" {\n name = \"ipconfig${count.index}\"\n subnet_id = \"${var.vnet_subnet_id}\"\n private_ip_address_allocation = \"Dynamic\"\n- public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n+ public_ip_address_id = \"${length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list(\"\")), count.index) : \"\"}\"\n }\n }\n---\noutputs.tf\n@@ -20,17 +20,17 @@ output \"network_interface_private_ip\"{\n \n output \"public_ip_id\" {\n description = \"id of the public ip address provisoned.\"\n- value = \"${azurerm_public_ip.vm.id}\"\n+ value = \"${azurerm_public_ip.vm.*.id}\"\n }\n \n output \"public_ip_address\" {\n description = \"The actual ip address allocated for the resource.\"\n- value = \"${azurerm_public_ip.vm.ip_address}\"\n+ value = \"${azurerm_public_ip.vm.*.ip_address}\"\n }\n \n output \"public_ip_dns_name\" {\n description = \"fqdn to connect to the first vm provisioned.\"\n- value = \"${azurerm_public_ip.vm.fqdn}\"\n+ value = \"${azurerm_public_ip.vm.*.fqdn}\"\n }\n \n output \"availability_set_id\" {\n---\nvariables.tf\n@@ -12,8 +12,8 @@ variable \"vnet_subnet_id\"{\n }\n \n variable \"public_ip_dns\" {\n- description = \"Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\"\n- default = \"\"\n+ description = \"Optional globally unique per datacenter region domain name label to apply to each public ip address. e.g. thisvar.varlocation.cloudapp.azure.com where you specify only here. This is an array of names which will pair up sequentially to the number of public ips defined in var.nb_public_ip. One name or empty string is required for every public ip. If no public ip is desired, then set this to an array with a single empty string.\"\n+ default = [\"\"]\n }\n \n variable \"admin_password\" {\n@@ -98,6 +98,11 @@ variable \"public_ip_address_allocation\" {\n default = \"static\"\n }\n \n+variable \"nb_public_ip\" {\n+ description = \"Number of public IPs to assign corresponding to one IP per vm. Set to 0 to not assign any public IP addresses.\"\n+ default = \"1\"\n+}\n+\n variable \"delete_os_disk_on_termination\" {\n description = \"Delete datadisk when machine is terminated\"\n default = \"false\"\n@@ -111,4 +116,4 @@ variable \"boot_diagnostics\" {\n variable \"boot_diagnostics_sa_type\" {\n description = \"(Optional) Storage account type for boot diagnostics\"\n default = \"Standard_LRS\"\n-}\n+}\n\\ No newline at end of file\n---\n\n\n---\n"}], "ideal": "B"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAllow to add boot diagnostics option.\r\n\r\n\n\n---\n\nChoice A:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"westus\"\n resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\nmain.tf\n@@ -13,6 +13,22 @@ resource \"azurerm_resource_group\" \"vm\" {\n tags = \"${var.tags}\"\n }\n \n+resource \"random_id\" \"vm-sa\" {\n+ keepers = {\n+ vm_hostname = \"${var.vm_hostname}\"\n+ }\n+ byte_length = 6\n+}\n+\n+resource \"azurerm_storage_account\" \"vm-sa\" {\n+ count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n+ name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ account_type = \"${var.boot_diagnostics_sa_type}\"\n+ tags = \"${var.tags}\"\n+}\n+\n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") ? 0 : var.nb_instances}\"\n name = \"${var.vm_hostname}${count.index}\"\n@@ -21,6 +37,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +48,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -52,6 +69,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -62,6 +83,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -83,6 +105,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n@@ -123,7 +149,7 @@ resource \"azurerm_network_security_group\" \"vm-windows\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +160,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,18 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine is terminated\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics\" {\n+ description = \"(Optional) Enable or Disable boot diagnostics\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics_sa_type\" {\n+ description = \"(Optional) Storage account type for boot diagnostics\"\n+ default = \"Standard_LRS\"\n+}\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"westus\"\n resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\nmain.tf\n@@ -13,6 +13,22 @@ resource \"azurerm_resource_group\" \"vm\" {\n tags = \"${var.tags}\"\n }\n \n+resource \"random_id\" \"vm-sa\" {\n+ keepers = {\n+ vm_hostname = \"${var.vm_hostname}\"\n+ }\n+ byte_length = 6\n+}\n+\n+resource \"azurerm_storage_account\" \"vm-sa\" {\n+ count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n+ name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ account_type = \"${var.boot_diagnostics_sa_type}\"\n+ tags = \"${var.tags}\"\n+}\n+\n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") ? 0 : var.nb_instances}\"\n name = \"${var.vm_hostname}${count.index}\"\n@@ -21,6 +37,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +48,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -52,6 +69,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -62,6 +83,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -83,6 +105,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n@@ -123,7 +149,7 @@ resource \"azurerm_network_security_group\" \"vm\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n : resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +160,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,18 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine is terminated\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics\" {\n+ description = \"(Optional) Enable or Disable boot diagnostics\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics_sa_type\" {\n+ description = \"(Optional) Storage account type for boot diagnostics\"\n+ default = \"Standard_LRS\"\n+}\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"westus\"\n resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\nmain.tf\n@@ -13,6 +13,22 @@ resource \"azurerm_resource_group\" \"vm\" {\n tags = \"${var.tags}\"\n }\n \n+resource \"random_id\" \"vm-sa\" {\n+ keepers = {\n+ vm_hostname = \"${var.vm_hostname}\"\n+ }\n+ byte_length = 6\n+}\n+\n+resource \"azurerm_storage_account\" \"vm-sa\" {\n+ count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n+ name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ account_type = \"${var.boot_diagnostics_sa_type}\"\n+ tags = \"${var.tags}\"\n+}\n+\n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") ? 0 : var.nb_instances}\"\n name = \"${var.vm_hostname}${count.index}\"\n@@ -21,6 +37,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +48,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -52,6 +69,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -62,6 +83,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -83,6 +105,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n@@ -123,7 +149,7 @@ resource \"azurerm_network_security_group\" \"vm\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +160,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,18 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine is terminated\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics\" {\n+ description = \"(Optional) Enable or Disable boot diagnostics\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics_sa_type\" {\n+ description = \"(Optional) Storage account type for boot diagnostics\"\n+ default = \"Standard_LRS\"\n+}\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -68,10 +68,10 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"Azure/compute/azurerm\"\n- location = \"westus\"\n+ source \t\t= \"Azure/network/azurerm\"\n+ location \t\t= \"westus\"\n resource_group_name = \"mycompute2\"\n- }\n+}\n \n ```\n Authors\n---\nmain.tf\n@@ -13,6 +13,22 @@ resource \"azurerm_resource_group\" \"vm\" {\n tags = \"${var.tags}\"\n }\n \n+resource \"random_id\" \"vm-sa\" {\n+ keepers = {\n+ vm_hostname = \"${var.vm_hostname}\"\n+ }\n+ byte_length = 6\n+}\n+\n+resource \"azurerm_storage_account\" \"vm-sa\" {\n+ count = \"${var.boot_diagnostics == \"true\" ? 1 : 0}\"\n+ name = \"bootdiag${lower(random_id.vm-sa.hex)}\"\n+ resource_group_name = \"${azurerm_resource_group.vm.name}\"\n+ location = \"${var.location}\"\n+ account_type = \"${var.boot_diagnostics_sa_type}\"\n+ tags = \"${var.tags}\"\n+}\n+\n resource \"azurerm_virtual_machine\" \"vm-linux\" {\n count = \"${contains(list(\"${var.vm_os_simple}\",\"${var.vm_os_offer}\"), \"WindowsServer\") ? 0 : var.nb_instances}\"\n name = \"${var.vm_hostname}${count.index}\"\n@@ -21,6 +37,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -31,7 +48,7 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n }\n \n storage_os_disk {\n- name = \"osdisk${count.index}\"\n+ name = \"osdisk-${var.vm_hostname}-${count.index}\"\n create_option = \"FromImage\"\n caching = \"ReadWrite\"\n managed_disk_type = \"${var.storage_account_type}\"\n@@ -52,6 +69,10 @@ resource \"azurerm_virtual_machine\" \"vm-linux\" {\n key_data = \"${file(\"${var.ssh_key}\")}\"\n }\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_virtual_machine\" \"vm-windows\" {\n@@ -62,6 +83,7 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n availability_set_id = \"${azurerm_availability_set.vm.id}\"\n vm_size = \"${var.vm_size}\"\n network_interface_ids = [\"${element(azurerm_network_interface.vm.*.id, count.index)}\"]\n+ delete_os_disk_on_termination = \"${var.delete_os_disk_on_termination}\"\n \n storage_image_reference {\n id = \"${var.vm_os_id}\"\n@@ -83,6 +105,10 @@ resource \"azurerm_virtual_machine\" \"vm-windows\" {\n admin_username = \"${var.admin_username}\"\n admin_password = \"${var.admin_password}\"\n }\n+ boot_diagnostics {\n+ enabled = \"${var.boot_diagnostics}\"\n+ storage_uri = \"${var.boot_diagnostics == \"true\" ? join(\",\", azurerm_storage_account.vm-sa.*.primary_blob_endpoint) : \"\" }\"\n+ }\n }\n \n resource \"azurerm_availability_set\" \"vm\" {\n@@ -123,7 +149,7 @@ resource \"azurerm_network_security_group\" \"vm\" {\n \n resource \"azurerm_network_interface\" \"vm\" {\n count = \"${var.nb_instances}\"\n- name = \"nic${count.index}\"\n+ name = \"nic-${var.vm_hostname}-${count.index}\"\n location = \"${azurerm_resource_group.vm.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n network_security_group_id = \"${azurerm_network_security_group.vm.id}\"\n@@ -134,4 +160,4 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n---\nvariables.tf\n@@ -97,3 +97,18 @@ variable \"public_ip_address_allocation\" {\n description = \"Defines how an IP address is assigned. Options are Static or Dynamic.\"\n default = \"static\"\n }\n+\n+variable \"delete_os_disk_on_termination\" {\n+ description = \"Delete datadisk when machine is terminated\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics\" {\n+ description = \"(Optional) Enable or Disable boot diagnostics\"\n+ default = \"false\"\n+}\n+\n+variable \"boot_diagnostics_sa_type\" {\n+ description = \"(Optional) Storage account type for boot diagnostics\"\n+ default = \"Standard_LRS\"\n+}\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nAdd **count.index** in **domain_name_label** to avoid error when changing nb_instance var to a value higher than 1\n\n---\n\nChoice A:\nmain.tf\n@@ -99,7 +99,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${var.public_ip_dns}${count.index}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -134,4 +134,5 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n+\n---\n\n\n---\n\nChoice B:\nmain.tf\n@@ -99,7 +99,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${var.public_ip_dns}${count.index}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -134,4 +134,5 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n No newline at end of file\n+}\n+\n---\n\n\n---\n\nChoice C:\nmain.tf\n@@ -99,7 +99,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${var.public_ip_dns}${count.index}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -134,4 +134,5 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n+\n---\n\n\n---\n\nChoice D:\nmain.tf\n@@ -99,7 +99,7 @@ resource \"azurerm_public_ip\" \"vm\" {\n location = \"${var.location}\"\n resource_group_name = \"${azurerm_resource_group.vm.name}\"\n public_ip_address_allocation = \"${var.public_ip_address_allocation}\"\n- domain_name_label domain_name_label = \"${var.public_ip_dns}\"\n+ domain_name_label = \"${var.public_ip_dns}${count.index}\"\n }\n \n resource \"azurerm_network_security_group\" \"vm\" {\n@@ -134,4 +134,5 @@ resource \"azurerm_network_interface\" \"vm\" {\n private_ip_address_allocation = \"Dynamic\"\n public_ip_address_id = \"${count.index == 0 ? azurerm_public_ip.vm.id : \"\"}\"\n }\n-}\n\\ No newline at end of file\n+}\n+\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nFix the Windows Server public DNS IP example name to be valid. Otherwise you get:\r\n```\r\n* module.mycompute.azurerm_public_ip.vm: 1 error(s) occurred:\r\n\r\n* azurerm_public_ip.vm: network.PublicIPAddressesClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code=\"DomainNameLabelReserved\" Message=\"The domain name label mywindowsservers225 is invalid. The name itself or part of the name is a reserved word such as a trademark. Please use a different name.\" Details=[]\r\n```\n\n---\n\nChoice A:\nREADME.md\n@@ -22,7 +22,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywindowsservers225\"\n+ public_ip_dns = \"mywinsrv252\"\n remote_port = \"3389\"\n nb_instances = 2\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -22,7 +22,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywindowsservers225\"\n+ public_ip_dns = \"mywinsrv252\"\n remote_port = \"3389\"\n nb_instances = 2\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -22,7 +22,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywindowsservers225\"\n+ public_ip_dns = \"mywinsrv252\"\n remote_port = \"3389\"\n nb_instances = 2\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -22,7 +22,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n Windows location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n vm_os_simple = \"WindowsServer\"\n- public_ip_dns = \"mywindowsservers225\"\n+ public_ip_dns = \"mywinsrv252\"\n remote_port = \"3389\"\n nb_instances = 2\n vnet_subnet_id = \"${module.network.vnet_subnets[0]}\"\n---\n\n\n---\n"}], "ideal": "A"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nRemove the output variables for Terraform Module formatting. \r\n\r\nThanks,\r\nChris\n\n---\n\nChoice A:\nREADME.md\n@@ -74,19 +74,6 @@ module \"mycompute2\" {\n }\n \n ```\n-\n-Outputs\n-=======\n-\n-- `vm_ids`- Virtual machine ids created\n-- `network_security_group_id` - id of the security group provisioned\n-- `network_interface_ids` - ids of the vm nics provisoned\n-- `network_interface_private_ip` - private ip addresses of the vm nics\n-- `public_ip_id` `network_security_group_id` id of the public ip address provisoned\n-- `public_ip_address` - The actual ip address allocated for the resource.\n-- `public_ip_dns_name` - fqdn to connect to the first vm provisioned.\n-- `availability_set_id` - id of the availability set where the vms are provisioned.\n-\n Authors\n =======\n Originally created by [David Tesar](http://github.com/dtzar)\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -74,19 +74,6 @@ module \"mycompute2\" {\n }\n \n ```\n-\n-Outputs\n-=======\n-\n-- `vm_ids`- Virtual machine ids created\n-- `network_security_group_id` - id of the security group provisioned\n-- `network_interface_ids` - ids of the vm nics provisoned\n-- `network_interface_private_ip` - private ip addresses of the vm nics\n-- `public_ip_id` - id of the public ip address provisoned\n-- `public_ip_address` - The actual ip address allocated for the resource.\n-- `public_ip_dns_name` - fqdn first connect to the first vm provisioned.\n-- `availability_set_id` - id of the availability set where the vms are provisioned.\n-\n Authors\n =======\n Originally created by [David Tesar](http://github.com/dtzar)\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -74,19 +74,6 @@ module \"mycompute2\" {\n }\n \n ```\n-\n-Outputs\n-=======\n-\n-- `vm_ids`- Virtual machine ids created\n-- `network_security_group_id` - id of the security group provisioned\n-- `network_interface_ids` - ids of the vm nics provisoned\n-- `network_interface_private_ip` - private ip addresses of the vm nics\n-- `public_ip_id` - id of the public ip address provisoned\n-- `public_ip_address` - The actual ip address allocated for the resource.\n-- `public_ip_dns_name` - fqdn to connect to the first vm provisioned.\n-- `availability_set_id` - id of the availability set where the vms are provisioned.\n-\n Authors\n =======\n Originally created by [David Tesar](http://github.com/dtzar)\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -74,19 +74,6 @@ module \"mycompute2\" {\n }\n \n ```\n-\n-Outputs\n-=======\n-\n-- `vm_ids`- Virtual machine ids created\n-- `network_security_group_id` - id of the security group provisioned\n-- `network_interface_ids` - ids of the vm nics provisoned\n-- `network_interface_private_ip` - private ip addresses of the vm nics\n-- `public_ip_id` - id of the public ip address provisoned\n-- ip - The actual ip address allocated for the resource.\n-- `public_ip_dns_name` - fqdn to connect to the first vm provisioned.\n-- `availability_set_id` - id of the availability set where the vms are provisioned.\n-\n Authors\n =======\n Originally created by [David Tesar](http://github.com/dtzar)\n---\n\n\n---\n"}], "ideal": "C"}
{"input": [{"role": "system", "content": "Choose the best Terraform patch (A/B/C/D) that implements the requested Azure Compute change safely. Only respond with a single uppercase letter."}, {"role": "user", "content": "Task Description:\nRemoved variables section: Within the Terraform module registry documentation we source variable information from the variable and output files. Having only one source of truth with respect to variables will make it easier to maintain. \r\n\r\nChange source location from repo URL to module registry path (works with TF 0.10.5+)\n\n---\n\nChoice A:\nREADME.md\n@@ -9,29 +9,6 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Public IP is created and attached only to the first VM's nic. Once into this VM, connection can be make to the other vms using the private ip on the VNet.\n \n-Module Input Variables\n-----------------------\n-\n-- `resource_group_name` - The name of the resource group in which the resources will be created. - default `compute`\n-- `location` - The Azure location where the resources will be created.\n-- `vnet_subnet_id` - The subnet id of the virtual network where the virtual machines will reside.\n-- `public_ip_dns` - Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\n-- `admin_password` - The password of the administrator account. The password must comply with the complexity requirements for Azure virtual machines.\n-- `ssh_key` - The path on the local machine of the ssh public key in the case of a Linux deployment. - default `~/.ssh/id_rsa.pub`\n-- `remote_port` - Tcp port number to enable remote access to the nics on the vms via a NSG rule. Set to blank to disable.\n-- `admin_username` - The name of the administrator to access the machines part of the virtual machine scale set. - default `azureuser`\n-- `storage_account_type` - Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS. - default `Premium_LRS`\n-- `vm_size` - The initial size of the virtual machine that will be deployed. - default `Standard_DS1_V2`\n-- `nb_instances` - The number of instances that will be initially deployed in the virtual machine scale set. - default `1`\n-- `vm_hostname` - local name of the VM. - default `myvm`\n-- `vm_os_simple`- This variable allows to use a simple name to reference Linux or Windows operating systems. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`. The supported values are: \"UbuntuServer\", \"WindowsServer\", \"RHEL\", \"openSUSE-Leap\", \"CentOS\", \"Debian\", \"CoreOS\" and \"SLES\".\n-- `vm_os_id` - The ID of the image that you want to deploy if you are using a custom image. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`.\n-- `vm_os_publisher` - The name of the publisher of the image that you want to deploy, for example \"Canonical\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_offer` - The name of the offer of the image that you want to deploy, for example \"UbuntuServer\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_sku` - The sku of the image that you want to deploy, for example \"14.04.2-LTS\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_version` - The version of the image that you want to deploy. - default `latest`\n-- `public_ip_address_allocation` - Defines how that IP address is assigned. Options are Static or Dynamic. - default `static`\n-- `tags` - A map of the tags to use on the resources that are deployed with this module.\n \n Usage\n -----\n@@ -40,7 +17,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n \n ```hcl\n module \"mycompute\" {\n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute\"\n location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n@@ -52,7 +29,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n }\n \n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/network/azurerm\"\n location = \"East US 2\"\n resource_group_name = \"mycompute\"\n }\n@@ -75,7 +52,7 @@ Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and\n \n ```hcl \n module \"mycompute2\" { \n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute2\"\n location = \"westus\"\n public_ip_dns = \"myubuntuservers225\"\n@@ -91,7 +68,7 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/compute/azurerm\"\n location = \"westus\"\n resource_group_name = \"mycompute2\"\n }\n---\n\n\n---\n\nChoice B:\nREADME.md\n@@ -9,29 +9,6 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Public IP is created and attached only to the first VM's nic. Once into this VM, connection can be make to the other vms using the private ip on the VNet.\n \n-Module Input Variables\n-----------------------\n-\n-- `resource_group_name` - The name of the resource group in which the resources will be created. - default `compute`\n-- `location` - The Azure location where the resources will be created.\n-- `vnet_subnet_id` - The subnet id of the virtual network where the virtual machines will reside.\n-- `public_ip_dns` - Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\n-- `admin_password` - The password of the administrator account. The password must comply with the complexity requirements for Azure virtual machines.\n-- `ssh_key` - The path on the local machine of the ssh public key in the case of a Linux deployment. - default `~/.ssh/id_rsa.pub`\n-- `remote_port` - Tcp port number to enable remote access to the nics on the vms via a NSG rule. Set to blank to disable.\n-- `admin_username` - The name of the administrator to access the machines part of the virtual machine scale set. - default `azureuser`\n-- `storage_account_type` - Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS. - default `Premium_LRS`\n-- `vm_size` - The initial size of the virtual machine that will be deployed. - default `Standard_DS1_V2`\n-- `nb_instances` - The number of instances that will be initially deployed in the virtual machine scale set. - default `1`\n-- `vm_hostname` - local name of the VM. - default `myvm`\n-- `vm_os_simple`- This variable allows to use a simple name to reference Linux or Windows operating systems. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`. The supported values are: \"UbuntuServer\", \"WindowsServer\", \"RHEL\", \"openSUSE-Leap\", \"CentOS\", \"Debian\", \"CoreOS\" and \"SLES\".\n-- `vm_os_id` - The ID of the image that you want to deploy if you are using a custom image. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`.\n-- `vm_os_publisher` - The name of the publisher of the image that you want to deploy, for example \"Canonical\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_offer` - The name of the offer of the image that you want to deploy, for example \"UbuntuServer\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_sku` - The sku of the image that you want to deploy, for example \"14.04.2-LTS\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_version` - The version of the image that you want to deploy. - default `latest`\n-- `public_ip_address_allocation` - Defines how an IP address is assigned. Options are Static or Dynamic. - default `static`\n-- `tags` - A map of the tags to use on the resources that are deployed with this module.\n \n Usage\n -----\n@@ -40,7 +17,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n \n ```hcl\n module \"mycompute\" {\n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute\"\n location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n@@ -52,7 +29,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n }\n \n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/network/azurerm\"\n location = \"East US 2\"\n resource_group_name = \"mycompute\"\n }\n@@ -75,7 +52,7 @@ Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and\n \n ```hcl \n module \"mycompute2\" { \n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute2\"\n location = \"westus\"\n public_ip_dns = \"myubuntuservers225\"\n@@ -91,7 +68,7 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/compute/azurerm\"\n location = \"westus\"\n resource_group_name = \"mycompute2\"\n }\n---\n\n\n---\n\nChoice C:\nREADME.md\n@@ -9,29 +9,6 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Public IP is created and attached only to the first VM's nic. Once into this VM, connection can be make to the other vms using the private ip on the VNet.\n \n-Module Input Variables\n-----------------------\n-\n-- `resource_group_name` - The name of the resource group in which the resources will be created. - default `compute`\n-- `location` - The Azure location where the resources will be created.\n-- `vnet_subnet_id` - The subnet id of the virtual network where the virtual machines will reside.\n-- `public_ip_dns` - Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\n-- `admin_password` - The password of the administrator account. The password must comply with the complexity requirements for Azure virtual machines.\n-- `ssh_key` - The path on the local machine of the ssh public key in the case of a Linux deployment. - default `~/.ssh/id_rsa.pub`\n-- `remote_port` - Tcp port number to enable remote access to the nics on the vms via a NSG rule. Set to blank to disable.\n-- `admin_username` - The name of the administrator to access the machines part of the virtual machine scale set. - default `azureuser`\n-- `storage_account_type` - Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS. - default `Premium_LRS`\n-- `vm_size` - The initial size of the virtual machine that will be deployed. - default `Standard_DS1_V2`\n-- `nb_instances` - The number of instances that will be initially deployed in the virtual machine scale set. - default `1`\n-- `vm_hostname` - local name of the VM. - default `myvm`\n-- `vm_os_simple`- This variable allows to use a simple name to reference Linux or Windows operating systems. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`. The supported values are: \"UbuntuServer\", \"WindowsServer\", \"RHEL\", \"openSUSE-Leap\", \"CentOS\", \"Debian\", \"CoreOS\" and \"SLES\".\n-- `vm_os_id` - The ID of the image that you want to deploy if you are using a custom image. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`.\n-- `vm_os_publisher` - The name of the publisher of the image that you want to deploy, for example \"Canonical\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_offer` - The name of the offer of the image that you want to deploy, for example \"UbuntuServer\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_sku` - The sku of the image that you want to deploy, for example \"14.04.2-LTS\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_version` - The version of the image that you want to deploy. - default `latest`\n-- `public_ip_address_allocation` - Defines how an IP address is assigned. Options are Static or Dynamic. - default `static`\n-- `tags` - A map of the tags to use on the resources that are deployed with this module.\n \n Usage\n -----\n@@ -40,7 +17,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n \n ```hcl\n module \"mycompute\" {\n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute\"\n location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n@@ -52,7 +29,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n }\n \n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/network/azurerm\"\n location = \"East US 2\"\n resource_group_name = \"mycompute\"\n }\n@@ -75,7 +52,7 @@ Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and\n \n ```hcl \n module \"mycompute2\" { \n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute2\"\n location = \"westus\"\n public_ip_dns = \"myubuntuservers225\"\n@@ -91,7 +68,7 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/compute/azurerm\"\n location = \"westus\"\n resource_group_name = \"mycompute2\"\n }\n---\n\n\n---\n\nChoice D:\nREADME.md\n@@ -9,29 +9,6 @@ This Terraform module deploys Virtual Machines in Azure with the following chara\n - VM nics attached to a single virtual network subnet of your choice (new or existing) via `var.vnet_subnet_id`.\n - Public IP is created and attached only to the first VM's nic. Once into this VM, connection can be make to the other vms using the private ip on the VNet.\n \n-Module Input Variables\n-----------------------\n-\n-- `resource_group_name` - The name of the resource group in which the resources will be created. - default `compute`\n-- `location` - The Azure location where the resources will be created.\n-- `vnet_subnet_id` - The subnet id of the virtual network where the virtual machines will reside.\n-- `public_ip_dns` - Optional globally unique per datacenter region domain name label to apply to the public ip address. e.g. thisvar.varlocation.cloudapp.azure.com\n-- `admin_password` - The password of the administrator account. The password must comply with the complexity requirements for Azure virtual machines.\n-- `ssh_key` - The path on the local machine of the ssh public key in the case of a Linux deployment. - default `~/.ssh/id_rsa.pub`\n-- `remote_port` - Tcp port number to enable remote access to the nics on the vms via a NSG rule. Set to blank to disable.\n-- `admin_username` - The name of the administrator to access the machines part of the virtual machine scale set. - default `azureuser`\n-- `storage_account_type` - Defines the type of storage account to be created. Valid options are Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS. - default `Premium_LRS`\n-- `vm_size` - The initial size of the virtual machine that will be deployed. - default `Standard_DS1_V2`\n-- `nb_instances` - The number of instances that will be initially deployed in the virtual machine scale set. - default `1`\n-- `vm_hostname` - local name of the VM. - default `myvm`\n-- `vm_os_simple`- This variable allows to use a simple name to reference Linux or Windows operating systems. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`. The supported values are: \"UbuntuServer\", \"WindowsServer\", \"RHEL\", \"openSUSE-Leap\", \"CentOS\", \"Debian\", \"CoreOS\" and \"SLES\".\n-- `vm_os_id` - The ID of the image that you want to deploy if you are using a custom image. When used, you can ommit the `vm_os_publisher`, `vm_os_offer` and `vm_os_sku`.\n-- `vm_os_publisher` - The name of the publisher of the image that you want to deploy, for example \"Canonical\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_offer` - The name of the offer of the image that you want to deploy, for example \"UbuntuServer\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_sku` - The sku of the image that you want to deploy, for example \"14.04.2-LTS\" if you are not using the `vm_os_simple` or `vm_os_id` variables. \n-- `vm_os_version` - The version of the image that you want to deploy. - default `latest`\n-- `public_ip_address_allocation` - Defines how an IP address is assigned. Options are Static or Dynamic. - default `static`\n-- `tags` - A map of the tags to use on the resources that are deployed with this module.\n \n Usage\n -----\n@@ -40,7 +17,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n \n ```hcl\n module \"mycompute\" {\n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute\"\n location = \"East US 2\"\n admin_password = ComplxP@ssw0rd!\n@@ -52,7 +29,7 @@ Provisions 2 Windows 2016 Datacenter Server VMs using `vm_os_simple` to a new VN\n }\n \n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/network/azurerm\"\n location = \"East US 2\"\n resource_group_name = \"mycompute\"\n }\n@@ -75,7 +52,7 @@ Provisions 2 Ubuntu 14.04 Server VMs using `vm_os_publisher`, `vm_os_offer` and\n \n ```hcl \n module \"mycompute2\" { \n- source = \"github.com/Azure/terraform-azurerm-compute\"\n+ source subnet = \"Azure/compute/azurerm\"\n resource_group_name = \"mycompute2\"\n location = \"westus\"\n public_ip_dns = \"myubuntuservers225\"\n@@ -91,7 +68,7 @@ module \"mycompute2\" {\n }\n }\n module \"network\" {\n- source = \"github.com/Azure/terraform-azurerm-network\"\n+ source = \"Azure/compute/azurerm\"\n location = \"westus\"\n resource_group_name = \"mycompute2\"\n }\n---\n\n\n---\n"}], "ideal": "B"}