Skip to content

Commit 71aee64

Browse files
authored
feat: allow plan persistence also for Azure environments through Azure storage accounts (#1933)
* add azure plan storage
1 parent 96c9822 commit 71aee64

File tree

8 files changed

+258
-23
lines changed

8 files changed

+258
-23
lines changed

action.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ inputs:
9595
required: false
9696
default: 'true'
9797
upload-plan-destination:
98-
description: Destination to upload the plan to. gcp, github and aws are currently supported.
98+
description: Destination to upload the plan to. azure, gcp, github and aws are currently supported.
9999
required: false
100100
upload-plan-destination-s3-bucket:
101101
description: Name of the destination bucket for AWS S3. Should be provided if destination == aws
@@ -111,7 +111,12 @@ inputs:
111111
upload-plan-destination-s3-encryption-kms-key-id:
112112
description: for encryption of type KMS you need to specify the KMS key ID to use
113113
required: false
114-
114+
upload-plan-destination-azure-container:
115+
description: Name of the destination storage account container for Azure blob storage. Should be provided if destination == azure
116+
required: false
117+
upload-plan-destination-azure-storage-account:
118+
description: Name of the destination storage account for Azure blob storage. Should be provided if destination == azure
119+
required: false
115120
upload-plan-destination-gcp-bucket:
116121
description: Name of the destination bucket for a GCP bucket. Should be provided if destination == gcp
117122
required: false
@@ -383,6 +388,8 @@ runs:
383388
PLAN_UPLOAD_S3_ENCRYPTION_ENABLED: ${{ inputs.upload-plan-destination-s3-encryption-enabled }}
384389
PLAN_UPLOAD_S3_ENCRYPTION_TYPE: ${{ inputs.upload-plan-destination-s3-encryption-type }}
385390
PLAN_UPLOAD_S3_ENCRYPTION_KMS_ID: ${{ inputs.upload-plan-destination-s3-encryption-kms-key-id }}
391+
PLAN_UPLOAD_AZURE_STORAGE_CONTAINER_NAME: ${{ inputs.upload-plan-destination-azure-container }}
392+
PLAN_UPLOAD_AZURE_STORAGE_ACCOUNT_NAME: ${{ inputs.upload-plan-destination-azure-storage-account }}
386393
GOOGLE_STORAGE_LOCK_BUCKET: ${{ inputs.google-lock-bucket }}
387394
GOOGLE_STORAGE_PLAN_ARTEFACT_BUCKET: ${{ inputs.upload-plan-destination-gcp-bucket }}
388395
AWS_S3_BUCKET: ${{ inputs.upload-plan-destination-s3-bucket }}
@@ -424,6 +431,8 @@ runs:
424431
PLAN_UPLOAD_S3_ENCRYPTION_ENABLED: ${{ inputs.upload-plan-destination-s3-encryption-enabled }}
425432
PLAN_UPLOAD_S3_ENCRYPTION_TYPE: ${{ inputs.upload-plan-destination-s3-encryption-type }}
426433
PLAN_UPLOAD_S3_ENCRYPTION_KMS_ID: ${{ inputs.upload-plan-destination-s3-encryption-kms-key-id }}
434+
PLAN_UPLOAD_AZURE_STORAGE_CONTAINER_NAME: ${{ inputs.upload-plan-destination-azure-container }}
435+
PLAN_UPLOAD_AZURE_STORAGE_ACCOUNT_NAME: ${{ inputs.upload-plan-destination-azure-storage-account }}
427436
GOOGLE_STORAGE_LOCK_BUCKET: ${{ inputs.google-lock-bucket }}
428437
GOOGLE_STORAGE_PLAN_ARTEFACT_BUCKET: ${{ inputs.upload-plan-destination-gcp-bucket }}
429438
AWS_S3_BUCKET: ${{ inputs.upload-plan-destination-s3-bucket }}

docs/ce/howto/store-plans-in-a-bucket.mdx

+11
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ with:
3030
upload-plan-destination: 'aws'
3131
upload-plan-destination-s3-bucket: 'terraform-plan-output-1239123'
3232
```
33+
34+
### Azure
35+
You can also use Azure storage accounts to store plan outputs.
36+
37+
To change digger to upload the plan to Azure storage account set the following arguments in the digger_workflow.yaml
38+
39+
```
40+
with:
41+
upload-plan-destination: 'azure'
42+
upload-plan-destination-azure-storage-account: 'account_name'
43+
upload-plan-destination-azure-container: 'container_name'

docs/ce/reference/action-inputs.mdx

+7-1
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,17 @@ inputs:
8484
required: false
8585
default: 'true'
8686
upload-plan-destination:
87-
description: Destination to upload the plan to. gcp, github and aws are currently supported.
87+
description: Destination to upload the plan to. azure, gcp, github and aws are currently supported.
8888
required: false
8989
upload-plan-destination-s3-bucket:
9090
description: Name of the destination bucket for AWS S3. Should be provided if destination == aws
9191
required: false
92+
upload-plan-destination-azure-container:
93+
description: Name of the destination storage account container for Azure blob storage. Should be provided if destination == azure
94+
required: false
95+
upload-plan-destination-azure-storage-account:
96+
description: Name of the destination storage account for Azure blob storage. Should be provided if destination == azure
97+
required: false
9298
upload-plan-destination-gcp-bucket:
9399
description: Name of the destination bucket for a GCP bucket. Should be provided if destination == gcp
94100
required: false

go.work.sum

+8-2
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod
719719
github.com/AlecAivazis/survey/v2 v2.3.4 h1:pchTU9rsLUSvWEl2Aq9Pv3k0IE2fkqtGxazskAMd9Ng=
720720
github.com/AlecAivazis/survey/v2 v2.3.4/go.mod h1:hrV6Y/kQCLhIZXGcriDCUBtB3wnN7156gMXJ3+b23xM=
721721
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
722+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0/go.mod h1:99EvauvlcJ1U06amZiksfYz/3aFGyIhWGHVyiZXtBAI=
723+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0=
722724
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM=
725+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg=
723726
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
724727
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28=
725728
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
@@ -766,6 +769,7 @@ github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbf
766769
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
767770
github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY=
768771
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
772+
github.com/alecthomas/kong v0.7.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
769773
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
770774
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
771775
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
@@ -835,6 +839,8 @@ github.com/bradleyfalzon/ghinstallation v1.1.1 h1:pmBXkxgM1WeF8QYvDLT5kuQiHMcmf+
835839
github.com/bradleyfalzon/ghinstallation v1.1.1/go.mod h1:vyCmHTciHx/uuyN82Zc3rXN3X2KTK8nUTCrTMwAhcug=
836840
github.com/bradleypeabody/gorilla-sessions-memcache v0.0.0-20181103040241-659414f458e1 h1:4QHxgr7hM4gVD8uOwrk8T1fjkKRLwaLjmTkU0ibhZKU=
837841
github.com/bradleypeabody/gorilla-sessions-memcache v0.0.0-20181103040241-659414f458e1/go.mod h1:dkChI7Tbtx7H1Tj7TqGSZMOeGpMP5gLHtjroHd4agiI=
842+
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
843+
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
838844
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
839845
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
840846
github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw=
@@ -945,8 +951,6 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC
945951
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
946952
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
947953
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
948-
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
949-
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
950954
github.com/djherbis/atime v1.1.0 h1:rgwVbP/5by8BvvjBNrbh64Qz33idKT3pSnMSJsxhi0g=
951955
github.com/djherbis/atime v1.1.0/go.mod h1:28OF6Y8s3NQWwacXc5eZTsEsiMzp7LF8MbXE+XJPdBE=
952956
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
@@ -1201,6 +1205,7 @@ github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIR
12011205
github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA=
12021206
github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw=
12031207
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
1208+
github.com/keybase/dbus v0.0.0-20220506165403-5aa21ea2c23a/go.mod h1:YPNKjjE7Ubp9dTbnWvsP3HT+hYnY6TfXzubYTBeUxc8=
12041209
github.com/kidstuff/mongostore v0.0.0-20181113001930-e650cd85ee4b h1:TLCm7HR+P9HM2NXaAJaIiHerOUMedtFJeAfaYwZ8YhY=
12051210
github.com/kidstuff/mongostore v0.0.0-20181113001930-e650cd85ee4b/go.mod h1:g2nVr8KZVXJSS97Jo8pJ0jgq29P6H7dG0oplUA86MQw=
12061211
github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E=
@@ -1599,6 +1604,7 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq
15991604
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
16001605
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
16011606
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
1607+
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
16021608
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
16031609
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
16041610
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=

libs/go.mod

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ go 1.21.6
44

55
require (
66
cloud.google.com/go/storage v1.46.0
7-
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2
7+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
8+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
89
github.com/Azure/azure-sdk-for-go/sdk/data/aztables v1.2.0
10+
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0
911
github.com/aws/aws-sdk-go-v2 v1.32.4
1012
github.com/aws/aws-sdk-go-v2/config v1.28.3
1113
github.com/aws/aws-sdk-go-v2/credentials v1.17.44
@@ -33,7 +35,7 @@ require (
3335
github.com/open-policy-agent/opa v0.66.0
3436
github.com/pkg/errors v0.9.1
3537
github.com/samber/lo v1.39.0
36-
github.com/stretchr/testify v1.9.0
38+
github.com/stretchr/testify v1.10.0
3739
github.com/xanzy/go-gitlab v0.106.0
3840
github.com/zclconf/go-cty v1.14.4
3941
golang.org/x/sync v0.10.0
@@ -53,8 +55,7 @@ require (
5355
dario.cat/mergo v1.0.0 // indirect
5456
filippo.io/age v1.0.0 // indirect
5557
github.com/Azure/azure-sdk-for-go v63.3.0+incompatible // indirect
56-
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.0 // indirect
57-
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect
58+
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
5859
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
5960
github.com/Azure/go-autorest/autorest v0.11.26 // indirect
6061
github.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect
@@ -65,7 +66,7 @@ require (
6566
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
6667
github.com/Azure/go-autorest/logger v0.2.1 // indirect
6768
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
68-
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
69+
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect
6970
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 // indirect
7071
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
7172
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect
@@ -201,7 +202,6 @@ require (
201202
github.com/prometheus/procfs v0.12.0 // indirect
202203
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
203204
github.com/rivo/uniseg v0.2.0 // indirect
204-
github.com/rogpeppe/go-internal v1.12.0 // indirect
205205
github.com/russross/blackfriday/v2 v2.1.0 // indirect
206206
github.com/ryanuber/go-glob v1.0.0 // indirect
207207
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect

0 commit comments

Comments
 (0)