Skip to content

Commit

Permalink
Merge pull request #490 from turkenf/issue-487
Browse files Browse the repository at this point in the history
Add dependent resources to `compute.WindowsVirtualMachineScaleSet` and fix conflicts
  • Loading branch information
turkenf authored Jul 21, 2023
2 parents b05d78c + d376f40 commit 840ddd2
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 18 deletions.
1 change: 1 addition & 0 deletions apis/compute/v1beta1/zz_generated_terraformed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions config/compute/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ func Configure(p *config.Provider) {
"virtual_machine_scale_set_id"},
}
})
p.AddResourceConfigurator("azurerm_windows_virtual_machine_scale_set", func(r *config.Resource) {
// In version 3.21.0 the `scale_in_policy` parameter was removed, and replaced by `scale_in`
r.LateInitializer = config.LateInitializer{
IgnoredFields: []string{"scale_in_policy"},
}
r.MetaResource.ArgumentDocs["scale_in_policy"] = "Deprecated: scaleInPolicy will be removed in favour of the scaleIn code block."
})
/* Note on testing:
* - create a storage account
* - upload a text file with *.vhd extension
Expand Down
103 changes: 85 additions & 18 deletions examples/compute/windowsvirtualmachinescaleset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,101 @@ apiVersion: compute.azure.upbound.io/v1beta1
kind: WindowsVirtualMachineScaleSet
metadata:
annotations:
upjet.upbound.io/manual-intervention: "This resource requires manual intervention."
uptest.upbound.io/timeout: "3600"
meta.upbound.io/example-id: compute/v1beta1/windowsvirtualmachinescaleset
labels:
testing.upbound.io/example-name: example
name: example
spec:
forProvider:
adminPasswordSecretRef:
key: example-key
key: password
name: example-secret
namespace: crossplane-system
namespace: upbound-system
adminUsername: adminuser
instances: 1
location: West Europe
networkInterface:
- ipConfiguration:
- name: internal
- ipConfiguration:
- name: internal
primary: true
subnetIdSelector:
matchLabels:
testing.upbound.io/example-name: internal
name: example
primary: true
subnetId: ...
subnetIdRef:
name: internal
name: example
primary: true
osDisk:
- caching: ReadWrite
storageAccountType: Standard_LRS
resourceGroupNameRef:
name: example-compute
- caching: ReadWrite
storageAccountType: Standard_LRS
resourceGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example
sku: Standard_F2
sourceImageReference:
- offer: WindowsServer
publisher: MicrosoftWindowsServer
sku: 2016-Datacenter-Server-Core
version: latest
- offer: WindowsServer
publisher: MicrosoftWindowsServer
sku: 2016-Datacenter-Server-Core
version: latest

---
apiVersion: azure.upbound.io/v1beta1
kind: ResourceGroup
metadata:
annotations:
meta.upbound.io/example-id: compute/v1beta1/windowsvirtualmachinescaleset
labels:
testing.upbound.io/example-name: example
name: example
spec:
forProvider:
location: West Europe

---
apiVersion: network.azure.upbound.io/v1beta1
kind: Subnet
metadata:
annotations:
meta.upbound.io/example-id: compute/v1beta1/windowsvirtualmachinescaleset
labels:
testing.upbound.io/example-name: internal
name: internal
spec:
forProvider:
addressPrefixes:
- 10.0.2.0/24
resourceGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example
virtualNetworkNameSelector:
matchLabels:
testing.upbound.io/example-name: example

---
apiVersion: network.azure.upbound.io/v1beta1
kind: VirtualNetwork
metadata:
annotations:
meta.upbound.io/example-id: compute/v1beta1/windowsvirtualmachinescaleset
labels:
testing.upbound.io/example-name: example
name: example
spec:
forProvider:
addressSpace:
- 10.0.0.0/16
location: West Europe
resourceGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example

---
apiVersion: v1
kind: Secret
metadata:
annotations:
meta.upbound.io/example-id: compute/v1beta1/windowsvirtualmachinescaleset
name: example-secret
namespace: upbound-system
type: Opaque
data:
password: dGVzdFBhc3N3b3JkITEyMw== # testPassword!123
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,8 @@ spec:
type: object
type: array
scaleInPolicy:
description: 'Deprecated: scaleInPolicy will be removed in favour
of the scaleIn code block.'
type: string
secret:
description: One or more secret blocks as defined below.
Expand Down Expand Up @@ -2072,6 +2074,8 @@ spec:
type: object
type: array
scaleInPolicy:
description: 'Deprecated: scaleInPolicy will be removed in favour
of the scaleIn code block.'
type: string
secret:
description: One or more secret blocks as defined below.
Expand Down

0 comments on commit 840ddd2

Please sign in to comment.