crossplane-contrib / provider-upjet-aws

AWS Provider for Crossplane.
https://marketplace.upbound.io/providers/upbound/provider-family-aws/
Apache License 2.0
150 stars 129 forks source link

elbv2: `LBTargetGroup` not created #276

Closed fcastarede closed 2 months ago

fcastarede commented 1 year ago

What happened?

When healthCheck is specified, the resource was not created with the following message:

cannot run refresh: refresh failed: Too many health_check blocks: No more than 1 "health_check" blocks are allowed

When healthCheck is not specified, the resource was created but there is still a warning:

cannot run plan: plan failed: arn:aws:elasticloadbalancing:us-east-1:474756349353:targetgroup/client1-k8s-cluster-ingress/db514af6374ff608: health_check.healthy_threshold 5 and health_check.unhealthy_threshold 2 must be the same for target_groups with TCP protocol:

... Despite the doc indicates 3 as default value for both healthyThreshold and unhealthyThreshold (https://marketplace.upbound.io/providers/upbound/provider-aws/v0.22.0/resources/elbv2.aws.upbound.io/LBTargetGroup/v1beta1#doc:spec-forProvider-healthCheck-healthyThreshold, https://marketplace.upbound.io/providers/upbound/provider-aws/v0.22.0/resources/elbv2.aws.upbound.io/LBTargetGroup/v1beta1#doc:spec-forProvider-healthCheck-unhealthyThreshold)

This warning blocks the deletion of this resource.

How can we reproduce it?

- name: ingress-lb-targetgroup
    base:
      apiVersion: elbv2.aws.upbound.io/v1beta1
      kind: LBTargetGroup
      spec:
        forProvider:
          healthCheck:
            - healthyThreshold: 3
            - unhealthyThreshold: 3
          port: 32080
          protocol: TCP
          region: us-east-1
    patches:
    - type: PatchSet
      patchSetName: providerconfigref
    - fromFieldPath: spec.id
      toFieldPath: metadata.name
      transforms:
      - type: string
        string:
          fmt: '%s-ingress-lb-targetgroup'
    - fromFieldPath: spec.id
      toFieldPath: spec.forProvider.name
      transforms:
      - type: string
        string:
          fmt: '%s-ingress'
    - fromFieldPath: status.VPCID
      toFieldPath: spec.forProvider.vpcId
      policy:
        fromFieldPath: Required

What environment did it happen in?

turkenf commented 1 year ago

Hi, @fcastarede thanks for raising this issue. I could not reproduce this issue.

cannot run refresh: refresh failed: Too many health_check blocks: No more than 1 "health_check" blocks are allowed

To fix the above error, you should use the healthCheck arguments as follows.

    healthCheck:
    - healthyThreshold: 3
      unhealthyThreshold: 3

I did not encounter any errors when I created the example below.

apiVersion: elbv2.aws.upbound.io/v1beta1
kind: LBTargetGroup
metadata:
  labels:
    testing.upbound.io/example-name: elbv2
  name: test
spec:
  forProvider:
    name: example-lb-tg
    port: 32080
    protocol: TCP
    region: us-east-1
    healthCheck:
    - healthyThreshold: 3
      unhealthyThreshold: 3
    vpcIdSelector:
      matchLabels:
        testing.upbound.io/example-name: elbv2
---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: VPC
metadata:
  labels:
    testing.upbound.io/example-name: elbv2
  name: sample-vpc
spec:
  forProvider:
    region: us-east-1
    cidrBlock: 172.16.0.0/16
    tags:
      Name: DemoVpc
github-actions[bot] commented 3 months ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 2 months ago

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!