generated from crossplane/upjet-provider-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0de66d
commit ddcef4a
Showing
16 changed files
with
520 additions
and
9 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
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 |
---|---|---|
|
@@ -12,6 +12,6 @@ spec: | |
- dc1 | ||
name: my_policy | ||
rules: | | ||
node_prefix "" { | ||
policy = "read" | ||
} | ||
node_prefix "" { | ||
policy = "read" | ||
} |
Empty file.
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,192 @@ | ||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: Composition | ||
metadata: | ||
name: consulserviceacl.composite.daanvinken | ||
spec: | ||
compositeTypeRef: | ||
apiVersion: daanvinken.io/v1alpha1 | ||
kind: ConsulServiceACL | ||
resources: | ||
# Consul ACL Policy Resource | ||
- name: consul_acl_policy | ||
base: | ||
apiVersion: acl.daanvinken.io/v1alpha1 | ||
kind: Policy | ||
metadata: | ||
generateName: "policy-" | ||
labels: | ||
crossplane.io/composite: "consulserviceacl" | ||
spec: | ||
forProvider: | ||
datacenters: | ||
- "" # Patch dynamically | ||
rules: "" # Inject full policy dynamically | ||
patches: | ||
- fromFieldPath: "spec.parameters.dc" | ||
toFieldPath: "spec.forProvider.datacenters[0]" | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.name" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "policy-%s" | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.rules" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: | | ||
agent_prefix "" { | ||
policy = "read" | ||
} | ||
service_prefix "" { | ||
policy = "read" | ||
} | ||
service_prefix "%[1]s" { | ||
policy = "write" | ||
} | ||
key_prefix "%[1]s" { | ||
policy = "write" | ||
} | ||
key_prefix "app/%[1]s" { | ||
policy = "write" | ||
} | ||
session_prefix "" { | ||
policy = "write" | ||
} | ||
session_prefix "session/%[1]s" { | ||
policy = "write" | ||
} | ||
key_prefix "preloader/%[1]s" { | ||
policy = "write" | ||
} | ||
# Vault Consul Secret Backend Role | ||
- name: consul_secret_backend_role | ||
base: | ||
apiVersion: consul.vault.upbound.io/v1alpha1 | ||
kind: SecretBackendRole | ||
metadata: | ||
generateName: "backend-role-" | ||
spec: | ||
forProvider: | ||
backend: "" # Patch backend path dynamically | ||
policies: | ||
- "policy-placeholder" # Reference policy dynamically | ||
patches: | ||
- fromFieldPath: "spec.parameters.consul_backend_path" | ||
toFieldPath: "spec.forProvider.backend" | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.name" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "service_ref_%[1]s" | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.policies[0]" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "policy-%[1]s" | ||
|
||
# Consul ACL Role Resource | ||
- name: consul_acl_role | ||
base: | ||
apiVersion: acl.daanvinken.io/v1alpha1 | ||
kind: Role | ||
metadata: | ||
generateName: "role-" | ||
spec: | ||
forProvider: | ||
description: "ACL Role for service" | ||
serviceIdentities: | ||
- serviceName: "foo" | ||
patches: | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.name" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "role-%[1]s" | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.policies[0]" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "policy-%[1]s" | ||
|
||
# Vault Policy Resource | ||
- name: vault_policy | ||
base: | ||
apiVersion: vault.vault.upbound.io/v1alpha1 | ||
kind: Policy | ||
metadata: | ||
generateName: "vault-policy-" | ||
spec: | ||
forProvider: | ||
name: "" # Patch dynamically | ||
policy: "" # Inject full policy dynamically | ||
patches: | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.name" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "policy_consul_service_ref_%[1]s" | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.policy" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: | | ||
path "consul/creds/service_ref_%[1]s" { | ||
capabilities = ["read"] | ||
} | ||
path "secrets/creds/service_ref_%[1]s" { | ||
capabilities = ["read"] | ||
} | ||
path "secrets-kv2/data/service/%[1]s/*" { | ||
capabilities = ["read"] | ||
} | ||
path "something/v1/ica1/v1/issue/%[1]s" { | ||
capabilities = ["create", "update"] | ||
} | ||
path "containersinfra/v1/ica2/v1/issue/%[1]s" { | ||
capabilities = ["create", "update"] | ||
} | ||
path "transit/encrypt/something-main_%[1]s" { | ||
capabilities = ["update"] | ||
} | ||
path "transit/decrypt/something-main_%[1]s" { | ||
capabilities = ["update"] | ||
} | ||
# Consul ACL Token Resource | ||
- name: consul_acl_token | ||
base: | ||
apiVersion: acl.daanvinken.io/v1alpha1 | ||
kind: Token | ||
metadata: | ||
generateName: "token-" | ||
spec: | ||
forProvider: | ||
description: "Generated by Crossplane" | ||
patches: | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.name" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "role-%[1]s" | ||
- fromFieldPath: "metadata.name" | ||
toFieldPath: "spec.forProvider.policies[0]" | ||
transforms: | ||
- type: string | ||
string: | ||
fmt: "policy-%[1]s" |
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,8 @@ | ||
apiVersion: daanvinken.io/v1alpha1 | ||
kind: ConsulServiceACL | ||
metadata: | ||
name: acr-main | ||
spec: | ||
parameters: | ||
consul_backend_path: "consul" | ||
dc: "AMS3" |
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,8 @@ | ||
apiVersion: daanvinken.io/v1alpha1 | ||
kind: ConsulServiceACL | ||
metadata: | ||
name: system-logsearch | ||
spec: | ||
parameters: | ||
consul_backend_path: "consul" | ||
dc: "AMS2" |
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,53 @@ | ||
apiVersion: acl.daanvinken.io/v1alpha1 | ||
kind: Policy | ||
metadata: | ||
name: policy-my-service | ||
spec: | ||
forProvider: | ||
name: "policy-my-service" # Unique policy name | ||
datacenters: | ||
- "AMS2" # Specify the data center | ||
rules: | | ||
agent_prefix "" { | ||
policy = "read" | ||
} | ||
service_prefix "" { | ||
policy = "read" | ||
} | ||
service_prefix "my-service" { | ||
policy = "write" | ||
} | ||
key_prefix "my-service" { | ||
policy = "write" | ||
} | ||
key_prefix "app/my-service" { | ||
policy = "write" | ||
} | ||
session_prefix "" { | ||
policy = "write" | ||
} | ||
session_prefix "session/my-service" { | ||
policy = "write" | ||
} | ||
key_prefix "preloader/my-service" { | ||
policy = "write" | ||
} | ||
--- | ||
apiVersion: consul.vault.upbound.io/v1alpha1 | ||
kind: SecretBackendRole | ||
metadata: | ||
name: example-consul-backend-role | ||
spec: | ||
forProvider: | ||
backend: "consul" # The backend path for Consul secrets in Vault | ||
name: "service_ref_my-service" # Unique name for the backend role, typically linked to a specific service | ||
policies: | ||
- "policy-my-service" # Consul ACL policy to associate with this role | ||
|
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,38 @@ | ||
apiVersion: apiextensions.crossplane.io/v1 | ||
kind: CompositeResourceDefinition | ||
metadata: | ||
name: consulserviceacls.daanvinken.io | ||
spec: | ||
group: daanvinken.io | ||
names: | ||
kind: ConsulServiceACL | ||
plural: consulserviceacls | ||
shortNames: | ||
- csa | ||
claimNames: | ||
kind: ConsulServiceACL | ||
plural: consulserviceacls | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
referenceable: true | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
parameters: | ||
type: object | ||
properties: | ||
consul_backend_path: | ||
type: string | ||
description: "Backend path for the Consul secrets in Vault." | ||
dc: | ||
type: string | ||
description: "Data center name for the Consul ACL." | ||
required: | ||
- consul_backend_path | ||
- dc | ||
|
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,19 @@ | ||
apiVersion: daanvinken.io/v1alpha1 | ||
kind: AdyenCompute | ||
metadata: | ||
name: adyencompute-example-mvp | ||
spec: | ||
parameters: | ||
computeInstanceName: "crossplane-instance-mvp" | ||
imageName: "cirros" | ||
flavorName: "1C-500M-1G-STG1-CIRROS" | ||
network: | ||
- name: osstg1test | ||
securityGroups: | ||
- default | ||
consulServices: | ||
- serviceName: service3 | ||
main_keys: true | ||
- serviceName: service4 | ||
main_keys: false | ||
providerConfigName: "openstack-ams2-nonprod" |
Oops, something went wrong.