Skip to content

Commit

Permalink
Add examples for v1beta2 versions of the following resources:
Browse files Browse the repository at this point in the history
- examples/apigateway/v1beta2/stage.yaml
- examples/apigateway/v1beta2/usageplan.yaml
- examples/apigateway/v1beta2/methodsettings.yaml

Signed-off-by: Fatih Türken <[email protected]>
  • Loading branch information
turkenf committed May 31, 2024
1 parent 9085bbd commit 32431d7
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 130 deletions.
91 changes: 91 additions & 0 deletions examples/apigateway/v1beta2/methodsettings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
#
# SPDX-License-Identifier: CC0-1.0

apiVersion: apigateway.aws.upbound.io/v1beta2
kind: MethodSettings
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/methodsettings
labels:
testing.upbound.io/example-name: example-methodsettings
name: example-methodsettings-all
spec:
forProvider:
methodPath: '*/*'
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: example-methodsettings
settings:
metricsEnabled: true
stageNameSelector:
matchLabels:
testing.upbound.io/example-name: example-methodsettings
---
apiVersion: apigateway.aws.upbound.io/v1beta2
kind: Stage
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/methodsettings
labels:
testing.upbound.io/example-name: example-methodsettings
name: example-methodsettings-stage
spec:
forProvider:
deploymentIdSelector:
matchLabels:
testing.upbound.io/example-name: example-methodsettings
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: example-methodsettings
stageName: development
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: Deployment
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/methodsettings
labels:
testing.upbound.io/example-name: example-methodsettings
name: example-methodsettings-deployment
spec:
forProvider:
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: example-methodsettings
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: RestAPI
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/methodsettings
labels:
testing.upbound.io/example-name: example-methodsettings
name: example-methodsettings-restapi
spec:
forProvider:
body: |-
${jsonencode({
openapi = "3.0.1"
info = {
title = "example"
version = "1.0"
}
paths = {
"/path1" = {
get = {
x-amazon-apigateway-integration = {
httpMethod = "GET"
payloadFormatVersion = "1.0"
type = "HTTP_PROXY"
uri = "https://ip-ranges.amazonaws.com/ip-ranges.json"
}
}
}
}
})}
name: test-demo
region: us-west-1
149 changes: 19 additions & 130 deletions examples/apigateway/v1beta2/stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,90 +2,48 @@
#
# SPDX-License-Identifier: CC0-1.0

apiVersion: apigateway.aws.upbound.io/v1beta1
kind: UsagePlanKey
apiVersion: apigateway.aws.upbound.io/v1beta2
kind: Stage
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/stage
labels:
testing.upbound.io/example-name: stage
name: main
name: example-stage
spec:
forProvider:
keyIdSelector:
deploymentIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
keyType: API_KEY
testing.upbound.io/example-name: example-stage
region: us-west-1
usagePlanIdSelector:
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage

---

apiVersion: apigateway.aws.upbound.io/v1beta2
kind: UsagePlan
metadata:
labels:
testing.upbound.io/example-name: stage
name: example
spec:
forProvider:
apiStages:
- apiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageSelector:
matchLabels:
testing.upbound.io/example-name: stage
- apiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageSelector:
matchLabels:
testing.upbound.io/example-name: stage
description: my description
name: my-usage-plan
productCode: MYCODE
quotaSettings:
limit: 20
offset: 2
period: WEEK
region: us-west-1
throttleSettings:
burstLimit: 5
rateLimit: 10

---

apiVersion: apigateway.aws.upbound.io/v1beta1
kind: APIKey
metadata:
labels:
testing.upbound.io/example-name: stage
name: mykey
spec:
forProvider:
name: my_key
region: us-west-1
testing.upbound.io/example-name: example-stage
stageName: development
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: Deployment
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/stage
labels:
testing.upbound.io/example-name: stage
name: stage
testing.upbound.io/example-name: example-stage
name: example-stage-deployment
spec:
forProvider:
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
testing.upbound.io/example-name: example-stage
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: RestAPI
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/stage
labels:
testing.upbound.io/example-name: stage
name: test-demo
testing.upbound.io/example-name: example-stage
name: example-stage-restapi
spec:
forProvider:
body: |-
Expand All @@ -110,72 +68,3 @@ spec:
})}
name: test-demo
region: us-west-1
---
apiVersion: apigateway.aws.upbound.io/v1beta2
kind: Stage
metadata:
labels:
testing.upbound.io/example-name: stage
name: development
spec:
forProvider:
deploymentIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageName: development
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: Stage
metadata:
labels:
testing.upbound.io/example-name: stage
name: production
spec:
forProvider:
deploymentIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageName: production
---
apiVersion: apigateway.aws.upbound.io/v1beta2
kind: MethodSettings
metadata:
labels:
testing.upbound.io/example-name: stage
name: all
spec:
forProvider:
methodPath: '*/*'
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
settings:
metricsEnabled: true
stageNameSelector:
matchLabels:
testing.upbound.io/example-name: stage
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: RequestValidator
metadata:
labels:
testing.upbound.io/example-name: stage
name: example
spec:
forProvider:
name: example
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
validateRequestBody: true
validateRequestParameters: true
124 changes: 124 additions & 0 deletions examples/apigateway/v1beta2/usageplan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
#
# SPDX-License-Identifier: CC0-1.0

apiVersion: apigateway.aws.upbound.io/v1beta2
kind: UsagePlan
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/usageplan
labels:
testing.upbound.io/example-name: stage
name: example-usageplan
spec:
forProvider:
apiStages:
- apiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageSelector:
matchLabels:
testing.upbound.io/example-name: stage
- apiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageSelector:
matchLabels:
testing.upbound.io/example-name: stage
description: my description
name: my-usage-plan
productCode: MYCODE
quotaSettings:
limit: 20
offset: 2
period: WEEK
region: us-west-1
throttleSettings:
burstLimit: 5
rateLimit: 10
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: Deployment
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/usageplan
labels:
testing.upbound.io/example-name: stage
name: stage
spec:
forProvider:
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: RestAPI
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/usageplan
labels:
testing.upbound.io/example-name: stage
name: test-demo
spec:
forProvider:
body: |-
${jsonencode({
openapi = "3.0.1"
info = {
title = "example"
version = "1.0"
}
paths = {
"/path1" = {
get = {
x-amazon-apigateway-integration = {
httpMethod = "GET"
payloadFormatVersion = "1.0"
type = "HTTP_PROXY"
uri = "https://ip-ranges.amazonaws.com/ip-ranges.json"
}
}
}
}
})}
name: test-demo
region: us-west-1
---
apiVersion: apigateway.aws.upbound.io/v1beta2
kind: Stage
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/usageplan
labels:
testing.upbound.io/example-name: stage
name: development
spec:
forProvider:
deploymentIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageName: development
---
apiVersion: apigateway.aws.upbound.io/v1beta1
kind: Stage
metadata:
annotations:
meta.upbound.io/example-id: apigateway/v1beta2/usageplan
labels:
testing.upbound.io/example-name: stage
name: production
spec:
forProvider:
deploymentIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
region: us-west-1
restApiIdSelector:
matchLabels:
testing.upbound.io/example-name: stage
stageName: production

0 comments on commit 32431d7

Please sign in to comment.