-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Manabu McCloskey <[email protected]>
- Loading branch information
Showing
3 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: crossplane-compositions | ||
namespace: argocd | ||
labels: | ||
env: dev | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: default | ||
source: | ||
repoURL: cnoe://crossplane-compositions | ||
targetRevision: HEAD | ||
path: "." | ||
directory: | ||
recurse: true | ||
destination: | ||
server: "https://kubernetes.default.svc" | ||
namespace: crossplane-system | ||
syncPolicy: | ||
automated: {} |
76 changes: 76 additions & 0 deletions
76
crossplane-integrations/crossplane-compositions/s3/definition.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: CompositeResourceDefinition | ||
metadata: | ||
name: xobjectstorages.awsblueprints.io | ||
spec: | ||
claimNames: | ||
kind: ObjectStorage | ||
plural: objectstorages | ||
group: awsblueprints.io | ||
names: | ||
kind: XObjectStorage | ||
plural: xobjectstorages | ||
connectionSecretKeys: | ||
- region | ||
- bucket-name | ||
- s3-put-policy | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
referenceable: true | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
description: ObjectStorageSpec defines the desired state of ObjectStorage | ||
properties: | ||
resourceConfig: | ||
description: ResourceConfig defines general properties of this AWS | ||
resource. | ||
properties: | ||
deletionPolicy: | ||
description: Defaults to Delete | ||
enum: | ||
- Delete | ||
- Orphan | ||
type: string | ||
name: | ||
description: Set the name of this resource in AWS to the value | ||
provided by this field. | ||
type: string | ||
providerConfigName: | ||
type: string | ||
region: | ||
type: string | ||
tags: | ||
items: | ||
properties: | ||
key: | ||
type: string | ||
value: | ||
type: string | ||
required: | ||
- key | ||
- value | ||
type: object | ||
type: array | ||
required: | ||
- providerConfigName | ||
- region | ||
- tags | ||
type: object | ||
required: | ||
- resourceConfig | ||
type: object | ||
status: | ||
description: ObjectStorageStatus defines the observed state of ObjectStorage | ||
properties: | ||
bucketName: | ||
type: string | ||
bucketArn: | ||
type: string | ||
type: object | ||
type: object |
80 changes: 80 additions & 0 deletions
80
crossplane-integrations/crossplane-compositions/s3/general-purpose.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: Composition | ||
metadata: | ||
name: s3bucket.awsblueprints.io | ||
labels: | ||
awsblueprints.io/provider: aws | ||
awsblueprints.io/environment: dev | ||
s3.awsblueprints.io/configuration: standard | ||
spec: | ||
writeConnectionSecretsToNamespace: crossplane-system | ||
compositeTypeRef: | ||
apiVersion: awsblueprints.io/v1alpha1 | ||
kind: XObjectStorage | ||
patchSets: | ||
- name: common-fields | ||
patches: | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.resourceConfig.providerConfigName | ||
toFieldPath: spec.providerConfigRef.name | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.resourceConfig.deletionPolicy | ||
toFieldPath: spec.deletionPolicy | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.resourceConfig.region | ||
toFieldPath: spec.forProvider.region | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.resourceConfig.name | ||
toFieldPath: metadata.annotations[crossplane.io/external-name] | ||
resources: | ||
- name: s3-bucket | ||
connectionDetails: | ||
- name: bucket-name | ||
fromConnectionSecretKey: endpoint | ||
- name: region | ||
fromConnectionSecretKey: region | ||
base: | ||
apiVersion: s3.aws.crossplane.io/v1beta1 | ||
kind: Bucket | ||
spec: | ||
deletionPolicy: Delete | ||
forProvider: | ||
objectOwnership: BucketOwnerEnforced | ||
publicAccessBlockConfiguration: | ||
blockPublicPolicy: true | ||
restrictPublicBuckets: true | ||
serverSideEncryptionConfiguration: | ||
rules: | ||
- applyServerSideEncryptionByDefault: | ||
sseAlgorithm: AES256 | ||
tagging: | ||
tagSet: | ||
- key: cnoe | ||
value: "1" | ||
patches: | ||
- type: PatchSet | ||
patchSetName: common-fields | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.resourceConfig.tags | ||
toFieldPath: spec.forProvider.tagging.tagSet | ||
policy: | ||
mergeOptions: | ||
appendSlice: true | ||
keepMapValues: true | ||
- type: FromCompositeFieldPath | ||
fromFieldPath: spec.resourceConfig.region | ||
toFieldPath: spec.forProvider.locationConstraint | ||
- fromFieldPath: spec.writeConnectionSecretToRef.namespace | ||
toFieldPath: spec.writeConnectionSecretToRef.namespace | ||
- type: ToCompositeFieldPath | ||
fromFieldPath: metadata.annotations[crossplane.io/external-name] | ||
toFieldPath: status.bucketName | ||
- type: ToCompositeFieldPath | ||
fromFieldPath: status.atProvider.arn | ||
toFieldPath: status.bucketArn | ||
- fromFieldPath: metadata.uid | ||
toFieldPath: spec.writeConnectionSecretToRef.name | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "%s-bucket" |