Skip to content

Commit cf2b660

Browse files
committed
More CIDR restrictions fixes
1 parent ce23b6a commit cf2b660

9 files changed

Lines changed: 140 additions & 158 deletions

File tree

manifests/modules/automation/continuousdelivery/codepipeline/.workshop/terraform/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,11 @@ resource "kubernetes_manifest" "ui_alb" {
316316
"alb.ingress.kubernetes.io/scheme" = "internet-facing"
317317
"alb.ingress.kubernetes.io/target-type" = "ip"
318318
"alb.ingress.kubernetes.io/healthcheck-path" = "/actuator/health/liveness"
319+
"alb.ingress.kubernetes.io/inbound-cidrs" = var.inbound_cidrs
319320
}
320321
}
321322
"spec" = {
322-
ingressClassName = "alb",
323+
"ingressClassName" = "alb",
323324
"rules" = [{
324325
"http" = {
325326
paths = [{

manifests/modules/automation/controlplanes/kro/.workshop/terraform/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ resource "kubernetes_manifest" "ui_alb" {
6767
"alb.ingress.kubernetes.io/scheme" = "internet-facing"
6868
"alb.ingress.kubernetes.io/target-type" = "ip"
6969
"alb.ingress.kubernetes.io/healthcheck-path" = "/actuator/health/liveness"
70+
"alb.ingress.kubernetes.io/inbound-cidrs" = var.inbound_cidrs
7071
}
7172
}
7273
"spec" = {
73-
ingressClassName = "alb",
74+
"ingressClassName" = "alb",
7475
"rules" = [{
7576
"http" = {
7677
paths = [{

manifests/modules/automation/controlplanes/kro/.workshop/terraform/templates/nlb.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

manifests/modules/automation/controlplanes/kro/app/carts-ddb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ spec:
1818
RETAIL_CART_PERSISTENCE_DYNAMODB_TABLE_NAME: "eks-workshop-carts-kro"
1919

2020
aws:
21-
accountID: ${AWS_ACCOUNT_ID}
21+
accountID: "${AWS_ACCOUNT_ID}"
2222
region: ${AWS_REGION}

manifests/modules/automation/controlplanes/kro/rgds/webapp-dynamodb-rgd.yaml

Lines changed: 131 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -37,142 +37,142 @@ spec:
3737
groupname: string | default="eks-workshop"
3838

3939
resources:
40-
- id: podIdentityAssociation
41-
template:
42-
apiVersion: eks.services.k8s.aws/v1alpha1
43-
kind: PodIdentityAssociation
44-
metadata:
45-
name: ${schema.spec.appName}
46-
namespace: ${schema.spec.appName}
47-
spec:
48-
clusterName: "eks-workshop"
49-
namespace: ${schema.spec.appName}
50-
serviceAccount: ${schema.spec.appName}
51-
roleARN: ${itemsTableIAMRole.status.ackResourceMetadata.arn}
40+
- id: podIdentityAssociation
41+
template:
42+
apiVersion: eks.services.k8s.aws/v1alpha1
43+
kind: PodIdentityAssociation
44+
metadata:
45+
name: ${schema.spec.appName}
46+
namespace: ${schema.spec.appName}
47+
spec:
48+
clusterName: "eks-workshop"
49+
namespace: ${schema.spec.appName}
50+
serviceAccount: ${schema.spec.appName}
51+
roleARN: ${itemsTableIAMRole.status.ackResourceMetadata.arn}
5252

53-
- id: webApplication
54-
template:
55-
apiVersion: kro.run/v1alpha1
56-
kind: WebApplication
57-
metadata:
58-
name: ${schema.spec.appName}
59-
namespace: ${schema.spec.appName}
60-
spec:
61-
appName: ${schema.spec.appName}
62-
replicas: 1
63-
image: ${schema.spec.image}
64-
port: 8080
65-
healthcheck:
66-
readinessPath: ${schema.spec.healthcheck.readinessPath}
67-
readinessPort: ${schema.spec.healthcheck.readinessPort}
68-
livenessPath: ${schema.spec.healthcheck.livenessPath}
69-
livenessPort: ${schema.spec.healthcheck.livenessPort}
53+
- id: webApplication
54+
template:
55+
apiVersion: kro.run/v1alpha1
56+
kind: WebApplication
57+
metadata:
58+
name: ${schema.spec.appName}
59+
namespace: ${schema.spec.appName}
60+
spec:
61+
appName: ${schema.spec.appName}
62+
replicas: 1
63+
image: ${schema.spec.image}
64+
port: 8080
65+
healthcheck:
66+
readinessPath: ${schema.spec.healthcheck.readinessPath}
67+
readinessPort: ${schema.spec.healthcheck.readinessPort}
68+
livenessPath: ${schema.spec.healthcheck.livenessPath}
69+
livenessPort: ${schema.spec.healthcheck.livenessPort}
7070

71-
service:
72-
enabled: ${schema.spec.service.enabled}
73-
iamRole: ${podIdentityAssociation.status.ackResourceMetadata.arn}
71+
service:
72+
enabled: ${schema.spec.service.enabled}
73+
iamRole: ${podIdentityAssociation.status.ackResourceMetadata.arn}
7474

75-
env: ${schema.spec.env}
75+
env: ${schema.spec.env}
7676

77-
ingress:
78-
enabled: ${schema.spec.ingress.enabled}
79-
path: ${schema.spec.ingress.path}
80-
healthcheckPath: ${schema.spec.ingress.healthcheckPath}
81-
groupname: ${schema.spec.ingress.groupname}
77+
ingress:
78+
enabled: ${schema.spec.ingress.enabled}
79+
path: ${schema.spec.ingress.path}
80+
healthcheckPath: ${schema.spec.ingress.healthcheckPath}
81+
groupname: ${schema.spec.ingress.groupname}
8282

83-
- id: serviceDDB
84-
template:
85-
apiVersion: v1
86-
kind: Service
87-
metadata:
88-
name: carts-dynamodb
89-
labels:
90-
app.kubernetes.io/created-by: eks-workshop
91-
spec:
92-
type: ClusterIP
93-
ports:
94-
- port: 8000
95-
targetPort: dynamodb
96-
protocol: TCP
97-
name: dynamodb
98-
selector:
99-
app.kubernetes.io/name: ${schema.spec.appName}
100-
app.kubernetes.io/instance: ${schema.spec.appName}
101-
app.kubernetes.io/component: dynamodb
83+
- id: serviceDDB
84+
template:
85+
apiVersion: v1
86+
kind: Service
87+
metadata:
88+
name: carts-dynamodb
89+
labels:
90+
app.kubernetes.io/created-by: eks-workshop
91+
spec:
92+
type: ClusterIP
93+
ports:
94+
- port: 8000
95+
targetPort: dynamodb
96+
protocol: TCP
97+
name: dynamodb
98+
selector:
99+
app.kubernetes.io/name: ${schema.spec.appName}
100+
app.kubernetes.io/instance: ${schema.spec.appName}
101+
app.kubernetes.io/component: dynamodb
102102

103-
- id: itemsTable
104-
template:
105-
apiVersion: dynamodb.services.k8s.aws/v1alpha1
106-
kind: Table
107-
metadata:
108-
name: items
109-
namespace: ${schema.spec.appName}
110-
spec:
111-
keySchema:
112-
- attributeName: id
113-
keyType: HASH
114-
attributeDefinitions:
115-
- attributeName: id
116-
attributeType: "S"
117-
- attributeName: customerId
118-
attributeType: "S"
119-
billingMode: PAY_PER_REQUEST
120-
tableName: ${schema.spec.dynamodb.tableName}
121-
globalSecondaryIndexes:
122-
- indexName: idx_global_customerId
103+
- id: itemsTable
104+
template:
105+
apiVersion: dynamodb.services.k8s.aws/v1alpha1
106+
kind: Table
107+
metadata:
108+
name: items
109+
namespace: ${schema.spec.appName}
110+
spec:
123111
keySchema:
124-
- attributeName: customerId
125-
keyType: HASH
126-
- attributeName: id
127-
keyType: RANGE
128-
projection:
129-
projectionType: "ALL"
130-
- id: itemsTableIamPolicy
131-
template:
132-
apiVersion: iam.services.k8s.aws/v1alpha1
133-
kind: Policy
134-
metadata:
135-
name: ${itemsTable.spec.tableName}-iam-policy
136-
spec:
137-
name: ${itemsTable.spec.tableName}-iam-policy
138-
description: "EKS Workshop Carts DynamoDB Policy"
139-
policyDocument: >
140-
{
141-
"Version": "2012-10-17",
142-
"Statement": [
143-
{
144-
"Sid": "AllAPIActionsOnCart",
145-
"Effect": "Allow",
146-
"Action": "dynamodb:*",
147-
"Resource": [
148-
"arn:aws:dynamodb:${schema.spec.aws.region}:${schema.spec.aws.accountID}:table/${itemsTable.spec.tableName}",
149-
"arn:aws:dynamodb:${schema.spec.aws.region}:${schema.spec.aws.accountID}:table/${itemsTable.spec.tableName}/index/*"
150-
]
151-
}
152-
]
153-
}
154-
- id: itemsTableIAMRole
155-
template:
156-
apiVersion: iam.services.k8s.aws/v1alpha1
157-
kind: Role
158-
metadata:
159-
name: ${itemsTable.spec.tableName}-iam-role
160-
namespace: ${schema.spec.appName}
161-
spec:
162-
name: ${itemsTable.spec.tableName}-iam-role
163-
description: "EKS Workshop Carts DynamoDB Role"
164-
maxSessionDuration: 3600
165-
policies:
166-
- ${itemsTableIamPolicy.status.ackResourceMetadata.arn}
167-
assumeRolePolicyDocument: >
168-
{
169-
"Version":"2012-10-17",
170-
"Statement": [{
171-
"Effect":"Allow",
172-
"Principal": {"Service": "pods.eks.amazonaws.com"},
173-
"Action": [
174-
"sts:TagSession",
175-
"sts:AssumeRole"
112+
- attributeName: id
113+
keyType: HASH
114+
attributeDefinitions:
115+
- attributeName: id
116+
attributeType: "S"
117+
- attributeName: customerId
118+
attributeType: "S"
119+
billingMode: PAY_PER_REQUEST
120+
tableName: ${schema.spec.dynamodb.tableName}
121+
globalSecondaryIndexes:
122+
- indexName: idx_global_customerId
123+
keySchema:
124+
- attributeName: customerId
125+
keyType: HASH
126+
- attributeName: id
127+
keyType: RANGE
128+
projection:
129+
projectionType: "ALL"
130+
- id: itemsTableIamPolicy
131+
template:
132+
apiVersion: iam.services.k8s.aws/v1alpha1
133+
kind: Policy
134+
metadata:
135+
name: ${itemsTable.spec.tableName}-iam-policy
136+
spec:
137+
name: ${itemsTable.spec.tableName}-iam-policy
138+
description: "EKS Workshop Carts DynamoDB Policy"
139+
policyDocument: >
140+
{
141+
"Version": "2012-10-17",
142+
"Statement": [
143+
{
144+
"Sid": "AllAPIActionsOnCart",
145+
"Effect": "Allow",
146+
"Action": "dynamodb:*",
147+
"Resource": [
148+
"arn:aws:dynamodb:${schema.spec.aws.region}:${string(schema.spec.aws.accountID)}:table/${itemsTable.spec.tableName}",
149+
"arn:aws:dynamodb:${schema.spec.aws.region}:${string(schema.spec.aws.accountID)}:table/${itemsTable.spec.tableName}/index/*"
150+
]
151+
}
176152
]
177-
}]
178-
}
153+
}
154+
- id: itemsTableIAMRole
155+
template:
156+
apiVersion: iam.services.k8s.aws/v1alpha1
157+
kind: Role
158+
metadata:
159+
name: ${itemsTable.spec.tableName}-iam-role
160+
namespace: ${schema.spec.appName}
161+
spec:
162+
name: ${itemsTable.spec.tableName}-iam-role
163+
description: "EKS Workshop Carts DynamoDB Role"
164+
maxSessionDuration: 3600
165+
policies:
166+
- ${itemsTableIamPolicy.status.ackResourceMetadata.arn}
167+
assumeRolePolicyDocument: >
168+
{
169+
"Version":"2012-10-17",
170+
"Statement": [{
171+
"Effect":"Allow",
172+
"Principal": {"Service": "pods.eks.amazonaws.com"},
173+
"Action": [
174+
"sts:TagSession",
175+
"sts:AssumeRole"
176+
]
177+
}]
178+
}

manifests/modules/autoscaling/workloads/keda/.workshop/terraform/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "kubernetes_manifest" "ui_alb" {
5353
}
5454
}
5555
"spec" = {
56-
ingressClassName = "alb",
56+
"ingressClassName" = "alb",
5757
"rules" = [{
5858
"http" = {
5959
paths = [{

manifests/modules/observability/resiliency/.workshop/terraform/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ resource "kubernetes_manifest" "ui_alb" {
4242
}
4343
}
4444
"spec" = {
45-
ingressClassName = "alb",
45+
"ingressClassName" = "alb",
4646
"rules" = [{
4747
"http" = {
4848
paths = [{

website/docs/automation/controlplanes/kro/cloud-dynamodb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Now we can wait until the instance has reached a "synced" state:
9090

9191
```bash
9292
$ kubectl wait -o yaml webapplicationdynamodb/carts -n carts \
93-
--for=condition=InstanceSynced=True --timeout=120s
93+
--for=condition=ResourcesReady=True --timeout=120s
9494
```
9595

9696
To verify that the DynamoDB table has been created, we can check the generated ACK resource:

website/docs/automation/controlplanes/kro/provision-resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Now we can wait until the instance has reached a "synced" state:
8787

8888
```bash
8989
$ kubectl wait -o yaml webapplication/carts -n carts \
90-
--for=condition=InstanceSynced=True --timeout=120s
90+
--for=condition=ResourcesReady=True --timeout=120s
9191
```
9292

9393
Next, verify the components of the RGD are running:

0 commit comments

Comments
 (0)