Last active
April 4, 2023 21:10
-
-
Save cwilhit/7e132e8115b34226ead4acfc7669f3e1 to your computer and use it in GitHub Desktop.
A Crossplane composition for an Azure Blob storage resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apiextensions.crossplane.io/v1 | |
kind: Composition | |
metadata: | |
name: xblobs.infrastructure.example.org | |
labels: | |
provider: azure | |
spec: | |
compositeTypeRef: | |
apiVersion: infrastructure.example.org/v1alpha1 | |
kind: XBlob | |
resources: | |
- base: | |
apiVersion: azure.upbound.io/v1beta1 | |
kind: ResourceGroup | |
spec: | |
forProvider: | |
location: westus | |
patches: | |
- fromFieldPath: spec.parameters.resourcegroup | |
toFieldPath: metadata.annotations[crossplane.io/external-name] | |
- base: | |
apiVersion: storage.azure.upbound.io/v1beta1 | |
kind: Account | |
metadata: | |
name: storageaccount | |
spec: | |
forProvider: | |
accountReplicationType: LRS | |
accountTier: Standard | |
location: westus | |
resourceGroupNameSelector: | |
matchControllerRef: true | |
tags: | |
provisioner: Upbound | |
writeConnectionSecretToRef: | |
name: blob-storage-account | |
namespace: upbound-system | |
patches: | |
- fromFieldPath: spec.id | |
toFieldPath: metadata.annotations[crossplane.io/external-name] | |
- base: | |
apiVersion: storage.azure.upbound.io/v1beta1 | |
kind: Container | |
spec: | |
forProvider: | |
containerAccessType: private | |
storageAccountNameSelector: | |
matchControllerRef: true | |
patches: | |
- fromFieldPath: spec.id | |
toFieldPath: metadata.annotations[crossplane.io/external-name] | |
transforms: | |
- type: string | |
string: | |
fmt: "%s-container" | |
- fromFieldPath: spec.id | |
toFieldPath: metadata.name | |
transforms: | |
- type: string | |
string: | |
fmt: "%s-container" | |
- base: | |
apiVersion: storage.azure.upbound.io/v1beta1 | |
kind: Blob | |
spec: | |
forProvider: | |
storageAccountNameSelector: | |
matchControllerRef: true | |
storageContainerNameSelector: | |
matchControllerRef: true | |
type: Block | |
patches: | |
- fromFieldPath: spec.id | |
toFieldPath: metadata.annotations[crossplane.io/external-name] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment