@intentius/chant-lexicon-aws 0.124.31 → 0.124.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/dynamodb.js +41 -0
- package/dist/actions/ecr.js +9 -0
- package/dist/actions/ecs.js +5 -0
- package/dist/actions/iam.js +3 -0
- package/dist/actions/index.js +9 -0
- package/dist/actions/lambda.js +11 -0
- package/dist/actions/logs.js +4 -0
- package/dist/actions/s3.js +40 -0
- package/dist/actions/sns.js +5 -0
- package/dist/actions/sqs.js +15 -0
- package/dist/agentcore/trace-fetch.d.ts.map +1 -1
- package/dist/agentcore/trace-fetch.js +472 -0
- package/dist/agentcore/trace-render.js +359 -0
- package/dist/ambient.js +148 -0
- package/dist/api/credential-chain.d.ts +30 -3
- package/dist/api/credential-chain.d.ts.map +1 -1
- package/dist/api/credential-chain.js +509 -0
- package/dist/api/read-client.d.ts +16 -43
- package/dist/api/read-client.d.ts.map +1 -1
- package/dist/api/read-client.js +458 -0
- package/dist/api/sigv4.d.ts +4 -4
- package/dist/api/sigv4.js +185 -0
- package/dist/behaviour-kinds.js +114 -0
- package/dist/caller-identity.d.ts +3 -5
- package/dist/caller-identity.d.ts.map +1 -1
- package/dist/caller-identity.js +146 -0
- package/dist/codegen/docs-cli.js +2 -0
- package/dist/codegen/docs.js +120 -0
- package/dist/codegen/enum-overlay.js +162 -0
- package/dist/codegen/extensions.js +139 -0
- package/dist/codegen/fallback.js +32 -0
- package/dist/codegen/generate-cli.js +15 -0
- package/dist/codegen/generate-lexicon.js +70 -0
- package/dist/codegen/generate-typescript.js +226 -0
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/generate.js +234 -0
- package/dist/codegen/naming.js +135 -0
- package/dist/codegen/package.js +67 -0
- package/dist/codegen/patches.d.ts +26 -1
- package/dist/codegen/patches.d.ts.map +1 -1
- package/dist/codegen/patches.js +90 -0
- package/dist/codegen/property-overlay.js +85 -0
- package/dist/codegen/property-overlay.json +1 -16
- package/dist/codegen/sam.js +402 -0
- package/dist/codegen/typecheck.js +4 -0
- package/dist/codegen/versions.js +31 -0
- package/dist/components/__tests__/mock-cloud-executor.js +326 -0
- package/dist/components/apply.d.ts +44 -1
- package/dist/components/apply.d.ts.map +1 -1
- package/dist/components/apply.js +752 -0
- package/dist/components/builders.js +37 -0
- package/dist/components/capability-plugin.js +66 -0
- package/dist/components/cloud-executor.d.ts +35 -0
- package/dist/components/cloud-executor.d.ts.map +1 -1
- package/dist/components/cloud-executor.js +576 -0
- package/dist/components/config-bom.js +207 -0
- package/dist/components/host-delivery.js +117 -0
- package/dist/components/index.js +18 -0
- package/dist/components/job-submission.js +77 -0
- package/dist/components/publish.js +234 -0
- package/dist/components/safety.js +62 -0
- package/dist/components/wait-aws.js +68 -0
- package/dist/composites/agentcore-agent.js +187 -0
- package/dist/composites/agentcore-trust-policy.js +13 -0
- package/dist/composites/alb-shared.js +84 -0
- package/dist/composites/bucket-deployment.js +93 -0
- package/dist/composites/catalog.js +2714 -0
- package/dist/composites/dynamodb-table.js +66 -0
- package/dist/composites/ec2-instance-bundle.js +75 -0
- package/dist/composites/ec2-instance-role.js +26 -0
- package/dist/composites/ecr-repository.js +64 -0
- package/dist/composites/ecs-trust-policy.js +10 -0
- package/dist/composites/efs-with-access-point.js +44 -0
- package/dist/composites/eks-cluster.js +118 -0
- package/dist/composites/fargate-alb.js +216 -0
- package/dist/composites/fargate-service.js +222 -0
- package/dist/composites/index.js +28 -0
- package/dist/composites/lambda-api.js +15 -0
- package/dist/composites/lambda-dynamodb.js +77 -0
- package/dist/composites/lambda-eventbridge.js +27 -0
- package/dist/composites/lambda-function.js +54 -0
- package/dist/composites/lambda-s3.js +93 -0
- package/dist/composites/lambda-sns.js +23 -0
- package/dist/composites/lambda-sqs.js +34 -0
- package/dist/composites/landing-zone.js +82 -0
- package/dist/composites/microvm-app.js +293 -0
- package/dist/composites/minimal-vpc.js +40 -0
- package/dist/composites/monitoring-stack.js +105 -0
- package/dist/composites/nlb-service.js +61 -0
- package/dist/composites/rds-instance.js +98 -0
- package/dist/composites/scheduled-lambda.js +28 -0
- package/dist/composites/solr-fargate-service.js +33 -0
- package/dist/composites/step-functions-workflow.js +78 -0
- package/dist/composites/vpc-default.js +132 -0
- package/dist/condition.js +43 -0
- package/dist/coverage.js +4 -0
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/deep-observe.js +709 -0
- package/dist/deep-topology.js +226 -0
- package/dist/default-tags.js +50 -0
- package/dist/defaults.js +85 -0
- package/dist/dependencies.js +269 -0
- package/dist/detect.js +21 -0
- package/dist/disruption.d.ts.map +1 -1
- package/dist/disruption.js +129 -0
- package/dist/effect-receipt-row.js +107 -0
- package/dist/generated/index.d.ts +1297 -82
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +12382 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/governance.js +131 -0
- package/dist/identity-observe.d.ts.map +1 -1
- package/dist/identity-observe.js +127 -0
- package/dist/import/generator.js +757 -0
- package/dist/import/live-export.js +34 -0
- package/dist/import/parser.js +394 -0
- package/dist/index.js +69 -0
- package/dist/integrity.json +6 -6
- package/dist/intrinsics.js +393 -0
- package/dist/lint/audit-catalog.js +87 -0
- package/dist/lint/audit-lineage.js +150 -0
- package/dist/lint/post-synth/cf-refs.js +247 -0
- package/dist/lint/post-synth/cor020.js +60 -0
- package/dist/lint/post-synth/ext001.d.ts.map +1 -1
- package/dist/lint/post-synth/ext001.js +197 -0
- package/dist/lint/post-synth/index.js +124 -0
- package/dist/lint/post-synth/waw010.js +41 -0
- package/dist/lint/post-synth/waw011.js +41 -0
- package/dist/lint/post-synth/waw013.js +38 -0
- package/dist/lint/post-synth/waw014.js +42 -0
- package/dist/lint/post-synth/waw015.js +88 -0
- package/dist/lint/post-synth/waw016.d.ts.map +1 -1
- package/dist/lint/post-synth/waw016.js +116 -0
- package/dist/lint/post-synth/waw017.js +43 -0
- package/dist/lint/post-synth/waw018.js +61 -0
- package/dist/lint/post-synth/waw019.js +64 -0
- package/dist/lint/post-synth/waw020.js +56 -0
- package/dist/lint/post-synth/waw021.js +44 -0
- package/dist/lint/post-synth/waw022.js +36 -0
- package/dist/lint/post-synth/waw023.js +40 -0
- package/dist/lint/post-synth/waw024.js +46 -0
- package/dist/lint/post-synth/waw025.js +36 -0
- package/dist/lint/post-synth/waw026.js +38 -0
- package/dist/lint/post-synth/waw027.js +41 -0
- package/dist/lint/post-synth/waw028.js +39 -0
- package/dist/lint/post-synth/waw029.js +54 -0
- package/dist/lint/post-synth/waw030.js +282 -0
- package/dist/lint/post-synth/waw031.js +58 -0
- package/dist/lint/post-synth/waw032.js +45 -0
- package/dist/lint/post-synth/waw033.js +75 -0
- package/dist/lint/post-synth/waw034.js +52 -0
- package/dist/lint/post-synth/waw035.js +56 -0
- package/dist/lint/post-synth/waw036.js +79 -0
- package/dist/lint/post-synth/waw037.js +67 -0
- package/dist/lint/post-synth/waw038.js +42 -0
- package/dist/lint/post-synth/waw039.js +42 -0
- package/dist/lint/post-synth/waw040.js +45 -0
- package/dist/lint/post-synth/waw041.js +40 -0
- package/dist/lint/post-synth/waw042.js +99 -0
- package/dist/lint/post-synth/waw043.js +51 -0
- package/dist/lint/post-synth/waw044.js +64 -0
- package/dist/lint/post-synth/waw045.js +49 -0
- package/dist/lint/post-synth/waw046.js +52 -0
- package/dist/lint/post-synth/waw047.js +43 -0
- package/dist/lint/post-synth/waw048.js +40 -0
- package/dist/lint/post-synth/waw049.js +78 -0
- package/dist/lint/post-synth/waw050.js +44 -0
- package/dist/lint/post-synth/waw051.js +41 -0
- package/dist/lint/post-synth/waw052.js +43 -0
- package/dist/lint/post-synth/waw053.js +43 -0
- package/dist/lint/post-synth/waw054.js +41 -0
- package/dist/lint/post-synth/waw055.js +41 -0
- package/dist/lint/post-synth/waw056.js +65 -0
- package/dist/lint/post-synth/waw057.js +43 -0
- package/dist/lint/post-synth/waw058.js +61 -0
- package/dist/lint/post-synth/waw059.js +338 -0
- package/dist/lint/post-synth/waw060.js +83 -0
- package/dist/lint/post-synth/waw061.js +60 -0
- package/dist/lint/post-synth/waw062.js +0 -0
- package/dist/lint/post-synth/waw063.js +0 -0
- package/dist/lint/post-synth/waw064.js +45 -0
- package/dist/lint/post-synth/waw065.js +104 -0
- package/dist/lint/post-synth/waw066.js +145 -0
- package/dist/lint/post-synth/waw067.js +115 -0
- package/dist/lint/post-synth/waw068.js +69 -0
- package/dist/lint/post-synth/waw069.js +0 -0
- package/dist/lint/rules/hardcoded-region.js +38 -0
- package/dist/lint/rules/iam-wildcard.js +60 -0
- package/dist/lint/rules/index.js +6 -0
- package/dist/lint/rules/s3-encryption.js +60 -0
- package/dist/live-attrs.js +42 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +18 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +66 -0
- package/dist/manifest.json +1 -1
- package/dist/mapping.js +33 -0
- package/dist/meta.json +17359 -784
- package/dist/nested-stack.js +95 -0
- package/dist/okf/index.md +203 -0
- package/dist/okf/rules/EXT001.md +1 -0
- package/dist/okf/rules/WAW016.md +2 -0
- package/dist/okf/rules/WAW019.md +1 -0
- package/dist/okf/rules/WAW028.md +1 -0
- package/dist/okf/rules/WAW030.md +2 -0
- package/dist/okf/rules/WAW039.md +1 -0
- package/dist/okf/rules/WAW049.md +1 -0
- package/dist/okf/rules/WAW056.md +1 -0
- package/dist/okf/rules/WAW058.md +1 -0
- package/dist/okf/rules/WAW062.md +1 -0
- package/dist/okf/rules/WAW064.md +1 -0
- package/dist/okf/rules/WAW065.md +1 -0
- package/dist/okf/rules/WAW066.md +1 -0
- package/dist/okf/rules/WAW067.md +1 -0
- package/dist/okf/rules/WAW068.md +1 -0
- package/dist/okf/rules/WAW069.md +4 -0
- package/dist/okf/types/AIWorkloadConfig.md +23 -0
- package/dist/okf/types/ARCRegionSwitchPlan.md +1 -0
- package/dist/okf/types/AccountAccessApplication.md +28 -0
- package/dist/okf/types/AccountAccessEntitlement.md +22 -0
- package/dist/okf/types/ActionTarget.md +20 -0
- package/dist/okf/types/AdConfiguration.md +21 -0
- package/dist/okf/types/Adapter.md +26 -0
- package/dist/okf/types/AgentContext.md +35 -0
- package/dist/okf/types/AgentGoal.md +31 -0
- package/dist/okf/types/AgentProfile.md +34 -0
- package/dist/okf/types/Alarm.md +3 -1
- package/dist/okf/types/AlarmModel.md +14 -9
- package/dist/okf/types/AmplifyWebhook.md +25 -0
- package/dist/okf/types/ApiCache.md +8 -8
- package/dist/okf/types/ApiGatewayManagedOverrides.md +5 -5
- package/dist/okf/types/AppAuthorization.md +35 -0
- package/dist/okf/types/AppBlockBuilder.md +1 -0
- package/dist/okf/types/AppInstance.md +2 -2
- package/dist/okf/types/AppInstanceBot.md +2 -2
- package/dist/okf/types/AppStreamFleet.md +3 -2
- package/dist/okf/types/AppSyncApiKey.md +6 -6
- package/dist/okf/types/AppSyncType.md +22 -0
- package/dist/okf/types/ApplicationStatusCheck.md +36 -0
- package/dist/okf/types/ApplicationVersion.md +4 -1
- package/dist/okf/types/ApplicationsList.md +26 -0
- package/dist/okf/types/ApprovalPolicy.md +28 -0
- package/dist/okf/types/ArchiveRule.md +24 -0
- package/dist/okf/types/Asset.md +30 -0
- package/dist/okf/types/Backup.md +31 -0
- package/dist/okf/types/BedrockAgentCoreDataset.md +1 -1
- package/dist/okf/types/BedrockAgentCoreGateway.md +3 -0
- package/dist/okf/types/BedrockSession.md +28 -0
- package/dist/okf/types/BillEstimate.md +35 -0
- package/dist/okf/types/Brand.md +32 -0
- package/dist/okf/types/CallAnalyticsCategory.md +25 -0
- package/dist/okf/types/Campaign.md +28 -0
- package/dist/okf/types/CapacityProvider.md +30 -0
- package/dist/okf/types/Case.md +24 -0
- package/dist/okf/types/CertificateAssociation.md +13 -0
- package/dist/okf/types/ChangeSet.md +36 -0
- package/dist/okf/types/ChannelFlow.md +29 -0
- package/dist/okf/types/ChimeChannel.md +39 -0
- package/dist/okf/types/Classifier.md +6 -6
- package/dist/okf/types/ClientVpnAuthorizationRule.md +6 -6
- package/dist/okf/types/ClientVpnEndpoint.md +2 -0
- package/dist/okf/types/ClientVpnRoute.md +5 -5
- package/dist/okf/types/CloudConnector.md +29 -0
- package/dist/okf/types/Cluster.md +39 -0
- package/dist/okf/types/ClusterSchedulerConfig.md +30 -0
- package/dist/okf/types/CodeCommitRepository.md +12 -12
- package/dist/okf/types/CodeConnectionsHost.md +26 -0
- package/dist/okf/types/CodeRepository.md +5 -5
- package/dist/okf/types/CompositeAlarm.md +1 -0
- package/dist/okf/types/ComputeEnvironment.md +2 -0
- package/dist/okf/types/ComputeNodeGroup.md +1 -1
- package/dist/okf/types/ComputeQuota.md +34 -0
- package/dist/okf/types/ConfigRule.md +1 -1
- package/dist/okf/types/ConfigurationRecorder.md +7 -6
- package/dist/okf/types/ConnectAttachment.md +2 -0
- package/dist/okf/types/ConnectQueue.md +5 -1
- package/dist/okf/types/ConnectVocabulary.md +28 -0
- package/dist/okf/types/ConnectionType.md +24 -0
- package/dist/okf/types/ConsentPortal.md +33 -0
- package/dist/okf/types/ContactMethod.md +29 -0
- package/dist/okf/types/ContainerAssociation.md +26 -0
- package/dist/okf/types/ContainerFleet.md +1 -1
- package/dist/okf/types/ContainerGroupDefinition.md +1 -1
- package/dist/okf/types/Content.md +40 -0
- package/dist/okf/types/ContentAssociation.md +28 -0
- package/dist/okf/types/CustomDetectionRuleAssociation.md +28 -0
- package/dist/okf/types/CustomEntityType.md +4 -9
- package/dist/okf/types/Customization.md +22 -0
- package/dist/okf/types/CwIntegration.md +31 -0
- package/dist/okf/types/DAXParameterGroup.md +3 -8
- package/dist/okf/types/DAXSubnetGroup.md +0 -5
- package/dist/okf/types/DBClusterEndpoint.md +31 -0
- package/dist/okf/types/DBProxyTargetGroup.md +1 -0
- package/dist/okf/types/DBSnapshot.md +62 -0
- package/dist/okf/types/DLMLifecyclePolicy.md +12 -12
- package/dist/okf/types/DLPSetting.md +31 -0
- package/dist/okf/types/DMSInstanceProfile.md +1 -1
- package/dist/okf/types/DRSLaunchConfigurationTemplate.md +28 -0
- package/dist/okf/types/Daemon.md +1 -0
- package/dist/okf/types/DataExchangeDataSet.md +29 -0
- package/dist/okf/types/DataIntegrationFlow.md +27 -0
- package/dist/okf/types/DataMigration.md +1 -1
- package/dist/okf/types/DataProvider.md +2 -1
- package/dist/okf/types/DataQualityRuleset.md +6 -11
- package/dist/okf/types/DataSource.md +23 -0
- package/dist/okf/types/Dataset.md +20 -0
- package/dist/okf/types/DatasetIntegration.md +23 -0
- package/dist/okf/types/DbCluster.md +1 -1
- package/dist/okf/types/DbInstance.md +8 -2
- package/dist/okf/types/DeadlineBudget.md +29 -0
- package/dist/okf/types/DelegationSet.md +23 -0
- package/dist/okf/types/DeliveryChannel.md +6 -11
- package/dist/okf/types/DevOpsAgentAgentSpace.md +4 -0
- package/dist/okf/types/DevOpsAgentService.md +1 -0
- package/dist/okf/types/DevOpsAgentTrigger.md +28 -0
- package/dist/okf/types/DirectConnectGatewayAttachment.md +2 -0
- package/dist/okf/types/Directory.md +60 -0
- package/dist/okf/types/DocDBDBClusterParameterGroup.md +5 -10
- package/dist/okf/types/DocDBDBSubnetGroup.md +4 -9
- package/dist/okf/types/DocDBElasticClusterSnapshot.md +36 -0
- package/dist/okf/types/DocumentClassifierEndpoint.md +27 -0
- package/dist/okf/types/Domain.md +27 -0
- package/dist/okf/types/EKSCertificateAuthority.md +42 -0
- package/dist/okf/types/EKSCluster.md +8 -0
- package/dist/okf/types/EcSnapshot.md +66 -0
- package/dist/okf/types/EmailIdentityCertificate.md +15 -0
- package/dist/okf/types/EndpointConfig.md +14 -13
- package/dist/okf/types/EntityRecognizer.md +27 -0
- package/dist/okf/types/EntityRecognizerEndpoint.md +31 -0
- package/dist/okf/types/EnvironmentEC2.md +13 -13
- package/dist/okf/types/EvaluationForm.md +1 -0
- package/dist/okf/types/Evaluator.md +6 -2
- package/dist/okf/types/EventAction.md +26 -0
- package/dist/okf/types/EventRule.md +2 -0
- package/dist/okf/types/EventSource.md +30 -0
- package/dist/okf/types/EventTracker.md +22 -0
- package/dist/okf/types/EventsV2EventBus.md +28 -0
- package/dist/okf/types/EventsV2ResourcePolicy.md +19 -0
- package/dist/okf/types/EventsV2Subscriber.md +39 -0
- package/dist/okf/types/ExperimentDefinition.md +39 -0
- package/dist/okf/types/ExperimentRun.md +33 -0
- package/dist/okf/types/ExperimentTrialComponent.md +13 -11
- package/dist/okf/types/FHIRDatastore.md +3 -0
- package/dist/okf/types/FSxSnapshot.md +5 -5
- package/dist/okf/types/FSxVolume.md +9 -9
- package/dist/okf/types/FeaturedResultsSet.md +26 -0
- package/dist/okf/types/Feed.md +1 -0
- package/dist/okf/types/FieldLevelEncryptionConfig.md +25 -0
- package/dist/okf/types/FieldLevelEncryptionProfile.md +22 -0
- package/dist/okf/types/FileCache.md +45 -0
- package/dist/okf/types/Filter.md +27 -0
- package/dist/okf/types/Firewall.md +6 -0
- package/dist/okf/types/FlowMediaStream.md +28 -0
- package/dist/okf/types/FlowOutput.md +1 -0
- package/dist/okf/types/FpgaImage.md +38 -0
- package/dist/okf/types/Function.md +2 -2
- package/dist/okf/types/Gateway.md +41 -0
- package/dist/okf/types/GatewayClusterAssociations.md +23 -0
- package/dist/okf/types/GatewayRateLimit.md +26 -0
- package/dist/okf/types/GatewayRule.md +32 -0
- package/dist/okf/types/GlobalReplicationGroup.md +3 -0
- package/dist/okf/types/GlobalResolver.md +1 -1
- package/dist/okf/types/GlobalTable.md +1 -0
- package/dist/okf/types/GlueConnection.md +5 -4
- package/dist/okf/types/GlueSecurityConfiguration.md +1 -6
- package/dist/okf/types/GlueSession.md +38 -0
- package/dist/okf/types/GlueTable.md +5 -10
- package/dist/okf/types/GlueWorkflow.md +5 -10
- package/dist/okf/types/Group.md +27 -0
- package/dist/okf/types/Harness.md +1 -0
- package/dist/okf/types/HostKey.md +33 -0
- package/dist/okf/types/HostedZone.md +1 -0
- package/dist/okf/types/HttpApi.md +2 -0
- package/dist/okf/types/HttpNamespace.md +5 -5
- package/dist/okf/types/HubV2.md +1 -0
- package/dist/okf/types/HumanTaskUi.md +22 -0
- package/dist/okf/types/IPv4Pool.md +28 -0
- package/dist/okf/types/ImageBuilder.md +1 -0
- package/dist/okf/types/ImageBuilderImage.md +1 -1
- package/dist/okf/types/ImagePipeline.md +1 -1
- package/dist/okf/types/InferenceComponent.md +5 -1
- package/dist/okf/types/InfluxDBBackup.md +65 -0
- package/dist/okf/types/InfluxDBCluster.md +3 -0
- package/dist/okf/types/InfrastructureConfiguration.md +2 -0
- package/dist/okf/types/IngestionDestination.md +28 -0
- package/dist/okf/types/InputSecurityGroup.md +6 -4
- package/dist/okf/types/InspectorV2Connector.md +38 -0
- package/dist/okf/types/InstanceEventWindow.md +25 -0
- package/dist/okf/types/InstanceFleetConfig.md +10 -10
- package/dist/okf/types/InstanceGroupConfig.md +3 -3
- package/dist/okf/types/InstrumentationConfig.md +31 -0
- package/dist/okf/types/IntegrationAssociation.md +3 -0
- package/dist/okf/types/IoTSiteWiseApplication.md +34 -0
- package/dist/okf/types/IoTSiteWiseDataset.md +5 -2
- package/dist/okf/types/IoTSiteWiseTask.md +24 -0
- package/dist/okf/types/IpamExternalResourceVerificationToken.md +35 -0
- package/dist/okf/types/IpamInternetRegistryAssociation.md +32 -0
- package/dist/okf/types/Job.md +35 -0
- package/dist/okf/types/JobTemplate.md +26 -0
- package/dist/okf/types/KinesisChannel.md +31 -0
- package/dist/okf/types/KinesisStream.md +1 -0
- package/dist/okf/types/LambdaResourcePolicy.md +14 -0
- package/dist/okf/types/Lexicon.md +34 -0
- package/dist/okf/types/LicenseAssetGroup.md +23 -0
- package/dist/okf/types/LicenseConfiguration.md +33 -0
- package/dist/okf/types/LicenseServerEndpoint.md +32 -0
- package/dist/okf/types/LightsailKeyPair.md +29 -0
- package/dist/okf/types/LimitsProfile.md +27 -0
- package/dist/okf/types/LocationAzureBlob.md +2 -1
- package/dist/okf/types/LocationObjectStorage.md +1 -0
- package/dist/okf/types/LogAlarm.md +2 -0
- package/dist/okf/types/MGNConnector.md +23 -0
- package/dist/okf/types/MGNLaunchConfigurationTemplate.md +37 -0
- package/dist/okf/types/MLTransform.md +15 -15
- package/dist/okf/types/MWAAServerlessWorkflow.md +3 -0
- package/dist/okf/types/ManagedNotificationAccountContactAssociation.md +1 -0
- package/dist/okf/types/ManagedNotificationAdditionalChannelAssociation.md +1 -0
- package/dist/okf/types/MediaConvertJobTemplate.md +11 -13
- package/dist/okf/types/MediaConvertQueue.md +8 -10
- package/dist/okf/types/MediaInsightsPipelineConfiguration.md +28 -0
- package/dist/okf/types/MediaLiveInput.md +41 -18
- package/dist/okf/types/MediaPackageV2Channel.md +3 -0
- package/dist/okf/types/MediaPackageV2OriginEndpoint.md +1 -0
- package/dist/okf/types/MediaPipelineKinesisVideoStreamPool.md +28 -0
- package/dist/okf/types/MediaTailorFunction.md +27 -0
- package/dist/okf/types/MedicalVocabulary.md +21 -0
- package/dist/okf/types/Member.md +26 -0
- package/dist/okf/types/Memory.md +6 -0
- package/dist/okf/types/MemoryDBSnapshot.md +29 -0
- package/dist/okf/types/Metric.md +59 -0
- package/dist/okf/types/MetricAttribution.md +23 -0
- package/dist/okf/types/MicrosoftAD.md +11 -11
- package/dist/okf/types/MigrationProject.md +8 -1
- package/dist/okf/types/Monitor.md +26 -0
- package/dist/okf/types/NFSFileShare.md +44 -0
- package/dist/okf/types/NeptuneGraphGraph.md +1 -0
- package/dist/okf/types/NetworkConnector.md +4 -0
- package/dist/okf/types/NetworkFlowMonitorScope.md +23 -0
- package/dist/okf/types/NetworkMigrationDefinition.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerDeployment.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerPolicy.md +32 -0
- package/dist/okf/types/NetworkSecurityManagerScope.md +29 -0
- package/dist/okf/types/NotebookInstance.md +18 -18
- package/dist/okf/types/NotebookInstanceLifecycleConfig.md +6 -5
- package/dist/okf/types/NotifyConfiguration.md +35 -0
- package/dist/okf/types/OTelEnrichment.md +2 -0
- package/dist/okf/types/OnlineEvaluationConfig.md +0 -1
- package/dist/okf/types/OrganizationConfigRule.md +7 -7
- package/dist/okf/types/Outpost.md +32 -0
- package/dist/okf/types/ParallelData.md +40 -0
- package/dist/okf/types/Partition.md +5 -5
- package/dist/okf/types/PaymentConnector.md +4 -1
- package/dist/okf/types/Pentest.md +1 -0
- package/dist/okf/types/PerfReports.md +28 -0
- package/dist/okf/types/PermissionAssociation.md +30 -0
- package/dist/okf/types/PersonalizeDataset.md +1 -0
- package/dist/okf/types/PersonalizeDatasetGroup.md +1 -0
- package/dist/okf/types/PersonalizeSchema.md +1 -0
- package/dist/okf/types/Pipeline.md +25 -0
- package/dist/okf/types/PlaybackConfiguration.md +1 -0
- package/dist/okf/types/PolicyAssociation.md +1 -1
- package/dist/okf/types/PolicyGrant.md +2 -2
- package/dist/okf/types/PolicyPrincipalAttachment.md +2 -7
- package/dist/okf/types/PortalProduct.md +24 -0
- package/dist/okf/types/PrefetchSchedule.md +25 -0
- package/dist/okf/types/PricingPlanManagerSubscription.md +31 -0
- package/dist/okf/types/PrincipalAssociation.md +27 -0
- package/dist/okf/types/PrivateDnsNamespace.md +8 -8
- package/dist/okf/types/PrivateVirtualInterface.md +1 -0
- package/dist/okf/types/ProcurementPortalPreference.md +45 -0
- package/dist/okf/types/Program.md +33 -0
- package/dist/okf/types/ProjectMembership.md +1 -1
- package/dist/okf/types/ProtocolsList.md +26 -0
- package/dist/okf/types/PublicDnsNamespace.md +7 -7
- package/dist/okf/types/PublicVirtualInterface.md +1 -0
- package/dist/okf/types/QEV2IdcApplication.md +25 -0
- package/dist/okf/types/QueryLoggingConfig.md +21 -0
- package/dist/okf/types/QuerySuggestionsBlockList.md +25 -0
- package/dist/okf/types/QuickSightAssignment.md +24 -0
- package/dist/okf/types/RAMResourceAssociation.md +27 -0
- package/dist/okf/types/RDSClusterSnapshot.md +54 -0
- package/dist/okf/types/RDSDBParameterGroup.md +5 -0
- package/dist/okf/types/RDSDeployment.md +41 -0
- package/dist/okf/types/RcsAgent.md +38 -0
- package/dist/okf/types/ReceiptRule.md +5 -5
- package/dist/okf/types/ReceiptRuleSet.md +1 -6
- package/dist/okf/types/RecommenderFilter.md +27 -0
- package/dist/okf/types/RecommenderSchema.md +25 -0
- package/dist/okf/types/RecordSet.md +16 -22
- package/dist/okf/types/RecoveryPlan.md +28 -0
- package/dist/okf/types/RedshiftIdcApplication.md +31 -0
- package/dist/okf/types/RedshiftSnapshot.md +59 -0
- package/dist/okf/types/RegistrationAttachment.md +28 -0
- package/dist/okf/types/Registry.md +41 -0
- package/dist/okf/types/RegistryRecord.md +38 -0
- package/dist/okf/types/RelatedItem.md +24 -0
- package/dist/okf/types/ReplicationConfigurationTemplate.md +35 -0
- package/dist/okf/types/ReplicationSubnetGroup.md +4 -9
- package/dist/okf/types/ReplicationTask.md +14 -14
- package/dist/okf/types/ReportGenerator.md +29 -0
- package/dist/okf/types/ReportGroup.md +1 -3
- package/dist/okf/types/ResilienceHubV2Policy.md +1 -0
- package/dist/okf/types/ResilienceHubV2Service.md +1 -0
- package/dist/okf/types/ResourceConfiguration.md +1 -1
- package/dist/okf/types/ResourceMetricsConfiguration.md +21 -0
- package/dist/okf/types/RestApi.md +1 -0
- package/dist/okf/types/RetrievalInstruction.md +32 -0
- package/dist/okf/types/RouterOutput.md +1 -0
- package/dist/okf/types/Rule.md +31 -0
- package/dist/okf/types/RunCache.md +29 -0
- package/dist/okf/types/Runtime.md +2 -1
- package/dist/okf/types/SCNInstance.md +33 -0
- package/dist/okf/types/SDBDomain.md +2 -2
- package/dist/okf/types/SMBFileShare.md +49 -0
- package/dist/okf/types/SageMakerArtifact.md +27 -0
- package/dist/okf/types/SageMakerEndpoint.md +0 -1
- package/dist/okf/types/ScalableTarget.md +1 -0
- package/dist/okf/types/ScalingPlan.md +6 -6
- package/dist/okf/types/ScheduledReport.md +31 -0
- package/dist/okf/types/SecondaryNetwork.md +26 -0
- package/dist/okf/types/SecurityAgentArtifact.md +25 -0
- package/dist/okf/types/SecurityAgentIntegration.md +31 -0
- package/dist/okf/types/Server.md +1 -0
- package/dist/okf/types/ServerlessCache.md +2 -0
- package/dist/okf/types/ServerlessCacheSnapshot.md +31 -0
- package/dist/okf/types/ServerlessRepoApplication.md +32 -0
- package/dist/okf/types/ServiceDiscoveryInstance.md +3 -7
- package/dist/okf/types/SipMediaApplication.md +27 -0
- package/dist/okf/types/SiteToSiteVpnAttachment.md +2 -0
- package/dist/okf/types/SnapshotCopyGrant.md +20 -0
- package/dist/okf/types/Solution.md +1 -0
- package/dist/okf/types/SourceAssociation.md +25 -0
- package/dist/okf/types/SourceCredential.md +6 -6
- package/dist/okf/types/SourceNetwork.md +23 -0
- package/dist/okf/types/StackFleetAssociation.md +2 -7
- package/dist/okf/types/StorageTierPolicy.md +20 -0
- package/dist/okf/types/StorageVirtualMachine.md +9 -9
- package/dist/okf/types/Stream.md +28 -0
- package/dist/okf/types/SubnetCidrReservation.md +26 -0
- package/dist/okf/types/SubscriptionProvider.md +26 -0
- package/dist/okf/types/SupportPermit.md +29 -0
- package/dist/okf/types/Table.md +2 -1
- package/dist/okf/types/TableOptimizer.md +5 -10
- package/dist/okf/types/Tape.md +31 -0
- package/dist/okf/types/Template.md +36 -0
- package/dist/okf/types/Tenant.md +2 -0
- package/dist/okf/types/Terminology.md +39 -0
- package/dist/okf/types/Thesaurus.md +25 -0
- package/dist/okf/types/ThingPrincipalAttachment.md +3 -8
- package/dist/okf/types/Topic.md +1 -0
- package/dist/okf/types/TopicRuleDestination.md +1 -0
- package/dist/okf/types/TrafficPolicy.md +26 -0
- package/dist/okf/types/TrafficPolicyInstance.md +28 -0
- package/dist/okf/types/TranscribeVocabulary.md +27 -0
- package/dist/okf/types/TransitGatewayRouteTableAttachment.md +2 -0
- package/dist/okf/types/TransitVirtualInterface.md +1 -0
- package/dist/okf/types/Tunnel.md +25 -0
- package/dist/okf/types/UsageLimit.md +26 -0
- package/dist/okf/types/UseCase.md +23 -0
- package/dist/okf/types/User.md +47 -0
- package/dist/okf/types/VPCEndpoint.md +1 -1
- package/dist/okf/types/VPCEndpointService.md +6 -0
- package/dist/okf/types/VPCPeeringConnection.md +2 -2
- package/dist/okf/types/VPNConcentrator.md +1 -1
- package/dist/okf/types/VPNConnection.md +1 -1
- package/dist/okf/types/VerifiedDestinationNumber.md +25 -0
- package/dist/okf/types/View.md +27 -0
- package/dist/okf/types/VoiceConnector.md +30 -0
- package/dist/okf/types/Volume.md +44 -0
- package/dist/okf/types/Vpc.md +1 -1
- package/dist/okf/types/VpcAttachment.md +2 -0
- package/dist/okf/types/WebFunction.md +27 -0
- package/dist/okf/types/WebFunctionEndpoint.md +44 -0
- package/dist/okf/types/WebFunctionRevision.md +32 -0
- package/dist/okf/types/WickrNetwork.md +27 -0
- package/dist/okf/types/Worker.md +29 -0
- package/dist/okf/types/Workforce.md +26 -0
- package/dist/okf/types/Workload.md +35 -0
- package/dist/okf/types/WorkloadEstimate.md +35 -0
- package/dist/okf/types/Workspace.md +28 -0
- package/dist/okf/types/Workteam.md +8 -8
- package/dist/op/activities/aws-apply.js +214 -0
- package/dist/op/activities/floci.js +97 -0
- package/dist/op/activities/index.js +32 -0
- package/dist/op/builders.js +50 -0
- package/dist/ownership.js +52 -0
- package/dist/package-cli.js +25 -0
- package/dist/parameter.js +19 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1006 -0
- package/dist/properties.js +166 -0
- package/dist/pseudo.js +25 -0
- package/dist/receipt-store.d.ts.map +1 -1
- package/dist/receipt-store.js +233 -0
- package/dist/reference-catalog.js +106 -0
- package/dist/rules/ext001.ts +3 -3
- package/dist/rules/waw016.ts +2 -2
- package/dist/serializer.js +529 -0
- package/dist/spec/fetch.js +193 -0
- package/dist/spec/parse.js +259 -0
- package/dist/spec/pin.js +185 -0
- package/dist/spec/pinned-types.json +203 -0
- package/dist/stack-errors.js +14 -0
- package/dist/taggable.d.ts.map +1 -1
- package/dist/taggable.js +33 -0
- package/dist/teardown.js +199 -0
- package/dist/template-sections.js +53 -0
- package/dist/template-transform.js +50 -0
- package/dist/types/index.d.ts +18847 -1124
- package/dist/validate-cli.js +16 -0
- package/dist/validate.js +33 -0
- package/package.json +9 -9
- package/src/agentcore/trace-fetch.ts +2 -1
- package/src/api/credential-chain.ts +119 -9
- package/src/api/credential-isolation.test.ts +72 -0
- package/src/api/read-client-chain.test.ts +159 -0
- package/src/api/read-client.ts +42 -6
- package/src/api/sigv4.ts +4 -4
- package/src/caller-identity.ts +3 -5
- package/src/codegen/any-budget.test.ts +12 -2
- package/src/codegen/generate.ts +9 -0
- package/src/codegen/package.ts +2 -2
- package/src/codegen/patches.test.ts +95 -0
- package/src/codegen/patches.ts +53 -9
- package/src/codegen/property-overlay.json +1 -16
- package/src/components/apply.ts +218 -6
- package/src/components/cfn-plan-floci.e2e.test.ts +76 -0
- package/src/components/cfn-plan.test.ts +225 -16
- package/src/components/cloud-executor.ts +73 -25
- package/src/deep-observe.ts +2 -1
- package/src/disruption.ts +2 -1
- package/src/generated/index.d.ts +18847 -1124
- package/src/generated/index.ts +1376 -161
- package/src/generated/lexicon-aws.json +17359 -784
- package/src/identity-observe.ts +2 -1
- package/src/lint/post-synth/ext001.ts +3 -3
- package/src/lint/post-synth/waw016.ts +2 -2
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/plugin.ts +2 -1
- package/src/receipt-store.ts +2 -1
- package/src/spec/pin.ts +3 -3
- package/src/spec/pinned-types.json +203 -0
- package/src/taggable.ts +2 -2
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { EcsService, EcsService_LoadBalancer, EcsService_NetworkConfiguration, EcsService_AwsVpcConfiguration, TaskDefinition, TaskDefinition_ContainerDefinition, TaskDefinition_MountPoint, TaskDefinition_PortMapping, TaskDefinition_LogConfiguration, TaskDefinition_KeyValuePair, TaskDefinition_EFSVolumeConfiguration, TaskDefinition_Volume, TaskDefinition_Ulimit, TargetGroup, ListenerRule, ListenerRule_Action, ListenerRule_RuleCondition, ListenerRule_PathPatternConfig, ListenerRule_HostHeaderConfig, SecurityGroup, SecurityGroup_Ingress, LogGroup, Role, ScalableTarget, ApplicationAutoScalingScalingPolicy, ApplicationAutoScalingScalingPolicy_TargetTrackingScalingPolicyConfiguration, ApplicationAutoScalingScalingPolicy_PredefinedMetricSpecification, } from "../generated/index.js";
|
|
3
|
+
import { Sub, Join, Select, Split } from "../intrinsics.js";
|
|
4
|
+
import { ecsTrustPolicy } from "./ecs-trust-policy.js";
|
|
5
|
+
/**
|
|
6
|
+
* The ALB `ListenerRule`'s real `Priority` bounds (documented on
|
|
7
|
+
* `elasticloadbalancing:CreateRule`, and enforced the same way for a
|
|
8
|
+
* CloudFormation-managed rule) — not an opinion this composite holds.
|
|
9
|
+
*
|
|
10
|
+
* Exported for the same reason as `MICROVM_LIMITS` (#1374, #1420): a
|
|
11
|
+
* consumer routing to the same shared ALB through another control plane
|
|
12
|
+
* needs the same numbers, and copying them is how two sources of truth
|
|
13
|
+
* start.
|
|
14
|
+
*/
|
|
15
|
+
export const FARGATE_SERVICE_LIMITS = {
|
|
16
|
+
priority: { min: 1, max: 50000 },
|
|
17
|
+
};
|
|
18
|
+
/** A Fargate service routed by a listener rule on an existing ALB listener, with its task definition, target group, logs, roles and optional autoscaling. */
|
|
19
|
+
export const FargateService = Composite((props) => {
|
|
20
|
+
if (!props.pathPatterns && !props.hostHeaders) {
|
|
21
|
+
throw new Error("FargateService requires at least one of pathPatterns or hostHeaders");
|
|
22
|
+
}
|
|
23
|
+
if (props.priority < FARGATE_SERVICE_LIMITS.priority.min || props.priority > FARGATE_SERVICE_LIMITS.priority.max) {
|
|
24
|
+
throw new Error(`FargateService priority must be between ${FARGATE_SERVICE_LIMITS.priority.min} and ${FARGATE_SERVICE_LIMITS.priority.max}`);
|
|
25
|
+
}
|
|
26
|
+
const containerPort = props.containerPort ?? 80;
|
|
27
|
+
const cpu = props.cpu ?? "256";
|
|
28
|
+
const memory = props.memory ?? "512";
|
|
29
|
+
const desiredCount = props.desiredCount ?? 2;
|
|
30
|
+
const healthCheckPath = props.healthCheckPath ?? "/";
|
|
31
|
+
const logRetentionDays = props.logRetentionDays ?? 30;
|
|
32
|
+
const { defaults: defs } = props;
|
|
33
|
+
// Auto-inject EFS managed policy when efsMounts are present
|
|
34
|
+
const EFS_POLICY = "arn:aws:iam::aws:policy/AmazonElasticFileSystemClientReadWriteAccess";
|
|
35
|
+
const managedPolicies = props.ManagedPolicyArns ? [...props.ManagedPolicyArns] : [];
|
|
36
|
+
if (props.efsMounts?.length && !managedPolicies.includes(EFS_POLICY)) {
|
|
37
|
+
managedPolicies.push(EFS_POLICY);
|
|
38
|
+
}
|
|
39
|
+
// Task role — app permissions
|
|
40
|
+
const taskRole = new Role(mergeDefaults({
|
|
41
|
+
AssumeRolePolicyDocument: ecsTrustPolicy,
|
|
42
|
+
ManagedPolicyArns: managedPolicies.length > 0 ? managedPolicies : undefined,
|
|
43
|
+
Policies: props.Policies,
|
|
44
|
+
}, defs?.taskRole));
|
|
45
|
+
// Log group
|
|
46
|
+
const logGroup = new LogGroup({
|
|
47
|
+
RetentionInDays: logRetentionDays,
|
|
48
|
+
});
|
|
49
|
+
// Container definition
|
|
50
|
+
const portMapping = new TaskDefinition_PortMapping({
|
|
51
|
+
ContainerPort: containerPort,
|
|
52
|
+
Protocol: "tcp",
|
|
53
|
+
});
|
|
54
|
+
const logConfiguration = new TaskDefinition_LogConfiguration({
|
|
55
|
+
LogDriver: "awslogs",
|
|
56
|
+
Options: {
|
|
57
|
+
"awslogs-group": logGroup,
|
|
58
|
+
"awslogs-region": Sub `\${AWS::Region}`,
|
|
59
|
+
"awslogs-stream-prefix": "ecs",
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
// `.map` keeps the `new`s out of the `for`/`if` (EVL002).
|
|
63
|
+
const environmentVars = props.environment
|
|
64
|
+
? Object.entries(props.environment).map(([name, value]) => new TaskDefinition_KeyValuePair({ Name: name, Value: value }))
|
|
65
|
+
: [];
|
|
66
|
+
// EFS volumes and mount points
|
|
67
|
+
const efsVolumes = (props.efsMounts ?? []).map((m, i) => new TaskDefinition_Volume({
|
|
68
|
+
Name: m.volumeName ?? `efs-${i}`,
|
|
69
|
+
EFSVolumeConfiguration: new TaskDefinition_EFSVolumeConfiguration({
|
|
70
|
+
FileSystemId: m.fileSystemId,
|
|
71
|
+
...(m.accessPointId && { AuthorizationConfig: { AccessPointId: m.accessPointId } }),
|
|
72
|
+
TransitEncryption: m.transitEncryption ?? "ENABLED",
|
|
73
|
+
}),
|
|
74
|
+
}));
|
|
75
|
+
const efsMountPoints = (props.efsMounts ?? []).map((m, i) => new TaskDefinition_MountPoint({
|
|
76
|
+
ContainerPath: m.containerPath,
|
|
77
|
+
SourceVolume: m.volumeName ?? `efs-${i}`,
|
|
78
|
+
}));
|
|
79
|
+
const allMountPoints = [...efsMountPoints, ...(props.mountPoints ?? [])];
|
|
80
|
+
const container = new TaskDefinition_ContainerDefinition({
|
|
81
|
+
Name: "app",
|
|
82
|
+
Image: props.image,
|
|
83
|
+
Essential: true,
|
|
84
|
+
PortMappings: [portMapping],
|
|
85
|
+
LogConfiguration: logConfiguration,
|
|
86
|
+
Environment: environmentVars.length > 0 ? environmentVars : undefined,
|
|
87
|
+
Command: props.command,
|
|
88
|
+
MountPoints: allMountPoints.length > 0 ? allMountPoints : undefined,
|
|
89
|
+
Ulimits: props.ulimits?.map(u => new TaskDefinition_Ulimit({
|
|
90
|
+
Name: u.name,
|
|
91
|
+
SoftLimit: u.softLimit,
|
|
92
|
+
HardLimit: u.hardLimit,
|
|
93
|
+
})),
|
|
94
|
+
});
|
|
95
|
+
// Task definition
|
|
96
|
+
const taskDef = new TaskDefinition(mergeDefaults({
|
|
97
|
+
NetworkMode: "awsvpc",
|
|
98
|
+
RequiresCompatibilities: ["FARGATE"],
|
|
99
|
+
Cpu: cpu,
|
|
100
|
+
Memory: memory,
|
|
101
|
+
ExecutionRoleArn: props.executionRoleArn,
|
|
102
|
+
TaskRoleArn: taskRole.Arn,
|
|
103
|
+
ContainerDefinitions: [container],
|
|
104
|
+
...(efsVolumes.length > 0 && { Volumes: efsVolumes }),
|
|
105
|
+
}, defs?.taskDef));
|
|
106
|
+
// Task security group — ingress on container port from ALB SG
|
|
107
|
+
const taskIngress = new SecurityGroup_Ingress({
|
|
108
|
+
IpProtocol: "tcp",
|
|
109
|
+
FromPort: containerPort,
|
|
110
|
+
ToPort: containerPort,
|
|
111
|
+
SourceSecurityGroupId: props.albSecurityGroupId,
|
|
112
|
+
});
|
|
113
|
+
const taskSg = new SecurityGroup({
|
|
114
|
+
GroupDescription: "Fargate task security group",
|
|
115
|
+
VpcId: props.vpcId,
|
|
116
|
+
SecurityGroupIngress: [taskIngress],
|
|
117
|
+
});
|
|
118
|
+
// Target group
|
|
119
|
+
const targetGroup = new TargetGroup(mergeDefaults({
|
|
120
|
+
TargetType: "ip",
|
|
121
|
+
Protocol: "HTTP",
|
|
122
|
+
Port: containerPort,
|
|
123
|
+
VpcId: props.vpcId,
|
|
124
|
+
HealthCheckPath: healthCheckPath,
|
|
125
|
+
}, defs?.targetGroup));
|
|
126
|
+
// Listener rule conditions
|
|
127
|
+
// Conditional entries via spread keep the `new`s out of the `if`s (EVL002).
|
|
128
|
+
const conditions = [
|
|
129
|
+
...(props.pathPatterns
|
|
130
|
+
? [new ListenerRule_RuleCondition({
|
|
131
|
+
Field: "path-pattern",
|
|
132
|
+
PathPatternConfig: new ListenerRule_PathPatternConfig({ Values: props.pathPatterns }),
|
|
133
|
+
})]
|
|
134
|
+
: []),
|
|
135
|
+
...(props.hostHeaders
|
|
136
|
+
? [new ListenerRule_RuleCondition({
|
|
137
|
+
Field: "host-header",
|
|
138
|
+
HostHeaderConfig: new ListenerRule_HostHeaderConfig({ Values: props.hostHeaders }),
|
|
139
|
+
})]
|
|
140
|
+
: []),
|
|
141
|
+
];
|
|
142
|
+
// Listener rule
|
|
143
|
+
const ruleAction = new ListenerRule_Action({
|
|
144
|
+
Type: "forward",
|
|
145
|
+
TargetGroupArn: targetGroup.TargetGroupArn,
|
|
146
|
+
});
|
|
147
|
+
const rule = new ListenerRule({
|
|
148
|
+
ListenerArn: props.listenerArn,
|
|
149
|
+
Priority: props.priority,
|
|
150
|
+
Actions: [ruleAction],
|
|
151
|
+
Conditions: conditions,
|
|
152
|
+
});
|
|
153
|
+
// ECS Service
|
|
154
|
+
const serviceLoadBalancer = new EcsService_LoadBalancer({
|
|
155
|
+
ContainerName: "app",
|
|
156
|
+
ContainerPort: containerPort,
|
|
157
|
+
TargetGroupArn: targetGroup.TargetGroupArn,
|
|
158
|
+
});
|
|
159
|
+
const awsVpcConfig = new EcsService_AwsVpcConfiguration({
|
|
160
|
+
Subnets: props.privateSubnetIds,
|
|
161
|
+
SecurityGroups: [taskSg.GroupId],
|
|
162
|
+
AssignPublicIp: "DISABLED",
|
|
163
|
+
});
|
|
164
|
+
const networkConfig = new EcsService_NetworkConfiguration({
|
|
165
|
+
AwsvpcConfiguration: awsVpcConfig,
|
|
166
|
+
});
|
|
167
|
+
const service = new EcsService(mergeDefaults({
|
|
168
|
+
Cluster: props.clusterArn,
|
|
169
|
+
TaskDefinition: taskDef.TaskDefinitionArn,
|
|
170
|
+
LaunchType: "FARGATE",
|
|
171
|
+
DesiredCount: desiredCount,
|
|
172
|
+
HealthCheckGracePeriodSeconds: 60,
|
|
173
|
+
LoadBalancers: [serviceLoadBalancer],
|
|
174
|
+
NetworkConfiguration: networkConfig,
|
|
175
|
+
}, defs?.service), { DependsOn: [rule] });
|
|
176
|
+
let scalableTarget;
|
|
177
|
+
let scalingPolicy;
|
|
178
|
+
// Closure (invoked below) keeps the autoscaling `new`s out of the `if` (EVL002);
|
|
179
|
+
// the guard narrows `props.autoscaling` for the body.
|
|
180
|
+
const buildAutoscaling = () => {
|
|
181
|
+
if (!props.autoscaling)
|
|
182
|
+
return;
|
|
183
|
+
const { minCapacity = 1, maxCapacity, cpuTarget = 60, scaleInCooldown, scaleOutCooldown } = props.autoscaling;
|
|
184
|
+
const resourceId = Join("/", ["service", Select(1, Split("/", props.clusterArn)), service.Name]);
|
|
185
|
+
scalableTarget = new ScalableTarget({
|
|
186
|
+
ServiceNamespace: "ecs",
|
|
187
|
+
ScalableDimension: "ecs:service:DesiredCount",
|
|
188
|
+
ResourceId: resourceId,
|
|
189
|
+
MinCapacity: minCapacity,
|
|
190
|
+
MaxCapacity: maxCapacity,
|
|
191
|
+
});
|
|
192
|
+
const trackingConfig = new ApplicationAutoScalingScalingPolicy_TargetTrackingScalingPolicyConfiguration({
|
|
193
|
+
TargetValue: cpuTarget,
|
|
194
|
+
PredefinedMetricSpecification: new ApplicationAutoScalingScalingPolicy_PredefinedMetricSpecification({
|
|
195
|
+
PredefinedMetricType: "ECSServiceAverageCPUUtilization",
|
|
196
|
+
}),
|
|
197
|
+
...(scaleInCooldown !== undefined && { ScaleInCooldown: scaleInCooldown }),
|
|
198
|
+
...(scaleOutCooldown !== undefined && { ScaleOutCooldown: scaleOutCooldown }),
|
|
199
|
+
});
|
|
200
|
+
scalingPolicy = new ApplicationAutoScalingScalingPolicy({
|
|
201
|
+
PolicyName: Sub `\${AWS::StackName}-cpu`,
|
|
202
|
+
PolicyType: "TargetTrackingScaling",
|
|
203
|
+
ServiceNamespace: "ecs",
|
|
204
|
+
ScalableDimension: "ecs:service:DesiredCount",
|
|
205
|
+
ResourceId: resourceId,
|
|
206
|
+
TargetTrackingScalingPolicyConfiguration: trackingConfig,
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
if (props.autoscaling)
|
|
210
|
+
buildAutoscaling();
|
|
211
|
+
return {
|
|
212
|
+
taskRole,
|
|
213
|
+
logGroup,
|
|
214
|
+
taskDef,
|
|
215
|
+
taskSg,
|
|
216
|
+
targetGroup,
|
|
217
|
+
rule,
|
|
218
|
+
service,
|
|
219
|
+
...(scalableTarget ? { scalableTarget } : {}),
|
|
220
|
+
...(scalingPolicy ? { scalingPolicy } : {}),
|
|
221
|
+
};
|
|
222
|
+
}, "FargateService");
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { OrganizationRoot, GovernanceFoundation, RegionRestriction, OrganizationTrail } from "./landing-zone.js";
|
|
2
|
+
export { LambdaFunction, LambdaNode, LambdaPython, NodeLambda, PythonLambda } from "./lambda-function.js";
|
|
3
|
+
export { LambdaApi } from "./lambda-api.js";
|
|
4
|
+
export { LambdaScheduled, ScheduledLambda } from "./scheduled-lambda.js";
|
|
5
|
+
export { LambdaSqs } from "./lambda-sqs.js";
|
|
6
|
+
export { LambdaEventBridge } from "./lambda-eventbridge.js";
|
|
7
|
+
export { LambdaDynamoDB } from "./lambda-dynamodb.js";
|
|
8
|
+
export { EcrRepository } from "./ecr-repository.js";
|
|
9
|
+
export { DynamoDBTable } from "./dynamodb-table.js";
|
|
10
|
+
export { LambdaS3 } from "./lambda-s3.js";
|
|
11
|
+
export { LambdaSns } from "./lambda-sns.js";
|
|
12
|
+
export { VpcDefault } from "./vpc-default.js";
|
|
13
|
+
export { FargateAlb } from "./fargate-alb.js";
|
|
14
|
+
export { AlbShared } from "./alb-shared.js";
|
|
15
|
+
export { FargateService, FARGATE_SERVICE_LIMITS } from "./fargate-service.js";
|
|
16
|
+
export { NlbService } from "./nlb-service.js";
|
|
17
|
+
export { RdsInstance, RdsInstance as RdsPostgres } from "./rds-instance.js";
|
|
18
|
+
export { EfsWithAccessPoint } from "./efs-with-access-point.js";
|
|
19
|
+
export { SolrFargateService } from "./solr-fargate-service.js";
|
|
20
|
+
export { Ec2InstanceRole } from "./ec2-instance-role.js";
|
|
21
|
+
export { Ec2InstanceBundle } from "./ec2-instance-bundle.js";
|
|
22
|
+
export { MinimalVpc } from "./minimal-vpc.js";
|
|
23
|
+
export { EksCluster } from "./eks-cluster.js";
|
|
24
|
+
export { MicrovmApp, MICROVM_LIMITS } from "./microvm-app.js";
|
|
25
|
+
export { AgentCoreAgent, agentCoreDefaultEndpointArn, AGENTCORE_LIMITS } from "./agentcore-agent.js";
|
|
26
|
+
export { StepFunctionsWorkflow } from "./step-functions-workflow.js";
|
|
27
|
+
export { MonitoringStack } from "./monitoring-stack.js";
|
|
28
|
+
export { BucketDeployment } from "./bucket-deployment.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Permission } from "../generated/index.js";
|
|
3
|
+
import { LambdaFunction } from "./lambda-function.js";
|
|
4
|
+
/** A Lambda function with an execution role and the permission that lets API Gateway invoke it. */
|
|
5
|
+
export const LambdaApi = Composite((props) => {
|
|
6
|
+
const { defaults } = props;
|
|
7
|
+
const { role, func } = LambdaFunction(props);
|
|
8
|
+
const permission = new Permission(mergeDefaults({
|
|
9
|
+
FunctionName: func.Arn,
|
|
10
|
+
Action: "lambda:InvokeFunction",
|
|
11
|
+
Principal: "apigateway.amazonaws.com",
|
|
12
|
+
SourceArn: props.sourceArn,
|
|
13
|
+
}, defaults?.permission));
|
|
14
|
+
return { role, func, permission };
|
|
15
|
+
}, "LambdaApi");
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Table, Table_AttributeDefinition, Table_KeySchema, Table_StreamSpecification, Role_Policy, EventSourceMapping, } from "../generated/index.js";
|
|
3
|
+
import { dynamoDBActionsFor } from "../actions/dynamodb.js";
|
|
4
|
+
import { LambdaFunction } from "./lambda-function.js";
|
|
5
|
+
/** A Lambda function with a DynamoDB table, table access for its role and an optional stream trigger. */
|
|
6
|
+
export const LambdaDynamoDB = Composite((props) => {
|
|
7
|
+
// Conditional entries via spread keep the `new`s out of the `if` (EVL002).
|
|
8
|
+
const attributeDefinitions = [
|
|
9
|
+
new Table_AttributeDefinition({ AttributeName: props.partitionKey, AttributeType: "S" }),
|
|
10
|
+
...(props.sortKey ? [new Table_AttributeDefinition({ AttributeName: props.sortKey, AttributeType: "S" })] : []),
|
|
11
|
+
];
|
|
12
|
+
const keySchema = [
|
|
13
|
+
new Table_KeySchema({ AttributeName: props.partitionKey, KeyType: "HASH" }),
|
|
14
|
+
...(props.sortKey ? [new Table_KeySchema({ AttributeName: props.sortKey, KeyType: "RANGE" })] : []),
|
|
15
|
+
];
|
|
16
|
+
const { defaults } = props;
|
|
17
|
+
const table = new Table(mergeDefaults({
|
|
18
|
+
TableName: props.tableName,
|
|
19
|
+
BillingMode: "PAY_PER_REQUEST",
|
|
20
|
+
AttributeDefinitions: attributeDefinitions,
|
|
21
|
+
KeySchema: keySchema,
|
|
22
|
+
...(props.streams && {
|
|
23
|
+
StreamSpecification: new Table_StreamSpecification({
|
|
24
|
+
StreamViewType: props.streams.viewType ?? "NEW_AND_OLD_IMAGES",
|
|
25
|
+
}),
|
|
26
|
+
}),
|
|
27
|
+
}, defaults?.table));
|
|
28
|
+
const access = props.access ?? "ReadWrite";
|
|
29
|
+
// Build the policy list with conditional spreads (no push-inside-if) (EVL002).
|
|
30
|
+
const policies = [
|
|
31
|
+
...(access !== "None"
|
|
32
|
+
? [new Role_Policy({
|
|
33
|
+
PolicyName: `DynamoDB${access}`,
|
|
34
|
+
PolicyDocument: {
|
|
35
|
+
Version: "2012-10-17",
|
|
36
|
+
Statement: [{ Effect: "Allow", Action: dynamoDBActionsFor(access), Resource: table.Arn }],
|
|
37
|
+
},
|
|
38
|
+
})]
|
|
39
|
+
: []),
|
|
40
|
+
...(props.streams
|
|
41
|
+
? [new Role_Policy({
|
|
42
|
+
PolicyName: "DynamoDBStreamRead",
|
|
43
|
+
PolicyDocument: {
|
|
44
|
+
Version: "2012-10-17",
|
|
45
|
+
Statement: [{
|
|
46
|
+
Effect: "Allow",
|
|
47
|
+
Action: [
|
|
48
|
+
"dynamodb:GetRecords",
|
|
49
|
+
"dynamodb:GetShardIterator",
|
|
50
|
+
"dynamodb:DescribeStream",
|
|
51
|
+
"dynamodb:ListStreams",
|
|
52
|
+
],
|
|
53
|
+
Resource: table.StreamArn,
|
|
54
|
+
}],
|
|
55
|
+
},
|
|
56
|
+
})]
|
|
57
|
+
: []),
|
|
58
|
+
...(props.Policies ?? []),
|
|
59
|
+
];
|
|
60
|
+
const env = props.Environment ?? { Variables: {} };
|
|
61
|
+
const variables = { ...(env.Variables ?? {}), TABLE_NAME: table.Ref };
|
|
62
|
+
const { role, func } = LambdaFunction({
|
|
63
|
+
...props,
|
|
64
|
+
Policies: policies,
|
|
65
|
+
Environment: { Variables: variables },
|
|
66
|
+
});
|
|
67
|
+
const eventSourceMapping = props.streams
|
|
68
|
+
? new EventSourceMapping(mergeDefaults({
|
|
69
|
+
FunctionName: func.Arn,
|
|
70
|
+
EventSourceArn: table.StreamArn,
|
|
71
|
+
StartingPosition: props.streams.startingPosition ?? "TRIM_HORIZON",
|
|
72
|
+
...(props.streams.batchSize !== undefined && { BatchSize: props.streams.batchSize }),
|
|
73
|
+
...(props.streams.bisectOnFunctionError !== undefined && { BisectBatchOnFunctionError: props.streams.bisectOnFunctionError }),
|
|
74
|
+
}, defaults?.eventSourceMapping))
|
|
75
|
+
: undefined;
|
|
76
|
+
return { table, role, func, ...(eventSourceMapping ? { eventSourceMapping } : {}) };
|
|
77
|
+
}, "LambdaDynamoDB");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { EventRule, EventRule_Target, Permission } from "../generated/index.js";
|
|
3
|
+
import { LambdaFunction } from "./lambda-function.js";
|
|
4
|
+
/** A Lambda function triggered by an EventBridge rule, on a schedule or an event pattern. */
|
|
5
|
+
export const LambdaEventBridge = Composite((props) => {
|
|
6
|
+
const { defaults } = props;
|
|
7
|
+
const { role, func } = LambdaFunction(props);
|
|
8
|
+
const rule = new EventRule(mergeDefaults({
|
|
9
|
+
Name: props.ruleName,
|
|
10
|
+
ScheduleExpression: props.schedule,
|
|
11
|
+
EventPattern: props.eventPattern,
|
|
12
|
+
State: (props.enabled ?? true) ? "ENABLED" : "DISABLED",
|
|
13
|
+
Targets: [
|
|
14
|
+
new EventRule_Target({
|
|
15
|
+
Arn: func.Arn,
|
|
16
|
+
Id: "Target0",
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
}, defaults?.rule));
|
|
20
|
+
const permission = new Permission(mergeDefaults({
|
|
21
|
+
FunctionName: func.Arn,
|
|
22
|
+
Action: "lambda:InvokeFunction",
|
|
23
|
+
Principal: "events.amazonaws.com",
|
|
24
|
+
SourceArn: rule.Arn,
|
|
25
|
+
}, defaults?.permission));
|
|
26
|
+
return { rule, role, func, permission };
|
|
27
|
+
}, "LambdaEventBridge");
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Composite, withDefaults, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Role, Function, Function_VpcConfig } from "../generated/index.js";
|
|
3
|
+
const lambdaTrustPolicy = {
|
|
4
|
+
Version: "2012-10-17",
|
|
5
|
+
Statement: [
|
|
6
|
+
{
|
|
7
|
+
Effect: "Allow",
|
|
8
|
+
Principal: { Service: "lambda.amazonaws.com" },
|
|
9
|
+
Action: "sts:AssumeRole",
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
const BASIC_EXECUTION_ARN = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole";
|
|
14
|
+
const VPC_ACCESS_ARN = "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole";
|
|
15
|
+
/** A Lambda function with its execution role. */
|
|
16
|
+
export const LambdaFunction = Composite((props) => {
|
|
17
|
+
const { defaults } = props;
|
|
18
|
+
const managedPolicies = [BASIC_EXECUTION_ARN];
|
|
19
|
+
if (props.VpcConfig) {
|
|
20
|
+
managedPolicies.push(VPC_ACCESS_ARN);
|
|
21
|
+
}
|
|
22
|
+
if (props.ManagedPolicyArns) {
|
|
23
|
+
managedPolicies.push(...props.ManagedPolicyArns);
|
|
24
|
+
}
|
|
25
|
+
const role = new Role(mergeDefaults({
|
|
26
|
+
AssumeRolePolicyDocument: lambdaTrustPolicy,
|
|
27
|
+
ManagedPolicyArns: managedPolicies,
|
|
28
|
+
Policies: props.Policies,
|
|
29
|
+
}, defaults?.role));
|
|
30
|
+
const func = new Function(mergeDefaults({
|
|
31
|
+
FunctionName: props.name,
|
|
32
|
+
Runtime: props.Runtime,
|
|
33
|
+
Handler: props.Handler,
|
|
34
|
+
Code: props.Code,
|
|
35
|
+
Role: role.Arn,
|
|
36
|
+
Timeout: props.Timeout ?? 30,
|
|
37
|
+
MemorySize: props.MemorySize,
|
|
38
|
+
Environment: props.Environment,
|
|
39
|
+
VpcConfig: props.VpcConfig ? new Function_VpcConfig(props.VpcConfig) : undefined,
|
|
40
|
+
}, defaults?.func));
|
|
41
|
+
return { role, func };
|
|
42
|
+
}, "LambdaFunction");
|
|
43
|
+
export const LambdaNode = withDefaults(LambdaFunction, {
|
|
44
|
+
Runtime: "nodejs20.x",
|
|
45
|
+
Handler: "index.handler",
|
|
46
|
+
});
|
|
47
|
+
export const LambdaPython = withDefaults(LambdaFunction, {
|
|
48
|
+
Runtime: "python3.12",
|
|
49
|
+
Handler: "handler.handler",
|
|
50
|
+
});
|
|
51
|
+
/** @deprecated Use `LambdaNode` instead */
|
|
52
|
+
export const NodeLambda = LambdaNode;
|
|
53
|
+
/** @deprecated Use `LambdaPython` instead */
|
|
54
|
+
export const PythonLambda = LambdaPython;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Bucket, Bucket_BucketEncryption, Bucket_ServerSideEncryptionRule, Bucket_ServerSideEncryptionByDefault, Bucket_PublicAccessBlockConfiguration, Bucket_NotificationConfiguration, Bucket_LambdaConfiguration, Permission, Role_Policy, } from "../generated/index.js";
|
|
3
|
+
import { Sub, Join } from "../intrinsics.js";
|
|
4
|
+
import { s3ActionsFor } from "../actions/s3.js";
|
|
5
|
+
import { LambdaFunction } from "./lambda-function.js";
|
|
6
|
+
/** A Lambda function with an S3 bucket, bucket access for its role and an optional bucket-notification trigger. */
|
|
7
|
+
export const LambdaS3 = Composite((props) => {
|
|
8
|
+
const encryptionDefault = new Bucket_ServerSideEncryptionByDefault({ SSEAlgorithm: "AES256" });
|
|
9
|
+
const encryptionRule = new Bucket_ServerSideEncryptionRule({
|
|
10
|
+
ServerSideEncryptionByDefault: encryptionDefault,
|
|
11
|
+
});
|
|
12
|
+
const bucketEncryption = new Bucket_BucketEncryption({
|
|
13
|
+
ServerSideEncryptionConfiguration: [encryptionRule],
|
|
14
|
+
});
|
|
15
|
+
const publicAccessBlock = new Bucket_PublicAccessBlockConfiguration({
|
|
16
|
+
BlockPublicAcls: true,
|
|
17
|
+
BlockPublicPolicy: true,
|
|
18
|
+
IgnorePublicAcls: true,
|
|
19
|
+
RestrictPublicBuckets: true,
|
|
20
|
+
});
|
|
21
|
+
const { defaults } = props;
|
|
22
|
+
const access = props.access ?? "ReadWrite";
|
|
23
|
+
// The triggered path builds its resources in a closure so the `new`s aren't
|
|
24
|
+
// under the `if` (EVL002); it's invoked below only when a trigger is declared.
|
|
25
|
+
const buildTriggered = () => {
|
|
26
|
+
// Create Lambda first to break the circular CFN dependency.
|
|
27
|
+
// Compute bucket ARN from name (no GetAtt on bucket → no resource dep).
|
|
28
|
+
const name = props.bucketName ?? Sub `\${AWS::StackName}-bucket`;
|
|
29
|
+
const bucketArnBase = Join("", ["arn:aws:s3:::", name]);
|
|
30
|
+
const bucketArnWildcard = Join("", ["arn:aws:s3:::", name, "/*"]);
|
|
31
|
+
const s3Policy = new Role_Policy({
|
|
32
|
+
PolicyName: `S3${access}`,
|
|
33
|
+
PolicyDocument: {
|
|
34
|
+
Version: "2012-10-17",
|
|
35
|
+
Statement: [{ Effect: "Allow", Action: s3ActionsFor(access), Resource: [bucketArnBase, bucketArnWildcard] }],
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const policies = props.Policies ? [s3Policy, ...props.Policies] : [s3Policy];
|
|
39
|
+
const env = props.Environment ?? { Variables: {} };
|
|
40
|
+
const variables = { ...(env.Variables ?? {}), BUCKET_NAME: name };
|
|
41
|
+
const { role, func } = LambdaFunction({ ...props, Policies: policies, Environment: { Variables: variables } });
|
|
42
|
+
const permission = new Permission({
|
|
43
|
+
FunctionName: func.Arn,
|
|
44
|
+
Action: "lambda:InvokeFunction",
|
|
45
|
+
Principal: "s3.amazonaws.com",
|
|
46
|
+
SourceArn: bucketArnBase,
|
|
47
|
+
});
|
|
48
|
+
// Non-null: the closure is only invoked when `props.trigger` is set (below).
|
|
49
|
+
const { events = ["s3:ObjectCreated:*"], prefix, suffix } = props.trigger;
|
|
50
|
+
const rules = [];
|
|
51
|
+
if (prefix)
|
|
52
|
+
rules.push({ Name: "prefix", Value: prefix });
|
|
53
|
+
if (suffix)
|
|
54
|
+
rules.push({ Name: "suffix", Value: suffix });
|
|
55
|
+
const lambdaConfigs = events.map((event) => new Bucket_LambdaConfiguration({
|
|
56
|
+
Event: event,
|
|
57
|
+
Function: func.Arn,
|
|
58
|
+
...(rules.length > 0 && { Filter: { S3Key: { Rules: rules } } }),
|
|
59
|
+
}));
|
|
60
|
+
const notificationConfig = new Bucket_NotificationConfiguration({
|
|
61
|
+
LambdaConfigurations: lambdaConfigs,
|
|
62
|
+
});
|
|
63
|
+
const bucket = new Bucket(mergeDefaults({
|
|
64
|
+
BucketName: props.bucketName,
|
|
65
|
+
BucketEncryption: bucketEncryption,
|
|
66
|
+
PublicAccessBlockConfiguration: publicAccessBlock,
|
|
67
|
+
NotificationConfiguration: notificationConfig,
|
|
68
|
+
}, defaults?.bucket), { DependsOn: [permission] });
|
|
69
|
+
return { bucket, role, func, permission };
|
|
70
|
+
};
|
|
71
|
+
if (props.trigger)
|
|
72
|
+
return buildTriggered();
|
|
73
|
+
// Non-trigger path: original flow
|
|
74
|
+
const bucket = new Bucket(mergeDefaults({
|
|
75
|
+
BucketName: props.bucketName,
|
|
76
|
+
BucketEncryption: bucketEncryption,
|
|
77
|
+
PublicAccessBlockConfiguration: publicAccessBlock,
|
|
78
|
+
}, defaults?.bucket));
|
|
79
|
+
const s3PolicyDocument = {
|
|
80
|
+
Version: "2012-10-17",
|
|
81
|
+
Statement: [{ Effect: "Allow", Action: s3ActionsFor(access), Resource: [bucket.Arn, Sub `${bucket.Arn}/*`] }],
|
|
82
|
+
};
|
|
83
|
+
const s3Policy = new Role_Policy({ PolicyName: `S3${access}`, PolicyDocument: s3PolicyDocument });
|
|
84
|
+
const policies = props.Policies ? [s3Policy, ...props.Policies] : [s3Policy];
|
|
85
|
+
const env = props.Environment ?? { Variables: {} };
|
|
86
|
+
const variables = { ...(env.Variables ?? {}), BUCKET_NAME: bucket.Ref };
|
|
87
|
+
const { role, func } = LambdaFunction({
|
|
88
|
+
...props,
|
|
89
|
+
Policies: policies,
|
|
90
|
+
Environment: { Variables: variables },
|
|
91
|
+
});
|
|
92
|
+
return { bucket, role, func };
|
|
93
|
+
}, "LambdaS3");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Topic, Subscription, Permission } from "../generated/index.js";
|
|
3
|
+
import { LambdaFunction } from "./lambda-function.js";
|
|
4
|
+
/** A Lambda function subscribed to an SNS topic. */
|
|
5
|
+
export const LambdaSns = Composite((props) => {
|
|
6
|
+
const { defaults } = props;
|
|
7
|
+
const { role, func } = LambdaFunction(props);
|
|
8
|
+
const topic = new Topic(mergeDefaults({
|
|
9
|
+
TopicName: props.topicName,
|
|
10
|
+
}, defaults?.topic));
|
|
11
|
+
const subscription = new Subscription(mergeDefaults({
|
|
12
|
+
TopicArn: topic.TopicArn,
|
|
13
|
+
Protocol: "lambda",
|
|
14
|
+
Endpoint: func.Arn,
|
|
15
|
+
}, defaults?.subscription));
|
|
16
|
+
const permission = new Permission(mergeDefaults({
|
|
17
|
+
FunctionName: func.Arn,
|
|
18
|
+
Action: "lambda:InvokeFunction",
|
|
19
|
+
Principal: "sns.amazonaws.com",
|
|
20
|
+
SourceArn: topic.TopicArn,
|
|
21
|
+
}, defaults?.permission));
|
|
22
|
+
return { topic, role, func, subscription, permission };
|
|
23
|
+
}, "LambdaSns");
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Queue, EventSourceMapping, Role_Policy } from "../generated/index.js";
|
|
3
|
+
import { SQSActions } from "../actions/sqs.js";
|
|
4
|
+
import { LambdaFunction } from "./lambda-function.js";
|
|
5
|
+
/** A Lambda function fed by an SQS queue through an event source mapping. */
|
|
6
|
+
export const LambdaSqs = Composite((props) => {
|
|
7
|
+
const { defaults } = props;
|
|
8
|
+
const queue = new Queue(mergeDefaults({
|
|
9
|
+
QueueName: props.queueName,
|
|
10
|
+
}, defaults?.queue));
|
|
11
|
+
const sqsPolicyDocument = {
|
|
12
|
+
Version: "2012-10-17",
|
|
13
|
+
Statement: [
|
|
14
|
+
{
|
|
15
|
+
Effect: "Allow",
|
|
16
|
+
Action: SQSActions.ReceiveMessage,
|
|
17
|
+
Resource: queue.Arn,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
const sqsPolicy = new Role_Policy({
|
|
22
|
+
PolicyName: "SQSReceive",
|
|
23
|
+
PolicyDocument: sqsPolicyDocument,
|
|
24
|
+
});
|
|
25
|
+
const policies = props.Policies ? [sqsPolicy, ...props.Policies] : [sqsPolicy];
|
|
26
|
+
const { role, func } = LambdaFunction({ ...props, Policies: policies });
|
|
27
|
+
const eventSourceMapping = new EventSourceMapping(mergeDefaults({
|
|
28
|
+
EventSourceArn: queue.Arn,
|
|
29
|
+
FunctionName: func.Arn,
|
|
30
|
+
BatchSize: props.batchSize ?? 10,
|
|
31
|
+
MaximumBatchingWindowInSeconds: props.maxBatchingWindow,
|
|
32
|
+
}, defaults?.eventSourceMapping));
|
|
33
|
+
return { queue, role, func, eventSourceMapping };
|
|
34
|
+
}, "LambdaSqs");
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Landing-zone bootstrap composites.
|
|
3
|
+
*
|
|
4
|
+
* Fixed-shape resources for greenfield creation of the recommended
|
|
5
|
+
* governance foundation through a management-account stack. The evaluability
|
|
6
|
+
* rules (EVL002/004) require composites to declare a fixed set of resources,
|
|
7
|
+
* so these carry the foundation only; arbitrary OU/account trees are
|
|
8
|
+
* authored as config with `landingZoneConfig()` (../governance.ts) and
|
|
9
|
+
* reconciled by an external governance reconciler, and further OUs/accounts are
|
|
10
|
+
* declared as ordinary resources referencing these members' ids.
|
|
11
|
+
*
|
|
12
|
+
* The pieces compose:
|
|
13
|
+
* const org = OrganizationRoot({}); // greenfield only
|
|
14
|
+
* const lz = GovernanceFoundation({ parentRootId: org.organization.RootId });
|
|
15
|
+
* const rr = RegionRestriction({ regions: ["eu-west-1"], targetIds: [org.organization.RootId] });
|
|
16
|
+
* const at = OrganizationTrail({ bucket: "acme-org-audit" });
|
|
17
|
+
* Brownfield skips OrganizationRoot and passes the existing root id
|
|
18
|
+
* ("r-...") to GovernanceFoundation.
|
|
19
|
+
*/
|
|
20
|
+
import { Composite } from "@intentius/chant";
|
|
21
|
+
import { Organization, OrganizationalUnit, OrganizationsPolicy, Trail, } from "../generated/index.js";
|
|
22
|
+
import { DENY_AUDIT_TAMPER, DENY_LEAVE_ORGANIZATION, regionRestriction } from "../governance.js";
|
|
23
|
+
/** Creates the organization itself. Control Tower / existing orgs skip this. */
|
|
24
|
+
export const OrganizationRoot = Composite((props) => {
|
|
25
|
+
const organization = new Organization({ FeatureSet: props.featureSet ?? "ALL" });
|
|
26
|
+
return { organization };
|
|
27
|
+
}, "OrganizationRoot");
|
|
28
|
+
/**
|
|
29
|
+
* Security / Infrastructure / Sandbox / Workloads OUs,
|
|
30
|
+
* `deny-leave-organization` attached at the root and `deny-audit-tamper`
|
|
31
|
+
* on the Security OU — the same baseline `landingZoneConfig()` declares.
|
|
32
|
+
*/
|
|
33
|
+
export const GovernanceFoundation = Composite((props) => {
|
|
34
|
+
const ouSecurity = new OrganizationalUnit({ Name: "Security", ParentId: props.parentRootId });
|
|
35
|
+
const ouInfrastructure = new OrganizationalUnit({ Name: "Infrastructure", ParentId: props.parentRootId });
|
|
36
|
+
const ouSandbox = new OrganizationalUnit({ Name: "Sandbox", ParentId: props.parentRootId });
|
|
37
|
+
const ouWorkloads = new OrganizationalUnit({ Name: "Workloads", ParentId: props.parentRootId });
|
|
38
|
+
const scpDenyLeaveOrganization = new OrganizationsPolicy({
|
|
39
|
+
Name: "deny-leave-organization",
|
|
40
|
+
Type: "SERVICE_CONTROL_POLICY",
|
|
41
|
+
Content: DENY_LEAVE_ORGANIZATION.document,
|
|
42
|
+
Description: DENY_LEAVE_ORGANIZATION.description,
|
|
43
|
+
TargetIds: [props.parentRootId],
|
|
44
|
+
});
|
|
45
|
+
const scpDenyAuditTamper = new OrganizationsPolicy({
|
|
46
|
+
Name: "deny-audit-tamper",
|
|
47
|
+
Type: "SERVICE_CONTROL_POLICY",
|
|
48
|
+
Content: DENY_AUDIT_TAMPER.document,
|
|
49
|
+
Description: DENY_AUDIT_TAMPER.description,
|
|
50
|
+
TargetIds: [ouSecurity.Id],
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
ouSecurity,
|
|
54
|
+
ouInfrastructure,
|
|
55
|
+
ouSandbox,
|
|
56
|
+
ouWorkloads,
|
|
57
|
+
scpDenyLeaveOrganization,
|
|
58
|
+
scpDenyAuditTamper,
|
|
59
|
+
};
|
|
60
|
+
}, "GovernanceFoundation");
|
|
61
|
+
/** A service control policy that denies requests outside the listed regions. */
|
|
62
|
+
export const RegionRestriction = Composite((props) => {
|
|
63
|
+
const policy = regionRestriction(props.regions);
|
|
64
|
+
const scpRegionRestriction = new OrganizationsPolicy({
|
|
65
|
+
Name: "region-restriction",
|
|
66
|
+
Type: "SERVICE_CONTROL_POLICY",
|
|
67
|
+
Content: policy.document,
|
|
68
|
+
Description: policy.description,
|
|
69
|
+
TargetIds: props.targetIds,
|
|
70
|
+
});
|
|
71
|
+
return { scpRegionRestriction };
|
|
72
|
+
}, "RegionRestriction");
|
|
73
|
+
/** An organization-wide CloudTrail trail. */
|
|
74
|
+
export const OrganizationTrail = Composite((props) => {
|
|
75
|
+
const trail = new Trail({
|
|
76
|
+
IsLogging: true,
|
|
77
|
+
S3BucketName: props.bucket,
|
|
78
|
+
IsMultiRegionTrail: true,
|
|
79
|
+
IsOrganizationTrail: true,
|
|
80
|
+
});
|
|
81
|
+
return { trail };
|
|
82
|
+
}, "OrganizationTrail");
|