From 26fcb450eca720695c3ad7d841f4c6aa20cc3089 Mon Sep 17 00:00:00 2001 From: candonov <25967713+candonov@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:15:40 -0700 Subject: [PATCH] feat(upgrade): upgrading aws-provider and fixing warnings (#179) * fixing some warnings * matching service * reverting a test * feat(upgrade): upbound aws-provider to 1.2.1 and clearing warnings * upgrading eksclt as well * apigw warning cleanup --- .../crossplane/upbound-aws-provider.yaml | 4 +- bootstrap/terraform/main.tf | 2 +- .../apigw/definition.yaml | 4 ++ .../upbound-aws-provider/apigw/rest.yaml | 53 +++++++++++++++---- .../event-source-mapping/definition.yaml | 5 -- .../event-source-mapping/sqs.yaml | 6 --- .../upbound-aws-provider/kms/definition.yaml | 4 ++ .../upbound-aws-provider/kms/kms.yaml | 12 ++--- .../lambda/container.yaml | 27 +++++----- .../lambda/definition.yaml | 4 ++ .../upbound-aws-provider/lambda/zip.yaml | 27 +++++----- .../sns-sqs/definition.yaml | 4 ++ .../upbound-aws-provider/sns-sqs/sns-sqs.yaml | 18 ++++--- .../upbound-aws-provider/sns/definition.yaml | 4 ++ .../upbound-aws-provider/sns/sns.yaml | 26 +++++---- .../upbound-aws-provider/sqs/definition.yaml | 4 ++ .../sqs-lambda-s3/kustomization.yaml | 3 ++ 17 files changed, 137 insertions(+), 70 deletions(-) diff --git a/bootstrap/eksctl/crossplane/upbound-aws-provider.yaml b/bootstrap/eksctl/crossplane/upbound-aws-provider.yaml index a1196b0d..ecb15d1c 100644 --- a/bootstrap/eksctl/crossplane/upbound-aws-provider.yaml +++ b/bootstrap/eksctl/crossplane/upbound-aws-provider.yaml @@ -6,7 +6,7 @@ kind: Provider metadata: name: provider-aws-upbound spec: - package: "xpkg.upbound.io/upbound/provider-aws:v0.40.0" + package: "xpkg.upbound.io/upbound/provider-aws:v1.2.1" controllerConfigRef: name: provider-aws-upbound --- @@ -23,4 +23,4 @@ spec: args: - --debug - --enable-management-policies - \ No newline at end of file + diff --git a/bootstrap/terraform/main.tf b/bootstrap/terraform/main.tf index 25b7e2d6..5bb80243 100644 --- a/bootstrap/terraform/main.tf +++ b/bootstrap/terraform/main.tf @@ -211,7 +211,7 @@ locals { upbound_aws_provider = { enable = var.enable_upbound_aws_provider # defaults to true - version = "v0.40.0" + version = "v1.2.1" controller_config = "upbound-aws-controller-config" provider_config_name = "aws-provider-config" #this is the providerConfigName used in all the examples in this repo families = [ diff --git a/compositions/upbound-aws-provider/apigw/definition.yaml b/compositions/upbound-aws-provider/apigw/definition.yaml index 5538bfa7..ab8bba4e 100644 --- a/compositions/upbound-aws-provider/apigw/definition.yaml +++ b/compositions/upbound-aws-provider/apigw/definition.yaml @@ -69,6 +69,10 @@ spec: type: string region: type: string + tags: + additionalProperties: + type: string + type: object required: - region type: object diff --git a/compositions/upbound-aws-provider/apigw/rest.yaml b/compositions/upbound-aws-provider/apigw/rest.yaml index 0415850d..f137bcf9 100644 --- a/compositions/upbound-aws-provider/apigw/rest.yaml +++ b/compositions/upbound-aws-provider/apigw/rest.yaml @@ -19,18 +19,9 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.deletionPolicy toFieldPath: spec.deletionPolicy - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.region - toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.providerConfigName toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.tags - toFieldPath: spec.forProvider.tags - policy: - mergeOptions: - keepMapValues: true - fromFieldPath: "metadata.name" toFieldPath: "metadata.name" resources: @@ -48,6 +39,9 @@ spec: patches: - type: PatchSet patchSetName: common-fields + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: metadata.name toFieldPath: metadata.name @@ -88,6 +82,12 @@ spec: type: Regexp regexp: match: \d{12,} + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: apigw-role base: @@ -129,6 +129,12 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.id toFieldPath: status.apigwRoleName + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: api-deployment base: @@ -142,6 +148,9 @@ spec: patches: - type: PatchSet patchSetName: common-fields + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: metadata.name toFieldPath: metadata.name @@ -184,6 +193,9 @@ spec: patches: - type: PatchSet patchSetName: common-fields + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: metadata.name toFieldPath: metadata.name @@ -205,6 +217,12 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.stageName toFieldPath: status.apigwStageName + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: api-access-logs-group base: @@ -217,6 +235,9 @@ spec: patches: - type: PatchSet patchSetName: common-fields + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: metadata.name toFieldPath: metadata.name @@ -230,6 +251,12 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.arn toFieldPath: status.apigwAccessLogsGroupArn + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: apigw-logging-account base: @@ -243,6 +270,9 @@ spec: patches: - type: PatchSet patchSetName: common-fields + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: metadata.name toFieldPath: metadata.name @@ -270,6 +300,9 @@ spec: patches: - type: PatchSet patchSetName: common-fields + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: metadata.name toFieldPath: metadata.name @@ -279,4 +312,4 @@ spec: fmt: "%s-api-method-settings" - type: FromCompositeFieldPath fromFieldPath: spec.logLevel - toFieldPath: spec.forProvider.loggingLevel + toFieldPath: spec.forProvider.settings[0].loggingLevel diff --git a/compositions/upbound-aws-provider/event-source-mapping/definition.yaml b/compositions/upbound-aws-provider/event-source-mapping/definition.yaml index f56aa752..99bc4eb3 100644 --- a/compositions/upbound-aws-provider/event-source-mapping/definition.yaml +++ b/compositions/upbound-aws-provider/event-source-mapping/definition.yaml @@ -42,11 +42,6 @@ spec: type: string region: type: string - tags: - additionalProperties: - type: string - description: Key-value map of resource tags. - type: object required: - providerConfigName - region diff --git a/compositions/upbound-aws-provider/event-source-mapping/sqs.yaml b/compositions/upbound-aws-provider/event-source-mapping/sqs.yaml index 84505509..f3632a73 100644 --- a/compositions/upbound-aws-provider/event-source-mapping/sqs.yaml +++ b/compositions/upbound-aws-provider/event-source-mapping/sqs.yaml @@ -20,12 +20,6 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.providerConfigName toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.tags - toFieldPath: spec.forProvider.tags - policy: - mergeOptions: - keepMapValues: true - fromFieldPath: "metadata.name" toFieldPath: "metadata.name" transforms: diff --git a/compositions/upbound-aws-provider/kms/definition.yaml b/compositions/upbound-aws-provider/kms/definition.yaml index 5510e4ff..c5000bab 100644 --- a/compositions/upbound-aws-provider/kms/definition.yaml +++ b/compositions/upbound-aws-provider/kms/definition.yaml @@ -42,6 +42,10 @@ spec: type: string region: type: string + tags: + additionalProperties: + type: string + type: object required: - region type: object diff --git a/compositions/upbound-aws-provider/kms/kms.yaml b/compositions/upbound-aws-provider/kms/kms.yaml index ea7bf111..4d9ff7ad 100644 --- a/compositions/upbound-aws-provider/kms/kms.yaml +++ b/compositions/upbound-aws-provider/kms/kms.yaml @@ -24,12 +24,6 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.providerConfigName toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.tags - toFieldPath: spec.forProvider.tags - policy: - mergeOptions: - keepMapValues: true resources: - name: key base: @@ -51,6 +45,12 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.keyId toFieldPath: status.keyId + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: alais base: apiVersion: kms.aws.upbound.io/v1beta1 diff --git a/compositions/upbound-aws-provider/lambda/container.yaml b/compositions/upbound-aws-provider/lambda/container.yaml index 580cc2b7..d5db2a32 100644 --- a/compositions/upbound-aws-provider/lambda/container.yaml +++ b/compositions/upbound-aws-provider/lambda/container.yaml @@ -19,15 +19,6 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.deletionPolicy toFieldPath: spec.deletionPolicy - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.region - toFieldPath: spec.forProvider.region - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.tags - toFieldPath: spec.forProvider.tags - policy: - mergeOptions: - keepMapValues: true - fromFieldPath: "metadata.name" toFieldPath: "metadata.name" resources: @@ -72,6 +63,12 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.permissionsBoundaryArn toFieldPath: spec.forProvider.permissionsBoundary + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: lambda-basic-policy-attachment base: apiVersion: iam.aws.upbound.io/v1beta1 @@ -100,12 +97,12 @@ spec: patches: - type: PatchSet patchSetName: common-fields + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.providerConfigName toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: metadata.name - toFieldPath: spec.forProvider.functionName - type: FromCompositeFieldPath fromFieldPath: spec.memorySize toFieldPath: spec.forProvider.memorySize @@ -130,3 +127,9 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.id toFieldPath: status.functionName + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true diff --git a/compositions/upbound-aws-provider/lambda/definition.yaml b/compositions/upbound-aws-provider/lambda/definition.yaml index f7d74751..aa1efdec 100644 --- a/compositions/upbound-aws-provider/lambda/definition.yaml +++ b/compositions/upbound-aws-provider/lambda/definition.yaml @@ -62,6 +62,10 @@ spec: type: string region: type: string + tags: + additionalProperties: + type: string + type: object required: - region type: object diff --git a/compositions/upbound-aws-provider/lambda/zip.yaml b/compositions/upbound-aws-provider/lambda/zip.yaml index 4205c04c..b9379c38 100644 --- a/compositions/upbound-aws-provider/lambda/zip.yaml +++ b/compositions/upbound-aws-provider/lambda/zip.yaml @@ -19,15 +19,6 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.deletionPolicy toFieldPath: spec.deletionPolicy - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.region - toFieldPath: spec.forProvider.region - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.tags - toFieldPath: spec.forProvider.tags - policy: - mergeOptions: - keepMapValues: true - fromFieldPath: "metadata.name" toFieldPath: "metadata.name" resources: @@ -72,6 +63,12 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.permissionsBoundaryArn toFieldPath: spec.forProvider.permissionsBoundary + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: lambda-basic-policy-attachment base: apiVersion: iam.aws.upbound.io/v1beta1 @@ -105,9 +102,6 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.providerConfigName toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: metadata.name - toFieldPath: spec.forProvider.functionName - type: FromCompositeFieldPath fromFieldPath: spec.memorySize toFieldPath: spec.forProvider.memorySize @@ -137,6 +131,9 @@ spec: toFieldPath: spec.forProvider.s3Key policy: fromFieldPath: Required + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: spec.envVariables toFieldPath: spec.forProvider.environment[0].variables @@ -149,3 +146,9 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.id toFieldPath: status.functionName + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true diff --git a/compositions/upbound-aws-provider/sns-sqs/definition.yaml b/compositions/upbound-aws-provider/sns-sqs/definition.yaml index e30d3de5..9c639175 100644 --- a/compositions/upbound-aws-provider/sns-sqs/definition.yaml +++ b/compositions/upbound-aws-provider/sns-sqs/definition.yaml @@ -42,6 +42,10 @@ spec: type: string region: type: string + tags: + additionalProperties: + type: string + type: object required: - region type: object diff --git a/compositions/upbound-aws-provider/sns-sqs/sns-sqs.yaml b/compositions/upbound-aws-provider/sns-sqs/sns-sqs.yaml index 932477a3..60b94bb7 100644 --- a/compositions/upbound-aws-provider/sns-sqs/sns-sqs.yaml +++ b/compositions/upbound-aws-provider/sns-sqs/sns-sqs.yaml @@ -35,12 +35,6 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.providerConfigName toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.tags - toFieldPath: spec.forProvider.tags - policy: - mergeOptions: - keepMapValues: true - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.name toFieldPath: metadata.annotations[crossplane.io/external-name] @@ -74,6 +68,12 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.queueUrl toFieldPath: status.queueUrl + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.resourceConfig.tags + policy: + mergeOptions: + keepMapValues: true - name: sns base: apiVersion: awsblueprints.io/v1alpha1 @@ -96,6 +96,12 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.topicArn toFieldPath: status.topicArn + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.resourceConfig.tags + policy: + mergeOptions: + keepMapValues: true - name: subscription base: apiVersion: sns.aws.upbound.io/v1beta1 diff --git a/compositions/upbound-aws-provider/sns/definition.yaml b/compositions/upbound-aws-provider/sns/definition.yaml index e7ad8832..78e10bf6 100644 --- a/compositions/upbound-aws-provider/sns/definition.yaml +++ b/compositions/upbound-aws-provider/sns/definition.yaml @@ -42,6 +42,10 @@ spec: type: string region: type: string + tags: + additionalProperties: + type: string + type: object required: - region type: object diff --git a/compositions/upbound-aws-provider/sns/sns.yaml b/compositions/upbound-aws-provider/sns/sns.yaml index 179d8c3f..1dfc4acb 100644 --- a/compositions/upbound-aws-provider/sns/sns.yaml +++ b/compositions/upbound-aws-provider/sns/sns.yaml @@ -20,18 +20,9 @@ spec: - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.deletionPolicy toFieldPath: spec.deletionPolicy - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.region - toFieldPath: spec.forProvider.region - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.providerConfigName toFieldPath: spec.providerConfigRef.name - - type: FromCompositeFieldPath - fromFieldPath: spec.resourceConfig.tags - toFieldPath: spec.forProvider.tags - policy: - mergeOptions: - keepMapValues: true - type: FromCompositeFieldPath fromFieldPath: spec.resourceConfig.name toFieldPath: metadata.annotations[crossplane.io/external-name] @@ -40,7 +31,7 @@ spec: transforms: - type: string string: - fmt: "function-%s" + fmt: "topic-%s" resources: - name: sns-feedback base: @@ -74,6 +65,12 @@ spec: - type: string string: fmt: "sns-feedback-%s" + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true - name: sns-feedback-policy-attachment base: apiVersion: iam.aws.upbound.io/v1beta1 @@ -120,3 +117,12 @@ spec: - type: ToCompositeFieldPath fromFieldPath: status.atProvider.id toFieldPath: status.topicId + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.region + toFieldPath: spec.forProvider.region + - type: FromCompositeFieldPath + fromFieldPath: spec.resourceConfig.tags + toFieldPath: spec.forProvider.tags + policy: + mergeOptions: + keepMapValues: true diff --git a/compositions/upbound-aws-provider/sqs/definition.yaml b/compositions/upbound-aws-provider/sqs/definition.yaml index 07a7ab5b..3153d6af 100644 --- a/compositions/upbound-aws-provider/sqs/definition.yaml +++ b/compositions/upbound-aws-provider/sqs/definition.yaml @@ -43,6 +43,10 @@ spec: type: string region: type: string + tags: + additionalProperties: + type: string + type: object required: - region type: object diff --git a/examples/upbound-aws-provider/composite-resources/serverless-examples/sqs-lambda-s3/kustomization.yaml b/examples/upbound-aws-provider/composite-resources/serverless-examples/sqs-lambda-s3/kustomization.yaml index 6a66a35e..10a006a3 100644 --- a/examples/upbound-aws-provider/composite-resources/serverless-examples/sqs-lambda-s3/kustomization.yaml +++ b/examples/upbound-aws-provider/composite-resources/serverless-examples/sqs-lambda-s3/kustomization.yaml @@ -3,7 +3,10 @@ kind: Kustomization bases: - ../../../../../compositions/upbound-aws-provider/event-source-mapping/ - ../../../../../compositions/upbound-aws-provider/iam-policy/ +- ../../../../../compositions/upbound-aws-provider/kms/ - ../../../../../compositions/upbound-aws-provider/lambda/ - ../../../../../compositions/upbound-aws-provider/s3/ +- ../../../../../compositions/upbound-aws-provider/sns/ - ../../../../../compositions/upbound-aws-provider/sqs/ +- ../../../../../compositions/upbound-aws-provider/sns-sqs/ - ../../../../../compositions/upbound-aws-provider/serverless/