Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
834 lines (752 loc) · 44.2 KB
/
Copy pathMakefile
File metadata and controls
834 lines (752 loc) · 44.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
# Floci repo tasks.
#
# Action-table docs: docs/services/*.md "Supported Actions" tables are generated
# from handler source. See tools/docs/.
#
# Service-matrix docs: docs/services/index.md's Service Matrix table is checked
# against ResolvedServiceCatalog.java so a registered service can't ship undocumented.
#
# Partition literals: hardcoded arn:aws: prefixes, amazonaws.com hosts and hosted-zone
# ids in src/main are inventoried against tools/partition/baseline.tsv so the
# commercial-partition assumption can only shrink. See tools/partition/.
#
# AWS partition data: src/main/resources/aws/partitions.json is generated from botocore's
# published partition metadata (plus two CDK region rules) by tools/aws/regen_partitions.py.
# src/main/resources/aws/dynamodb-request-shapes.json is generated from botocore's DynamoDB
# model by tools/aws/regen_dynamodb_shapes.py.
# src/main/resources/aws/redshift-serverless-request-shapes.json is generated from botocore's Redshift
# Serverless model by tools/aws/regen_redshift_serverless_shapes.py.
# API Gateway integration types come from the public service model via tools/aws/regen_apigateway_types.py.
# src/main/resources/aws/sesv2-request-shapes.json is generated from botocore's SES v2 model
# by tools/aws/regen_sesv2_shapes.py.
# src/main/resources/aws/apigateway-request-shapes.json is generated from botocore's API Gateway
# model by tools/aws/regen_apigateway_shapes.py.
# src/main/resources/aws/ecs-request-shapes.json is generated from botocore's ECS model
# by tools/aws/regen_ecs_shapes.py.
# src/main/resources/aws/ecr-request-shapes.json, the ECR request constraints, is generated
# from botocore's ECR model by tools/aws/regen_ecr_shapes.py.
# src/main/resources/aws/payment-cryptography-request-shapes.json, the Payment Cryptography
# request constraints, is generated from botocore's model by
# tools/aws/regen_payment_cryptography_shapes.py.
# src/main/resources/aws/payment-cryptography-data-request-shapes.json, the Payment Cryptography
# data plane request constraints, is generated from botocore's data plane model by
# tools/aws/regen_payment_cryptography_data_shapes.py.
# src/main/resources/aws/rds-ca-certificates.json, each Region's RDS certificate authorities, is
# generated from the certificate bundles AWS publishes by tools/aws/regen_rds_ca_certificates.py.
# src/main/resources/aws/iam-request-shapes.json, the IAM request constraints of the operations
# read from the model, is generated from botocore's IAM model by tools/aws/regen_iam_shapes.py.
# src/main/resources/aws/sts-request-shapes.json, the same for STS, is generated from botocore's
# STS model by tools/aws/regen_sts_shapes.py.
# src/main/resources/aws/emr-serverless-shapes.json, the shapes the Step Functions emr-serverless
# integrations recase against, is generated from botocore's EMR Serverless model by
# tools/aws/regen_emr_serverless_shapes.py.
# src/main/resources/aws/rest-routes.json, the REST routes IamActionRegistry checks a request no rule
# maps by, and IamRestRouteCoverageTest checks the rules against, is generated from botocore's models
# by tools/aws/regen_rest_routes.py. A model it adds also needs make iam-authorized-actions-sync, whose
# check fails until the actions of no resource type list the model's scope.
# src/main/resources/aws/iam-paginators.json, what each paged IAM list pages by, is generated
# from botocore's IAM model and paginators by tools/aws/regen_iam_paginators.py.
PYTHON ?= python3
# Native builds. The binary is built inside the Quarkus builder container (works on macOS,
# yields a Linux binary for the host arch) with the flags CI's compatibility workflow uses:
# -Ob is the quick profile, and -H:-AOTSingleCallsiteInline is required on Mandrel 25.0.4+,
# where Quarkus 3.39 turns single-callsite inlining on and the generated REST invokers for
# AwsQueryController.dispatch and AwsJson11Controller.handle then outgrow the aarch64 branch
# range (BranchTargetOutOfBoundsException). The flag exists only on Mandrel, so it lives here
# and in the workflows rather than in application.yml.
ARCH := $(shell uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')
NATIVE_BUILDER ?= quay.io/quarkus/ubi9-quarkus-mandrel-builder-image:jdk-25
NATIVE_ARGS ?= -Ob,-H:-AOTSingleCallsiteInline
NATIVE_IMAGE ?= floci:local-native
COMPOSE_NATIVE := docker compose -f docker-compose.yml -f docker/compose.native.yml
SUITES ?= sdk-test-java
# Host builds (make native-host): the installed GraalVM or Mandrel, found the way Quarkus finds
# it, GRAALVM_HOME first, then JAVA_HOME, then the PATH. The inlining flag above is unknown to
# GraalVM, so it is added only when that native-image is Mandrel.
comma := ,
NATIVE_IMAGE_BIN = $(or $(wildcard $(GRAALVM_HOME)/bin/native-image),$(wildcard $(JAVA_HOME)/bin/native-image),$(shell command -v native-image 2>/dev/null))
NATIVE_HOST_ARGS ?= -Ob
NATIVE_HOST_FLAGS = $(NATIVE_HOST_ARGS)$(if $(findstring andrel,$(shell "$(NATIVE_IMAGE_BIN)" --version 2>/dev/null)),$(comma)-H:-AOTSingleCallsiteInline)
NATIVE_BIN = $(firstword $(wildcard target/*-runner))
PREFIX ?= $(HOME)/.local
.DEFAULT_GOAL := help
.PHONY: help dev build test native native-host run-native native-install native-image native-up native-down native-logs clean-sidecars clean-volumes compat docker-tests \
docs-sync docs-check docs-test partition-check partition-baseline partition-audit partition-test rename-test \
slr-check slr-table slr-audit slr-test snapshot-mine snapshot-mine-test \
aws-data-sync aws-data-sync-botocore aws-data-check aws-data-check-botocore aws-data-test botocore-bump eks-addons-sync \
iam-namespaces-sync iam-namespaces-check iam-namespaces-verify iam-namespaces-test \
iam-action-resources-sync iam-action-resources-check iam-action-resources-verify \
iam-action-resources-test iam-authorized-actions-sync iam-authorized-actions-check \
cfn-property-types-sync cfn-property-types-check cfn-property-types-verify cfn-property-types-test \
cfn-schema-surface-sync cfn-schema-surface-verify cfn-schema-surface-test \
iam-authorized-actions-verify iam-authorized-actions-test iam-passed-roles-sync iam-passed-roles-check \
iam-passed-roles-verify iam-passed-roles-test iam-passed-network-connectors-sync \
iam-passed-network-connectors-check iam-passed-network-connectors-verify \
iam-passed-network-connectors-test iam-tag-on-create-sync iam-tag-on-create-check \
iam-tag-on-create-verify iam-tag-on-create-test iam-request-resources-sync iam-request-resources-check \
iam-request-resources-verify iam-request-resources-test iam-data-verify
help: ## List the targets below
@grep -hE '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-14s %s\n", $$1, $$2}'
dev: ## Run Floci in Quarkus dev mode (hot reload on port 4566)
./mvnw quarkus:dev
build: ## Build the JVM package without running tests
./mvnw clean package -DskipTests
test: ## Run the test suite; T=Class or T=Class#method narrows it (make test T=SsmIntegrationTest)
./mvnw test $(if $(T),-Dtest='$(T)' -Dsurefire.failIfNoSpecifiedTests=false,)
native: ## Build the native binary with CI's flags and stage it in native/$(ARCH)/ (about 4 min)
./mvnw clean package -Dnative -DskipTests -B \
-Dquarkus.native.container-build=true \
-Dquarkus.native.builder-image=$(NATIVE_BUILDER) \
-Dquarkus.native.additional-build-args-append="$(NATIVE_ARGS)"
mkdir -p native/$(ARCH)
cp target/*-runner native/$(ARCH)/application
# The builder image has no zlib-static, so a container-built binary links zlib dynamically and
# ubi9-micro ships no libz.so.1; stage it next to the binary, where the runtime image's
# LD_LIBRARY_PATH finds it. CI builds with a host Mandrel that links zlib statically.
docker run --rm --entrypoint cat $(NATIVE_BUILDER) /usr/lib64/libz.so.1 > native/$(ARCH)/libz.so.1
native-host: ## Build a native binary for this machine with the installed GraalVM or Mandrel, no Docker: target/floci-<version>-runner
@test -n "$(NATIVE_IMAGE_BIN)" || { echo "native-image not found: install GraalVM or Mandrel (for example 'sdk install java 25.0.3-graal') or set GRAALVM_HOME"; exit 1; }
@echo "native-image: $(NATIVE_IMAGE_BIN) (flags $(NATIVE_HOST_FLAGS))"
./mvnw clean package -Dnative -DskipTests -B \
-Dquarkus.native.additional-build-args-append="$(NATIVE_HOST_FLAGS)"
@echo "built $(NATIVE_BIN) for $$(uname -sm)"
run-native: ## Run the host binary from native-host on port 4566, state under ./data
@test -n "$(NATIVE_BIN)" || { echo "no target/*-runner: run 'make native-host' first"; exit 1; }
@file "$(NATIVE_BIN)" | grep -q ELF && [ "$$(uname -s)" != Linux ] && { echo "$(NATIVE_BIN) is a Linux binary from 'make native'; run 'make native-host' for this machine"; exit 1; } || true
$(NATIVE_BIN)
native-install: ## Copy the host binary to $(PREFIX)/bin/floci-aws (PREFIX defaults to ~/.local); `floci` is the CLI
@test -n "$(NATIVE_BIN)" || { echo "no target/*-runner: run 'make native-host' first"; exit 1; }
mkdir -p $(PREFIX)/bin
cp "$(NATIVE_BIN)" $(PREFIX)/bin/floci-aws
@echo "installed $(PREFIX)/bin/floci-aws"
native-image: ## Package native/$(ARCH)/ as $(NATIVE_IMAGE) with docker/Dockerfile.native-package
@test -f native/$(ARCH)/application || { echo "native/$(ARCH)/application is missing: run 'make native' first"; exit 1; }
docker build -f docker/Dockerfile.native-package --build-arg VERSION=local -t $(NATIVE_IMAGE) .
native-up: ## Start $(NATIVE_IMAGE) with docker compose (docker/compose.native.yml overlay) and wait for health
$(COMPOSE_NATIVE) up -d --no-build
@for i in $$(seq 1 60); do \
curl -fsS -o /dev/null http://localhost:4566/_floci/health 2>/dev/null && { echo "Floci is healthy on http://localhost:4566"; exit 0; }; \
sleep 2; \
done; echo "Floci did not become healthy in time"; $(COMPOSE_NATIVE) logs --tail=40 floci; exit 1
native-down: ## Stop the compose stack started by native-up, then the sidecar containers Floci left behind
$(COMPOSE_NATIVE) down
$(MAKE) clean-sidecars
clean-sidecars: ## Remove the containers Floci started (label floci=true) that outlived it: ECR registry, EC2 instances, RDS, sidecars
@ids=$$(docker ps -aq --filter label=floci=true --filter label=floci_emulator=floci-aws); \
if [ -n "$$ids" ]; then docker rm -f $$ids; else echo "no Floci-managed containers left"; fi
clean-volumes: ## Remove the named volumes Floci created (label floci=true): ECR registry, RDS, OpenSearch and MSK data. Gives the next start a fresh state
@vols=$$(docker volume ls -q --filter label=floci=true --filter label=floci_emulator=floci-aws); \
if [ -n "$$vols" ]; then docker volume rm $$vols; else echo "no Floci-managed volumes left"; fi
native-logs: ## Tail the running Floci container's log
$(COMPOSE_NATIVE) logs -f --tail=100 floci
compat: ## Run compatibility suites against the running Floci: SUITES="sdk-test-java compat-cdk". The suites assume a fresh state: make clean-sidecars clean-volumes before native-up
FLOCI_START=0 COMPAT_SUITES="$(SUITES)" docker/run-docker-tests.sh
docker-tests: ## Start the JVM image with compose and run every compatibility suite in Docker
docker/run-docker-tests.sh
docs-sync: ## Regenerate the action tables in docs/services from handler source (in place)
$(PYTHON) tools/docs/regen_action_docs.py
$(PYTHON) tools/docs/regen_cfn_resource_types.py
docs-check: ## CI gate: regenerate and fail if anything is stale, unregistered, or undocumented
@$(PYTHON) tools/docs/regen_action_docs.py --strict || { \
echo ""; \
echo "error: action-table regeneration reported problems (see warnings above)."; \
exit 1; \
}
@$(PYTHON) tools/docs/regen_cfn_resource_types.py --strict || { \
echo ""; \
echo "error: the CloudFormation resource-type table is stale or reported problems."; \
echo " Run 'make docs-sync' and commit the result."; \
exit 1; \
}
@git diff --exit-code -- docs/ || { \
echo ""; \
echo "error: docs/services action tables are out of date."; \
echo " Run 'make docs-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/docs/check_service_matrix.py --strict || { \
echo ""; \
echo "error: the Service Matrix in docs/services/index.md is out of sync (see warnings above)."; \
exit 1; \
}
@! grep -rn -- '-jvm' docs README.md CONTRIBUTING.md || { \
echo ""; \
echo "error: docs name a '-jvm' image tag; release.yml publishes only x.y.z, latest and their -compat twins."; \
exit 1; \
}
docs-test: ## Run the docs tooling's unit tests
$(PYTHON) -m pytest tools/docs -q
partition-check: ## CI gate: partition literals in src/main must match tools/partition/baseline.tsv
@$(PYTHON) tools/partition/partition_literals.py --check || { \
echo ""; \
echo "error: partition literals drifted from tools/partition/baseline.tsv (see above)."; \
echo " Fix the new literal, or run 'make partition-baseline' after removing some."; \
exit 1; \
}
partition-baseline: ## Regenerate tools/partition/baseline.tsv from the current tree (commit the result)
$(PYTHON) tools/partition/partition_literals.py --write-baseline
partition-audit: ## Print the per-package table of remaining partition literals
@$(PYTHON) tools/partition/partition_literals.py --audit
partition-test: ## Run the partition tooling's unit tests
$(PYTHON) -m pytest tools/partition -q
rename-test: ## Run the package rename tool's unit tests (tools/rename, reuses the partition lexer)
$(PYTHON) -m pytest tools/rename -q
slr-check: ## CI gate: the service-linked role table must match the vendored AWS data
@$(PYTHON) tools/slr/service_linked_roles.py --check || { \
echo ""; \
echo "error: src/main/resources/iam/service-linked-roles.tsv drifted (see above)."; \
echo " Run 'make slr-table SNAPSHOT=<localstack iam snapshot>' and commit the result."; \
exit 1; \
}
slr-table: ## Regenerate the service-linked role table from an AWS-validated snapshot
@test -n "$(SNAPSHOT)" || { \
echo "error: set SNAPSHOT to a LocalStack tests/aws/services/iam/test_iam.snapshot.json"; \
echo " the suffix column can only come from a recorded create"; \
exit 1; \
}
$(PYTHON) tools/slr/service_linked_roles.py --refresh "$(SNAPSHOT)"
slr-audit: ## Print the service-linked role table, marking names that are not derivable
@$(PYTHON) tools/slr/service_linked_roles.py --audit
slr-test: ## Run the service-linked role tooling's unit tests
$(PYTHON) -m pytest tools/slr -q
snapshot-mine: ## Print the answers a LocalStack checkout's AWS-validated snapshots carry (LOCALSTACK=<checkout>)
@test -n "$(LOCALSTACK)" || { \
echo "error: set LOCALSTACK to a LocalStack checkout, which this repository does not vendor"; \
echo " git clone --depth 1 https://github.com/localstack/localstack ../localstack"; \
exit 1; \
}
$(PYTHON) tools/aws-capture/localstack/mine_snapshot_messages.py --localstack "$(LOCALSTACK)" $(MINE_ARGS)
snapshot-mine-test: ## Run the snapshot miner's unit tests
$(PYTHON) -m pytest tools/aws-capture/localstack -q
botocore-bump: ## Bump the botocore pin to VERSION, move local/aws/botocore to that tag and regenerate the botocore-derived AWS data
@test -n "$(VERSION)" || { echo "usage: make botocore-bump VERSION=<botocore release, e.g. 1.43.118>"; exit 2; }
@test -d local/aws/botocore/.git || { echo "error: local/aws/botocore is not checked out"; exit 1; }
@test -z "$$(git -C local/aws/botocore status --porcelain)" || { echo "error: local/aws/botocore has local changes"; exit 1; }
git -C local/aws/botocore fetch --depth 1 --no-tags origin "refs/tags/$(VERSION)"
git -C local/aws/botocore switch --detach --quiet FETCH_HEAD
@grep -q "__version__ = '$(VERSION)'" local/aws/botocore/botocore/__init__.py || { \
echo "error: local/aws/botocore at refs/tags/$(VERSION) does not report version $(VERSION)"; exit 1; }
sed -i.bak 's/^botocore==.*/botocore==$(VERSION)/' tools/aws/requirements.txt && rm tools/aws/requirements.txt.bak
$(MAKE) --no-print-directory aws-data-sync-botocore
$(MAKE) --no-print-directory aws-data-check-botocore
aws-data-sync: ## Regenerate src/main/resources/aws/*.json and the IAM managed-policy catalog from local/aws (commit the result)
$(PYTHON) tools/aws/regen_partitions.py
$(MAKE) --no-print-directory aws-data-sync-botocore
$(PYTHON) tools/aws/regen_region_facts.py
$(PYTHON) tools/aws/regen_rds_ca_certificates.py
$(PYTHON) tools/aws/regen_managed_policies.py
aws-data-sync-botocore: ## Regenerate only the AWS data derived from botocore, so a bump picks up nothing from the other local/aws sources
$(PYTHON) tools/aws/regen_partitions.py --carry-region-flags
$(PYTHON) tools/aws/regen_dynamodb_shapes.py
$(PYTHON) tools/aws/regen_redshift_serverless_shapes.py
$(PYTHON) tools/aws/regen_resource_groups_shapes.py
$(PYTHON) tools/aws/regen_logs_delivery_shapes.py
$(PYTHON) tools/aws/regen_ecr_shapes.py
$(PYTHON) tools/aws/regen_payment_cryptography_shapes.py
$(PYTHON) tools/aws/regen_payment_cryptography_data_shapes.py
$(PYTHON) tools/aws/regen_securityhub_shapes.py
$(PYTHON) tools/aws/regen_iam_shapes.py
$(PYTHON) tools/aws/regen_sts_shapes.py
$(PYTHON) tools/aws/regen_apigateway_types.py
$(PYTHON) tools/aws/regen_sesv2_shapes.py
$(PYTHON) tools/aws/regen_apigateway_shapes.py
$(PYTHON) tools/aws/regen_apigateway_documentation_shapes.py
$(PYTHON) tools/aws/regen_ecs_shapes.py
$(PYTHON) tools/aws/regen_emr_serverless_shapes.py
$(PYTHON) tools/aws/regen_query_services.py
$(PYTHON) tools/aws/regen_rest_routes.py
$(PYTHON) tools/aws/regen_iam_paginators.py
aws-data-check: aws-data-check-botocore ## CI gate: the vendored AWS data must match a fresh generation
@$(PYTHON) tools/aws/regen_partitions.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/partitions.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_region_facts.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/region-facts.json is out of date or malformed."; \
echo " Run 'make aws-data-sync' with local/aws checked out and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_rds_ca_certificates.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/rds-ca-certificates.json is out of date or malformed."; \
echo " Run 'tools/aws/regen_rds_ca_certificates.py --download', then 'make aws-data-sync', and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_managed_policies.py --check || { \
echo ""; \
echo "error: the IAM managed-policy catalog (src/main/resources/iam/managed-polic*) is out of date or malformed."; \
echo " Run 'make aws-data-sync' with local/aws checked out and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_eks_addon_versions.py --check || { \
echo ""; \
echo "error: src/main/resources/eks/addon-versions.json is malformed or misses an add-on or Kubernetes version."; \
echo " Run 'make eks-addons-sync' and commit the result."; \
exit 1; \
}
aws-data-check-botocore: ## The AWS data derived from botocore must match a fresh generation
@$(PYTHON) tools/aws/regen_partitions.py --check --carry-region-flags || { \
echo ""; \
echo "error: src/main/resources/aws/partitions.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_dynamodb_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/dynamodb-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_iam_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_sts_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/sts-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_redshift_serverless_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/redshift-serverless-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_resource_groups_shapes.py --check || { \
echo "error: Resource Groups request shapes are out of date; run 'make aws-data-sync'."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_logs_delivery_shapes.py --check || { \
echo "error: Logs delivery request shapes are out of date; run 'make aws-data-sync'."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_ecr_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/ecr-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_payment_cryptography_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/payment-cryptography-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_payment_cryptography_data_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/payment-cryptography-data-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_securityhub_shapes.py --check || { \
echo "error: Security Hub request shapes are out of date; run 'make aws-data-sync'."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_apigateway_types.py --check || { \
echo "error: API Gateway integration types are out of date; run 'make aws-data-sync'."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_sesv2_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/sesv2-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_apigateway_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/apigateway-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_apigateway_documentation_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/apigateway-documentation-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_ecs_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/ecs-request-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_emr_serverless_shapes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/emr-serverless-shapes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_query_services.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/query-services.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_rest_routes.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/rest-routes.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(PYTHON) tools/aws/regen_iam_paginators.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-paginators.json is out of date."; \
echo " Run 'make aws-data-sync' and commit the result."; \
exit 1; \
}
@$(MAKE) --no-print-directory iam-passed-roles-check
@$(MAKE) --no-print-directory iam-passed-network-connectors-check
@$(MAKE) --no-print-directory iam-tag-on-create-check
@$(MAKE) --no-print-directory iam-request-resources-check
eks-addons-sync: ## Regenerate src/main/resources/eks/addon-versions.json from EKS (needs AWS credentials; commit the result)
$(PYTHON) tools/aws/regen_eks_addon_versions.py
aws-data-test: ## Run the AWS data generators' unit tests
$(PYTHON) -m pytest tools/aws -q
iam-namespaces-sync: ## Regenerate src/main/resources/aws/iam-service-namespaces.json from AWS (commit the result)
$(PYTHON) tools/aws/regen_service_namespaces.py
iam-namespaces-check: ## CI gate (offline): the vendored IAM namespace list must be well-formed
@$(PYTHON) tools/aws/regen_service_namespaces.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-service-namespaces.json is malformed."; \
echo " Run 'make iam-namespaces-sync' and commit the result."; \
exit 1; \
}
iam-namespaces-verify: ## CI gate (online): every vendored IAM namespace must still exist upstream
@$(PYTHON) tools/aws/regen_service_namespaces.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not reach AWS's service reference index, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: the vendored IAM namespace list names a service AWS does not publish."; \
echo " Run 'make iam-namespaces-sync' and commit the result."; \
exit 1; \
fi
iam-namespaces-test: ## Run the IAM namespace generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_service_namespaces.py -q
iam-action-resources-sync: ## Regenerate src/main/resources/aws/iam-action-resources.json from AWS (commit the result)
$(PYTHON) tools/aws/regen_iam_action_resources.py
iam-action-resources-check: ## CI gate (offline): the vendored IAM action resource map must be well-formed
@$(PYTHON) tools/aws/regen_iam_action_resources.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-action-resources.json is malformed."; \
echo " Run 'make iam-action-resources-sync' and commit the result."; \
exit 1; \
}
iam-action-resources-verify: ## CI gate (online): every vendored IAM action resource must match AWS
@$(PYTHON) tools/aws/regen_iam_action_resources.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not reach AWS's IAM service reference, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: the vendored IAM action resource map claims a resource AWS does not use,"; \
echo " so enforcement would authorize against the wrong thing."; \
echo " Run 'make iam-action-resources-sync' and commit the result."; \
exit 1; \
fi
# The paths each upstream check covers: its vendored file, its tests, its generator and every
# module that generator imports. Given CHANGED, the paths a pull request changes, iam-data-verify
# runs only the checks covering one of them, so a pull request is not failed by drift in a file it
# leaves alone; without it, as on the weekly run, it runs every check.
IAM_PASSED_ROLES_GENERATOR := tools/aws/regen_iam_passed_roles.py tools/aws/regen_iam_authorized_actions.py \
tools/aws/regen_partitions.py tools/aws/regen_query_services.py
IAM_NAMESPACES_PATHS := src/main/resources/aws/iam-service-namespaces.json \
tools/aws/regen_service_namespaces.py tools/aws/test_regen_service_namespaces.py
IAM_ACTION_RESOURCES_PATHS := src/main/resources/aws/iam-action-resources.json \
tools/aws/regen_iam_action_resources.py tools/aws/test_regen_iam_action_resources.py
IAM_AUTHORIZED_ACTIONS_PATHS := src/main/resources/aws/iam-authorized-actions.json \
tools/aws/regen_iam_authorized_actions.py tools/aws/test_regen_iam_authorized_actions.py \
src/main/resources/aws/rest-routes.json
IAM_PASSED_ROLES_PATHS := src/main/resources/aws/iam-passed-roles.json $(IAM_PASSED_ROLES_GENERATOR) \
tools/aws/test_regen_iam_passed_roles.py
IAM_PASSED_NETWORK_CONNECTORS_PATHS := src/main/resources/aws/iam-passed-network-connectors.json \
tools/aws/regen_iam_passed_network_connectors.py $(IAM_PASSED_ROLES_GENERATOR) \
tools/aws/test_regen_iam_passed_network_connectors.py
IAM_TAG_ON_CREATE_PATHS := src/main/resources/aws/iam-tag-on-create.json tools/aws/regen_iam_tag_on_create.py \
$(IAM_PASSED_ROLES_GENERATOR) tools/aws/test_regen_iam_tag_on_create.py
DYNAMODB_CONDITION_KEYS_PATHS := src/main/resources/aws/dynamodb-condition-keys.json \
tools/aws/regen_dynamodb_condition_keys.py tools/aws/test_regen_dynamodb_condition_keys.py \
tools/aws/regen_partitions.py tools/aws/regen_query_services.py
IAM_CONDITION_KEYS_PATHS := src/main/resources/aws/iam-condition-keys.json \
tools/aws/regen_iam_condition_keys.py tools/aws/test_regen_iam_condition_keys.py \
tools/aws/regen_partitions.py tools/aws/regen_query_services.py
S3CONTROL_TAG_CONDITION_KEYS_PATHS := src/main/resources/aws/s3control-tag-condition-keys.json \
tools/aws/regen_s3control_tag_condition_keys.py tools/aws/test_regen_s3control_tag_condition_keys.py \
tools/aws/regen_iam_tag_on_create.py $(IAM_PASSED_ROLES_GENERATOR)
REQUEST_CONDITION_KEYS_PATHS := src/main/resources/aws/request-condition-keys.json \
tools/aws/regen_request_condition_keys.py tools/aws/test_regen_request_condition_keys.py \
tools/aws/regen_dynamodb_condition_keys.py tools/aws/regen_iam_tag_on_create.py $(IAM_PASSED_ROLES_GENERATOR)
IAM_REQUEST_RESOURCES_PATHS := src/main/resources/aws/iam-request-resources.json \
tools/aws/regen_iam_request_resources.py $(IAM_PASSED_ROLES_GENERATOR) \
tools/aws/test_regen_iam_request_resources.py
iam-data-verify: ## CI gate (online): every vendored IAM file must still match AWS; CHANGED="<paths>" checks only the ones they cover
@# Every check runs even when an earlier one fails, so one file's drift cannot hide another's
@# state. Sequential steps in CI stop at the first failure, which once left the action
@# resource gate unexercised while the namespace list was stale.
@namespaces=0; actions=0; authorized=0; passed=0; connectors=0; tagged=0; requested=0; dynamodb=0; conditionkeys=0; s3control=0; requestkeys=0; \
covers() { \
[ -z "$(strip $(CHANGED))" ] && return 0; \
for path in $(CHANGED); do case " $$1 " in *" $$path "*) return 0;; esac; done; \
echo "not checked, as the change touches none of its files: $$2"; \
return 1; \
}; \
if covers "$(IAM_NAMESPACES_PATHS)" "the service namespace list"; then \
$(MAKE) --no-print-directory iam-namespaces-verify || namespaces=$$?; \
fi; \
if covers "$(IAM_ACTION_RESOURCES_PATHS)" "the action resource map"; then \
$(MAKE) --no-print-directory iam-action-resources-verify || actions=$$?; \
fi; \
if covers "$(IAM_AUTHORIZED_ACTIONS_PATHS)" "the map of operations to their IAM actions"; then \
$(MAKE) --no-print-directory iam-authorized-actions-verify || authorized=$$?; \
fi; \
if covers "$(IAM_PASSED_ROLES_PATHS)" "the table of the roles operations pass"; then \
$(MAKE) --no-print-directory iam-passed-roles-verify || passed=$$?; \
fi; \
if covers "$(IAM_PASSED_NETWORK_CONNECTORS_PATHS)" "the table of the network connectors operations pass"; then \
$(MAKE) --no-print-directory iam-passed-network-connectors-verify || connectors=$$?; \
fi; \
if covers "$(IAM_TAG_ON_CREATE_PATHS)" "the table of the tagging actions creates need"; then \
$(MAKE) --no-print-directory iam-tag-on-create-verify || tagged=$$?; \
fi; \
if covers "$(IAM_REQUEST_RESOURCES_PATHS)" "the table of the resources requests name"; then \
$(MAKE) --no-print-directory iam-request-resources-verify || requested=$$?; \
fi; \
if covers "$(DYNAMODB_CONDITION_KEYS_PATHS)" "the DynamoDB condition key table"; then \
$(MAKE) --no-print-directory dynamodb-condition-keys-verify || dynamodb=$$?; \
fi; \
if covers "$(IAM_CONDITION_KEYS_PATHS)" "the IAM condition key table"; then \
$(MAKE) --no-print-directory iam-condition-keys-verify || conditionkeys=$$?; \
fi; \
if covers "$(S3CONTROL_TAG_CONDITION_KEYS_PATHS)" "the S3 Control tag condition key table"; then \
$(MAKE) --no-print-directory s3control-tag-condition-keys-verify || s3control=$$?; \
fi; \
if covers "$(REQUEST_CONDITION_KEYS_PATHS)" "the request condition key table"; then \
$(MAKE) --no-print-directory request-condition-keys-verify || requestkeys=$$?; \
fi; \
if [ $$namespaces -ne 0 ] || [ $$actions -ne 0 ] || [ $$authorized -ne 0 ] || [ $$passed -ne 0 ] \
|| [ $$connectors -ne 0 ] || [ $$tagged -ne 0 ] || [ $$requested -ne 0 ] || [ $$dynamodb -ne 0 ] \
|| [ $$conditionkeys -ne 0 ] || [ $$s3control -ne 0 ] || [ $$requestkeys -ne 0 ]; then \
echo ""; \
echo "error: vendored IAM data does not match upstream:"; \
if [ $$namespaces -ne 0 ]; then \
echo " the service namespace list, see its message above"; \
fi; \
if [ $$actions -ne 0 ]; then \
echo " the action resource map, see its message above"; \
fi; \
if [ $$authorized -ne 0 ]; then \
echo " the map of operations to their IAM actions, see its message above"; \
fi; \
if [ $$passed -ne 0 ]; then \
echo " the table of the roles operations pass, see its message above"; \
fi; \
if [ $$connectors -ne 0 ]; then \
echo " the table of the network connectors operations pass, see its message above"; \
fi; \
if [ $$tagged -ne 0 ]; then \
echo " the table of the tagging actions creates need, see its message above"; \
fi; \
if [ $$requested -ne 0 ]; then \
echo " the table of the resources requests name, see its message above"; \
fi; \
if [ $$dynamodb -ne 0 ]; then echo " the DynamoDB condition key table"; fi; \
if [ $$conditionkeys -ne 0 ]; then echo " the IAM condition key table"; fi; \
if [ $$s3control -ne 0 ]; then echo " the S3 Control tag condition key table"; fi; \
if [ $$requestkeys -ne 0 ]; then echo " the request condition key table"; fi; \
exit 1; \
fi
iam-action-resources-test: ## Run the IAM action resource generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_iam_action_resources.py -q
iam-authorized-actions-sync: ## Regenerate src/main/resources/aws/iam-authorized-actions.json from AWS (commit the result)
$(PYTHON) tools/aws/regen_iam_authorized_actions.py
iam-authorized-actions-check: ## CI gate (offline): the vendored map of operations to their IAM actions must be well-formed
@$(PYTHON) tools/aws/regen_iam_authorized_actions.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-authorized-actions.json is malformed."; \
echo " Run 'make iam-authorized-actions-sync' and commit the result."; \
exit 1; \
}
iam-authorized-actions-verify: ## CI gate (online): every vendored operation must still be authorized as AWS says
@$(PYTHON) tools/aws/regen_iam_authorized_actions.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not reach AWS's service reference, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: the vendored map authorizes an operation as an action AWS does not check for it."; \
echo " Run 'make iam-authorized-actions-sync' and commit the result."; \
exit 1; \
fi
iam-authorized-actions-test: ## Run the IAM authorized-action generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_iam_authorized_actions.py -q
iam-passed-roles-sync: ## Regenerate src/main/resources/aws/iam-passed-roles.json from AWS and botocore (commit the result)
$(PYTHON) tools/aws/regen_iam_passed_roles.py
iam-passed-roles-check: ## CI gate (offline): every vendored role member must be what the pinned botocore gives
@$(PYTHON) tools/aws/regen_iam_passed_roles.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-passed-roles.json is malformed or out of date."; \
echo " Run 'make iam-passed-roles-sync' and commit the result."; \
exit 1; \
}
iam-passed-roles-verify: ## CI gate (online): every vendored operation must still pass a role as AWS says
@$(PYTHON) tools/aws/regen_iam_passed_roles.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not reach AWS's service reference, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: the vendored table reads a role from an operation AWS does not pass it from,"; \
echo " or checks it for a service AWS does not pass it to."; \
echo " Run 'make iam-passed-roles-sync' and commit the result."; \
exit 1; \
fi
iam-passed-roles-test: ## Run the IAM passed role generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_iam_passed_roles.py -q
iam-passed-network-connectors-sync: ## Regenerate src/main/resources/aws/iam-passed-network-connectors.json from AWS and botocore (commit the result)
$(PYTHON) tools/aws/regen_iam_passed_network_connectors.py
iam-passed-network-connectors-check: ## CI gate (offline): every vendored connector member must be what the pinned botocore gives
@$(PYTHON) tools/aws/regen_iam_passed_network_connectors.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-passed-network-connectors.json is malformed or out of date."; \
echo " Run 'make iam-passed-network-connectors-sync' and commit the result."; \
exit 1; \
}
iam-passed-network-connectors-verify: ## CI gate (online): every vendored operation must still pass a connector as AWS says
@$(PYTHON) tools/aws/regen_iam_passed_network_connectors.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not reach AWS's service reference, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: the vendored table reads a connector from an operation AWS does not check it for."; \
echo " Run 'make iam-passed-network-connectors-sync' and commit the result."; \
exit 1; \
fi
iam-passed-network-connectors-test: ## Run the IAM passed network connector generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_iam_passed_network_connectors.py -q
iam-tag-on-create-sync: ## Regenerate src/main/resources/aws/iam-tag-on-create.json from AWS and botocore (commit the result)
$(PYTHON) tools/aws/regen_iam_tag_on_create.py
iam-tag-on-create-check: ## CI gate (offline): every vendored tag member must be what the pinned botocore gives
@$(PYTHON) tools/aws/regen_iam_tag_on_create.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-tag-on-create.json is malformed or out of date."; \
echo " Run 'make iam-tag-on-create-sync' and commit the result."; \
exit 1; \
}
iam-tag-on-create-verify: ## CI gate (online): every vendored operation must still need its tagging action as AWS says
@$(PYTHON) tools/aws/regen_iam_tag_on_create.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not reach AWS's service reference, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: the vendored table checks a tagging action for an operation AWS does not check it for."; \
echo " Run 'make iam-tag-on-create-sync' and commit the result."; \
exit 1; \
fi
iam-tag-on-create-test: ## Run the IAM tag-on-create generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_iam_tag_on_create.py -q
iam-request-resources-sync: ## Regenerate src/main/resources/aws/iam-request-resources.json from AWS and botocore (commit the result)
$(PYTHON) tools/aws/regen_iam_request_resources.py
iam-request-resources-check: ## CI gate (offline): every vendored operation's resources must be what the pinned botocore gives
@$(PYTHON) tools/aws/regen_iam_request_resources.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/iam-request-resources.json is malformed or out of date."; \
echo " Run 'make iam-request-resources-sync' and commit the result."; \
exit 1; \
}
iam-request-resources-verify: ## CI gate (online): every vendored operation must still be checked on the resource types AWS gives
@$(PYTHON) tools/aws/regen_iam_request_resources.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not reach AWS's service reference, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: the vendored table checks an operation as an action, or on resource types or"; \
echo " ARN formats, AWS does not give it."; \
echo " Run 'make iam-request-resources-sync' and commit the result."; \
exit 1; \
fi
iam-request-resources-test: ## Run the IAM request resource generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_iam_request_resources.py -q
cfn-property-types-sync: ## Regenerate src/main/resources/aws/cfn-property-types.json from AWS's resource schemas (commit the result)
$(PYTHON) tools/aws/regen_cfn_property_types.py
cfn-property-types-check: ## CI gate (offline): the vendored CloudFormation property types must be well-formed
@$(PYTHON) tools/aws/regen_cfn_property_types.py --check || { \
echo ""; \
echo "error: src/main/resources/aws/cfn-property-types.json is malformed."; \
echo " Run 'make cfn-property-types-sync' and commit the result."; \
exit 1; \
}
cfn-property-types-verify: ## CI gate (online): the vendored CloudFormation property types must still match AWS's schemas
@$(PYTHON) tools/aws/regen_cfn_property_types.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not read AWS's CloudFormation resource schemas, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: AWS has changed a resource schema the vendored property types come from."; \
echo " Run 'make cfn-property-types-sync' and commit the result."; \
exit 1; \
fi
cfn-property-types-test: ## Run the CloudFormation property type generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_cfn_property_types.py -q
cfn-schema-surface-sync: ## Regenerate src/test/resources/cloudformation/schema-surface.tsv from AWS's resource schemas (commit the result)
$(PYTHON) tools/aws/regen_cfn_schema_surface.py
cfn-schema-surface-verify: ## CI gate (online): the committed CloudFormation schema surface must still match AWS's schemas
@$(PYTHON) tools/aws/regen_cfn_schema_surface.py --verify; status=$$?; \
if [ $$status -eq 2 ]; then \
echo ""; \
echo "error: could not read AWS's CloudFormation resource schemas, so nothing was verified."; \
exit 1; \
elif [ $$status -ne 0 ]; then \
echo ""; \
echo "error: AWS has changed a resource schema the CloudFormation schema surface comes from."; \
echo " Run 'make cfn-schema-surface-sync' and commit the result."; \
exit 1; \
fi
cfn-schema-surface-test: ## Run the CloudFormation schema surface generator's unit tests
$(PYTHON) -m pytest tools/aws/test_regen_cfn_schema_surface.py -q
.PHONY: dynamodb-condition-keys-sync dynamodb-condition-keys-check dynamodb-condition-keys-verify
dynamodb-condition-keys-sync: ## Regenerate DynamoDB IAM condition keys from AWS and botocore
$(PYTHON) tools/aws/regen_dynamodb_condition_keys.py
dynamodb-condition-keys-check: ## Check DynamoDB condition request members against pinned botocore
$(PYTHON) tools/aws/regen_dynamodb_condition_keys.py --check
dynamodb-condition-keys-verify: ## Check DynamoDB condition action keys against AWS
$(PYTHON) tools/aws/regen_dynamodb_condition_keys.py --verify
.PHONY: iam-condition-keys-sync iam-condition-keys-check iam-condition-keys-verify
iam-condition-keys-sync: ## Regenerate the IAM condition keys requests carry from AWS and botocore
$(PYTHON) tools/aws/regen_iam_condition_keys.py
iam-condition-keys-check: ## Check the IAM condition key request members against pinned botocore
$(PYTHON) tools/aws/regen_iam_condition_keys.py --check
iam-condition-keys-verify: ## Check every IAM condition key and action pair against AWS
$(PYTHON) tools/aws/regen_iam_condition_keys.py --verify
.PHONY: s3control-tag-condition-keys-sync s3control-tag-condition-keys-check s3control-tag-condition-keys-verify
s3control-tag-condition-keys-sync: ## Regenerate the S3 Control tag condition keys from AWS and botocore
$(PYTHON) tools/aws/regen_s3control_tag_condition_keys.py
s3control-tag-condition-keys-check: ## Check the S3 Control tag condition request members against pinned botocore
$(PYTHON) tools/aws/regen_s3control_tag_condition_keys.py --check
s3control-tag-condition-keys-verify: ## Check the S3 Control tag condition action keys against AWS
$(PYTHON) tools/aws/regen_s3control_tag_condition_keys.py --verify
.PHONY: request-condition-keys-sync request-condition-keys-check request-condition-keys-verify
request-condition-keys-sync: ## Regenerate the Lambda Web and Redshift request condition keys from AWS and botocore
$(PYTHON) tools/aws/regen_request_condition_keys.py
request-condition-keys-check: ## Check the request condition key members against pinned botocore
$(PYTHON) tools/aws/regen_request_condition_keys.py --check
request-condition-keys-verify: ## Check the request condition action keys against AWS
$(PYTHON) tools/aws/regen_request_condition_keys.py --verify