Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
feat(elbv2): add listener, listener_rule and cleanup code
Browse files Browse the repository at this point in the history
Signed-off-by: haarchri <[email protected]>
  • Loading branch information
haarchri committed Jul 10, 2022
1 parent 31b3e95 commit 30b998d
Show file tree
Hide file tree
Showing 10 changed files with 256 additions and 24 deletions.
30 changes: 30 additions & 0 deletions apis/elbv2/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions apis/elbv2/v1alpha2/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions apis/elbv2/v1alpha2/zz_lblistenercertificate_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions apis/elbv2/v1alpha2/zz_lblistenerrule_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions config/elasticloadbalancing/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,30 @@ func Configure(p *config.Provider) {
p.AddResourceConfigurator("aws_lb_listener_rule", func(r *config.Resource) {
r.Version = common.VersionV1Alpha2
r.ExternalName = config.IdentifierFromProvider
r.References = config.References{
"listener_arn": {
Type: "LBListener",
},

"action.target_group_arn": {
Type: "LBTargetGroup",
},

"action.forward.targetGroup.arn": {
Type: "LBTargetGroup",
},
}

})

p.AddResourceConfigurator("aws_lb_listener_certificate", func(r *config.Resource) {
r.Version = common.VersionV1Alpha2
r.ExternalName = config.IdentifierFromProvider
r.References = config.References{
"listener_arn": {
Type: "LBListener",
},
}
})

p.AddResourceConfigurator("aws_lb_target_group", func(r *config.Resource) {
Expand Down
21 changes: 21 additions & 0 deletions examples/elbv2/listener.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: elbv2.aws.jet.crossplane.io/v1alpha2
kind: LBListener
metadata:
name: sample-lb-listener
spec:
forProvider:
region: us-west-1
port: 80
protocol: HTTP
loadBalancerArnRef:
name: sample-alb
defaultAction:
- type: "forward"
forward:
- targetGroup:
- arnRef:
name: sample-ip-targetgroup
weight: 999
providerConfigRef:
name: default
21 changes: 21 additions & 0 deletions examples/elbv2/listener_rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: elbv2.aws.jet.crossplane.io/v1alpha2
kind: LBListenerRule
metadata:
name: sample-lb-listener-rule
spec:
forProvider:
region: us-west-1
listenerArnRef:
name: sample-lb-listener
condition:
- hostHeader:
- values:
- "example.com"
action:
- type: "forward"
order: 100
targetGroupArnRef:
name: sample-ip-targetgroup
providerConfigRef:
name: default
18 changes: 0 additions & 18 deletions examples/elbv2/target-groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,3 @@ spec:
name: sample-vpc
providerConfigRef:
name: default
# ---
## released in v3.62.0
## in v3.52.0 only [instance ip lambda]
# apiVersion: elbv2.aws.jet.crossplane.io/v1alpha2
# kind: LBTargetGroup
# metadata:
# name: sample-alb-targetgroup
# spec:
# forProvider:
# region: us-west-1
# name: sample-alb-targetgroup
# targetType: alb
# port: 80
# protocol: "TCP"
# vpcIdRef:
# name: sample-vpc
# providerConfigRef:
# name: default
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,35 @@ spec:
type: string
listenerArn:
type: string
listenerArnRef:
description: A Reference to a named object.
properties:
name:
description: Name of the referenced object.
type: string
required:
- name
type: object
listenerArnSelector:
description: A Selector selects an object.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
same controller reference as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
type: object
region:
description: Region is the region you'd like your resource to
be created in.
type: string
required:
- certificateArn
- listenerArn
- region
type: object
providerConfigRef:
Expand Down
48 changes: 47 additions & 1 deletion package/crds/elbv2.aws.jet.crossplane.io_lblistenerrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,30 @@ spec:
type: array
targetGroupArn:
type: string
targetGroupArnRef:
description: A Reference to a named object.
properties:
name:
description: Name of the referenced object.
type: string
required:
- name
type: object
targetGroupArnSelector:
description: A Selector selects an object.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with
the same controller reference as the selecting object
is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching
labels is selected.
type: object
type: object
type:
type: string
required:
Expand Down Expand Up @@ -292,6 +316,29 @@ spec:
type: array
listenerArn:
type: string
listenerArnRef:
description: A Reference to a named object.
properties:
name:
description: Name of the referenced object.
type: string
required:
- name
type: object
listenerArnSelector:
description: A Selector selects an object.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
same controller reference as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
type: object
priority:
type: number
region:
Expand All @@ -305,7 +352,6 @@ spec:
required:
- action
- condition
- listenerArn
- region
type: object
providerConfigRef:
Expand Down

0 comments on commit 30b998d

Please sign in to comment.