From aca95c9b4d35e00a34adf048ddbf4eee06e575d6 Mon Sep 17 00:00:00 2001 From: Matt Bush Date: Mon, 22 Apr 2024 22:02:27 -0700 Subject: [PATCH] Make EnvironmentEc2.cloud9 and SecretRotation.secretsmanager uptestable Signed-off-by: Matt Bush --- examples/cloud9/v1beta1/environmentec2.yaml | 1 + .../v1beta1/secretrotation.yaml | 70 ++++++++++++++----- 2 files changed, 54 insertions(+), 17 deletions(-) diff --git a/examples/cloud9/v1beta1/environmentec2.yaml b/examples/cloud9/v1beta1/environmentec2.yaml index 9364f5113b..aeaf09a7e7 100644 --- a/examples/cloud9/v1beta1/environmentec2.yaml +++ b/examples/cloud9/v1beta1/environmentec2.yaml @@ -12,6 +12,7 @@ metadata: name: example spec: forProvider: + imageId: amazonlinux-2023-x86_64 instanceType: t2.micro name: example-env region: us-west-1 diff --git a/examples/secretsmanager/v1beta1/secretrotation.yaml b/examples/secretsmanager/v1beta1/secretrotation.yaml index c544e2a6e5..4173326977 100644 --- a/examples/secretsmanager/v1beta1/secretrotation.yaml +++ b/examples/secretsmanager/v1beta1/secretrotation.yaml @@ -7,21 +7,20 @@ kind: SecretRotation metadata: annotations: meta.upbound.io/example-id: secretsmanager/v1beta1/secretrotation - upjet.upbound.io/manual-intervention: "The lambda.Function resource that is dependent on this resource requires manual intervention." labels: - testing.upbound.io/example-name: example - name: example + testing.upbound.io/example-name: secretrotation + name: example-secretrotation spec: forProvider: region: us-east-1 rotationLambdaArnSelector: matchLabels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: secretrotation rotationRules: - automaticallyAfterDays: 30 secretIdSelector: matchLabels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: secretrotation --- @@ -31,7 +30,7 @@ metadata: annotations: meta.upbound.io/example-id: secretsmanager/v1beta1/secretrotation labels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: secretrotation name: example-secretrotation spec: forProvider: @@ -41,7 +40,7 @@ spec: statementId: AllowExecutionFromSecretsManager functionNameSelector: matchLabels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: secretrotation --- @@ -51,7 +50,7 @@ metadata: annotations: meta.upbound.io/example-id: secretsmanager/v1beta1/secretrotation labels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: secretrotation name: example-secretrotation spec: forProvider: @@ -65,9 +64,8 @@ kind: Function metadata: annotations: meta.upbound.io/example-id: secretsmanager/v1beta1/secretrotation - upjet.upbound.io/manual-intervention: "This resource needs a s3.Bucket resource containing the hello-python.zip file." labels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: secretrotation name: example-secretrotation spec: forProvider: @@ -75,12 +73,15 @@ spec: environment: - variables: foo: bar - s3Bucket: upbound-provider-test-data - s3Key: hello-python.zip - handler: index.py - roleRef: - name: sample-role - runtime: python3.9 + s3BucketSelector: + matchLabels: + testing.upbound.io/example-name: secretrotation + s3Key: lambda.zip + handler: handler + roleSelector: + matchLabels: + testing.upbound.io/example-name: secretrotation + runtime: nodejs18.x --- @@ -90,7 +91,7 @@ metadata: annotations: meta.upbound.io/example-id: secretsmanager/v1beta1/secretrotation labels: - testing.upbound.io/example-name: example + testing.upbound.io/example-name: secretrotation name: sample-role spec: forProvider: @@ -108,3 +109,38 @@ spec: } ] } + +--- +apiVersion: s3.aws.upbound.io/v1beta1 +kind: Bucket +metadata: + annotations: + meta.upbound.io/example-id: secretsmanager/v1beta1/secretrotation + crossplane.io/external-name: ${Rand.RFC1123Subdomain} + labels: + testing.upbound.io/example-name: secretrotation + name: example-secretrotation +spec: + forProvider: + region: us-east-1 + +--- +apiVersion: s3.aws.upbound.io/v1beta1 +kind: Object +metadata: + annotations: + meta.upbound.io/example-id: secretsmanager/v1beta1/secretrotation + uptest.upbound.io/disable-import: "true" + labels: + testing.upbound.io/example-name: secretrotation + name: example-secretrotation +spec: + forProvider: + region: us-east-1 + bucketSelector: + matchLabels: + testing.upbound.io/example-name: secretrotation + # A zip file for a "hello world" javascript lambda + contentBase64: UEsDBBQAAAAIAFd7c1eDOfFtMAAAADEAAAAIABwAaW5kZXguanNVVAkAA7WZWmWrmVpldXgLAAEE6AMAAAToAwAAS60oyC8qKdbLSMxLyUktUrBV0NBUsLVTSM7PK87PSdXLyU/XUPfLB/FLUvNK1DUBUEsBAh4DFAAAAAgAV3tzV4M58W0wAAAAMQAAAAgAGAAAAAAAAQAAALSBAAAAAGluZGV4LmpzVVQFAAO1mVpldXgLAAEE6AMAAAToAwAAUEsFBgAAAAABAAEATgAAAHIAAAAAAA== + contentType: application/zip + key: lambda.zip \ No newline at end of file