@intentius/chant-lexicon-aws 0.124.30 → 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,66 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Table, Table_AttributeDefinition, Table_KeySchema, Table_GlobalSecondaryIndex, Table_Projection, Table_ProvisionedThroughput, Table_StreamSpecification, Table_TimeToLiveSpecification, } from "../generated/index.js";
|
|
3
|
+
const DEFAULT_CAPACITY = { readCapacity: 5, writeCapacity: 5 };
|
|
4
|
+
function toProvisionedThroughput(capacity) {
|
|
5
|
+
return new Table_ProvisionedThroughput({
|
|
6
|
+
ReadCapacityUnits: capacity.readCapacity,
|
|
7
|
+
WriteCapacityUnits: capacity.writeCapacity,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function toKeySchema(partitionKey, sortKey) {
|
|
11
|
+
// A ternary (not an `if`) keeps the `new`s unconditional per EVL002, and
|
|
12
|
+
// returning array literals directly from each branch — no spread — sidesteps
|
|
13
|
+
// EVL004 (outside a Composite factory, EVL004 only traces a spread source to a
|
|
14
|
+
// module-top-level const or a literal, not a local variable).
|
|
15
|
+
const partitionEntry = new Table_KeySchema({ AttributeName: partitionKey.name, KeyType: "HASH" });
|
|
16
|
+
const sortEntry = sortKey ? new Table_KeySchema({ AttributeName: sortKey.name, KeyType: "RANGE" }) : undefined;
|
|
17
|
+
return sortEntry ? [partitionEntry, sortEntry] : [partitionEntry];
|
|
18
|
+
}
|
|
19
|
+
/** A DynamoDB table from a partition key, an optional sort key and optional global secondary indexes. */
|
|
20
|
+
export const DynamoDBTable = Composite((props) => {
|
|
21
|
+
const billingMode = props.billingMode ?? "PAY_PER_REQUEST";
|
|
22
|
+
const { defaults } = props;
|
|
23
|
+
// Every key attribute used anywhere (table keys + every GSI's keys) needs exactly
|
|
24
|
+
// one AttributeDefinition. A Map dedupes by name so a GSI reusing the table's
|
|
25
|
+
// partition key (a common pattern) doesn't produce a duplicate definition.
|
|
26
|
+
const attributeTypes = new Map();
|
|
27
|
+
attributeTypes.set(props.partitionKey.name, props.partitionKey.type ?? "S");
|
|
28
|
+
if (props.sortKey)
|
|
29
|
+
attributeTypes.set(props.sortKey.name, props.sortKey.type ?? "S");
|
|
30
|
+
for (const gsi of props.globalSecondaryIndexes ?? []) {
|
|
31
|
+
attributeTypes.set(gsi.partitionKey.name, gsi.partitionKey.type ?? "S");
|
|
32
|
+
if (gsi.sortKey)
|
|
33
|
+
attributeTypes.set(gsi.sortKey.name, gsi.sortKey.type ?? "S");
|
|
34
|
+
}
|
|
35
|
+
const attributeDefinitions = [...attributeTypes.entries()].map(([AttributeName, AttributeType]) => new Table_AttributeDefinition({ AttributeName, AttributeType }));
|
|
36
|
+
const globalSecondaryIndexes = (props.globalSecondaryIndexes ?? []).map((gsi) => new Table_GlobalSecondaryIndex({
|
|
37
|
+
IndexName: gsi.name,
|
|
38
|
+
KeySchema: toKeySchema(gsi.partitionKey, gsi.sortKey),
|
|
39
|
+
Projection: new Table_Projection({
|
|
40
|
+
ProjectionType: gsi.projectionType ?? "ALL",
|
|
41
|
+
...(gsi.nonKeyAttributes ? { NonKeyAttributes: gsi.nonKeyAttributes } : {}),
|
|
42
|
+
}),
|
|
43
|
+
...(billingMode === "PROVISIONED"
|
|
44
|
+
? { ProvisionedThroughput: toProvisionedThroughput(gsi.provisionedThroughput ?? props.provisionedThroughput ?? DEFAULT_CAPACITY) }
|
|
45
|
+
: {}),
|
|
46
|
+
}));
|
|
47
|
+
const streamConfig = props.stream === true ? {} : props.stream || undefined;
|
|
48
|
+
const ttlEnabled = props.ttlAttribute !== undefined;
|
|
49
|
+
const table = new Table(mergeDefaults({
|
|
50
|
+
TableName: props.tableName,
|
|
51
|
+
BillingMode: billingMode,
|
|
52
|
+
AttributeDefinitions: attributeDefinitions,
|
|
53
|
+
KeySchema: toKeySchema(props.partitionKey, props.sortKey),
|
|
54
|
+
...(globalSecondaryIndexes.length > 0 ? { GlobalSecondaryIndexes: globalSecondaryIndexes } : {}),
|
|
55
|
+
...(billingMode === "PROVISIONED"
|
|
56
|
+
? { ProvisionedThroughput: toProvisionedThroughput(props.provisionedThroughput ?? DEFAULT_CAPACITY) }
|
|
57
|
+
: {}),
|
|
58
|
+
...(streamConfig
|
|
59
|
+
? { StreamSpecification: new Table_StreamSpecification({ StreamViewType: streamConfig.viewType ?? "NEW_AND_OLD_IMAGES" }) }
|
|
60
|
+
: {}),
|
|
61
|
+
...(ttlEnabled
|
|
62
|
+
? { TimeToLiveSpecification: new Table_TimeToLiveSpecification({ Enabled: true, AttributeName: props.ttlAttribute }) }
|
|
63
|
+
: {}),
|
|
64
|
+
}, defaults?.table));
|
|
65
|
+
return { table };
|
|
66
|
+
}, "DynamoDBTable");
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Instance, InstanceProfile, Role, SecurityGroup, SecurityGroup_Ingress } from "../generated/index.js";
|
|
3
|
+
import { Base64, Ref } from "../intrinsics.js";
|
|
4
|
+
const EC2_ASSUME_ROLE = {
|
|
5
|
+
Version: "2012-10-17",
|
|
6
|
+
Statement: [
|
|
7
|
+
{
|
|
8
|
+
Effect: "Allow",
|
|
9
|
+
Principal: { Service: "ec2.amazonaws.com" },
|
|
10
|
+
Action: "sts:AssumeRole",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
// A rule needs exactly one traffic source. Kept as a lookup (not an if/else
|
|
15
|
+
// chain that builds the `SecurityGroup_Ingress` inline) so the `new` stays out
|
|
16
|
+
// of control flow (EVL002).
|
|
17
|
+
function ingressSource(rule) {
|
|
18
|
+
if (rule.cidr)
|
|
19
|
+
return { CidrIp: rule.cidr };
|
|
20
|
+
if (rule.cidrIpv6)
|
|
21
|
+
return { CidrIpv6: rule.cidrIpv6 };
|
|
22
|
+
if (rule.sourceSecurityGroupId)
|
|
23
|
+
return { SourceSecurityGroupId: rule.sourceSecurityGroupId };
|
|
24
|
+
throw new Error(`Ec2InstanceBundle ingress rule for port ${rule.fromPort} needs one of cidr, cidrIpv6, or sourceSecurityGroupId`);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* EC2 instance bundle — instance + security group + role/profile + subnet
|
|
28
|
+
* placement, the hand-rolled unit the aws-bench corpus showed 25 times
|
|
29
|
+
* (`ec2.Instance`) alongside 79 `ec2.SecurityGroup` instantiations (#1139).
|
|
30
|
+
* `Ec2InstanceRole` already covers the role/profile half; this composite adds
|
|
31
|
+
* the instance and its security group, wired to that same role.
|
|
32
|
+
*/
|
|
33
|
+
export const Ec2InstanceBundle = Composite((props) => {
|
|
34
|
+
const { defaults } = props;
|
|
35
|
+
const instanceType = props.instanceType ?? "t3.micro";
|
|
36
|
+
const ingress = props.ingress ?? [];
|
|
37
|
+
const role = new Role(mergeDefaults({
|
|
38
|
+
AssumeRolePolicyDocument: EC2_ASSUME_ROLE,
|
|
39
|
+
ManagedPolicyArns: props.ManagedPolicyArns ?? [],
|
|
40
|
+
Policies: props.Policies ?? [],
|
|
41
|
+
}, defaults?.role));
|
|
42
|
+
const instanceProfile = new InstanceProfile(mergeDefaults({
|
|
43
|
+
Roles: [Ref(role)],
|
|
44
|
+
}, defaults?.instanceProfile));
|
|
45
|
+
// The list-length is dynamic (a caller-supplied array of rules, unlike the
|
|
46
|
+
// fixed one-or-zero-rule shape RdsInstance's ternary handles), so this
|
|
47
|
+
// `.map()` — and the `ingressSource(rule)` spread inside it — has to live
|
|
48
|
+
// in the factory rather than be pre-computed as a const above it. Both are
|
|
49
|
+
// the accepted, already-shipped shape for this in the codebase: EVL004
|
|
50
|
+
// exempts spreads inside the Composite factory precisely for this case,
|
|
51
|
+
// and EVL010's warning on the `.map()` here matches the same warning on
|
|
52
|
+
// FargateAlb, FargateService, and EksCluster's per-item resource lists.
|
|
53
|
+
const ingressRules = ingress.map((rule) => new SecurityGroup_Ingress({
|
|
54
|
+
IpProtocol: rule.protocol ?? "tcp",
|
|
55
|
+
FromPort: rule.fromPort,
|
|
56
|
+
ToPort: rule.toPort ?? rule.fromPort,
|
|
57
|
+
Description: rule.description,
|
|
58
|
+
...ingressSource(rule),
|
|
59
|
+
}));
|
|
60
|
+
const sg = new SecurityGroup(mergeDefaults({
|
|
61
|
+
GroupDescription: "Security group for EC2 instance",
|
|
62
|
+
VpcId: props.vpcId,
|
|
63
|
+
SecurityGroupIngress: ingressRules.length > 0 ? ingressRules : undefined,
|
|
64
|
+
}, defaults?.sg));
|
|
65
|
+
const instance = new Instance(mergeDefaults({
|
|
66
|
+
ImageId: props.imageId,
|
|
67
|
+
InstanceType: instanceType,
|
|
68
|
+
SubnetId: props.subnetId,
|
|
69
|
+
SecurityGroupIds: [sg.GroupId],
|
|
70
|
+
IamInstanceProfile: Ref(instanceProfile),
|
|
71
|
+
KeyName: props.keyName,
|
|
72
|
+
UserData: props.userData ? Base64(props.userData) : undefined,
|
|
73
|
+
}, defaults?.instance));
|
|
74
|
+
return { role, instanceProfile, sg, instance };
|
|
75
|
+
}, "Ec2InstanceBundle");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Role, InstanceProfile } from "../generated/index.js";
|
|
3
|
+
import { Ref } from "../intrinsics.js";
|
|
4
|
+
const EC2_ASSUME_ROLE = {
|
|
5
|
+
Version: "2012-10-17",
|
|
6
|
+
Statement: [
|
|
7
|
+
{
|
|
8
|
+
Effect: "Allow",
|
|
9
|
+
Principal: { Service: "ec2.amazonaws.com" },
|
|
10
|
+
Action: "sts:AssumeRole",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
/** An IAM role that EC2 can assume, with the instance profile that attaches it to an instance. */
|
|
15
|
+
export const Ec2InstanceRole = Composite((props) => {
|
|
16
|
+
const { defaults } = props;
|
|
17
|
+
const role = new Role(mergeDefaults({
|
|
18
|
+
AssumeRolePolicyDocument: EC2_ASSUME_ROLE,
|
|
19
|
+
ManagedPolicyArns: props.ManagedPolicyArns ?? [],
|
|
20
|
+
Policies: props.Policies ?? [],
|
|
21
|
+
}, defaults?.role));
|
|
22
|
+
const instanceProfile = new InstanceProfile(mergeDefaults({
|
|
23
|
+
Roles: [Ref(role)],
|
|
24
|
+
}, defaults?.instanceProfile));
|
|
25
|
+
return { role, instanceProfile };
|
|
26
|
+
}, "Ec2InstanceRole");
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { ECRRepository, ECRRepository_EncryptionConfiguration, ECRRepository_ImageScanningConfiguration, ECRRepository_LifecyclePolicy, } from "../generated/index.js";
|
|
3
|
+
const DEFAULT_LIFECYCLE_RULES = [
|
|
4
|
+
{
|
|
5
|
+
rulePriority: 1,
|
|
6
|
+
description: "Expire untagged images after 14 days",
|
|
7
|
+
tagStatus: "untagged",
|
|
8
|
+
countType: "sinceImagePushed",
|
|
9
|
+
countUnit: "days",
|
|
10
|
+
countNumber: 14,
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
function toJsonRule(rule) {
|
|
14
|
+
// Plain conditional assignment (not spread) keeps this traceable for EVL004 —
|
|
15
|
+
// that rule only exempts spreads inside a Composite factory, and this helper
|
|
16
|
+
// runs outside one.
|
|
17
|
+
const selection = {
|
|
18
|
+
tagStatus: rule.tagStatus ?? "any",
|
|
19
|
+
countType: rule.countType,
|
|
20
|
+
countNumber: rule.countNumber,
|
|
21
|
+
};
|
|
22
|
+
if (rule.tagPrefixList)
|
|
23
|
+
selection.tagPrefixList = rule.tagPrefixList;
|
|
24
|
+
if (rule.tagPatternList)
|
|
25
|
+
selection.tagPatternList = rule.tagPatternList;
|
|
26
|
+
if (rule.countUnit)
|
|
27
|
+
selection.countUnit = rule.countUnit;
|
|
28
|
+
const jsonRule = {
|
|
29
|
+
rulePriority: rule.rulePriority,
|
|
30
|
+
selection,
|
|
31
|
+
action: { type: "expire" },
|
|
32
|
+
};
|
|
33
|
+
if (rule.description)
|
|
34
|
+
jsonRule.description = rule.description;
|
|
35
|
+
return jsonRule;
|
|
36
|
+
}
|
|
37
|
+
function toLifecyclePolicyText(rules) {
|
|
38
|
+
return JSON.stringify({ rules: rules.map(toJsonRule) });
|
|
39
|
+
}
|
|
40
|
+
/** An ECR repository with image scanning, encryption and lifecycle rules. */
|
|
41
|
+
export const EcrRepository = Composite((props) => {
|
|
42
|
+
const { defaults } = props;
|
|
43
|
+
const scanOnPush = props.scanOnPush ?? true;
|
|
44
|
+
const lifecycleRules = props.lifecycleRules ?? DEFAULT_LIFECYCLE_RULES;
|
|
45
|
+
const repository = new ECRRepository(mergeDefaults({
|
|
46
|
+
RepositoryName: props.repositoryName,
|
|
47
|
+
ImageTagMutability: props.imageTagMutability,
|
|
48
|
+
EmptyOnDelete: props.emptyOnDelete,
|
|
49
|
+
ImageScanningConfiguration: new ECRRepository_ImageScanningConfiguration({ ScanOnPush: scanOnPush }),
|
|
50
|
+
...(lifecycleRules.length > 0
|
|
51
|
+
? { LifecyclePolicy: new ECRRepository_LifecyclePolicy({ LifecyclePolicyText: toLifecyclePolicyText(lifecycleRules) }) }
|
|
52
|
+
: {}),
|
|
53
|
+
...(props.encryption
|
|
54
|
+
? {
|
|
55
|
+
EncryptionConfiguration: new ECRRepository_EncryptionConfiguration({
|
|
56
|
+
EncryptionType: props.encryption.type ?? "AES256",
|
|
57
|
+
...(props.encryption.kmsKeyId ? { KmsKey: props.encryption.kmsKeyId } : {}),
|
|
58
|
+
}),
|
|
59
|
+
}
|
|
60
|
+
: {}),
|
|
61
|
+
...(props.repositoryPolicy ? { RepositoryPolicyText: props.repositoryPolicy } : {}),
|
|
62
|
+
}, defaults?.repository));
|
|
63
|
+
return { repository };
|
|
64
|
+
}, "EcrRepository");
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Composite } from "@intentius/chant";
|
|
2
|
+
import { EFSFileSystem, EFSFileSystem_ElasticFileSystemTag, EFSAccessPoint, EFSAccessPoint_PosixUser, EFSAccessPoint_RootDirectory, EFSAccessPoint_CreationInfo, EFSAccessPoint_AccessPointTag, SecurityGroup, SecurityGroup_Ingress, } from "../generated/index.js";
|
|
3
|
+
/** An EFS file system with an access point and the security group that admits NFS traffic to it. */
|
|
4
|
+
export const EfsWithAccessPoint = Composite((props) => {
|
|
5
|
+
// Ternary (not push-inside-if) keeps the `new`s out of control flow (EVL002).
|
|
6
|
+
const ingressRules = props.sourceSecurityGroupId
|
|
7
|
+
? [new SecurityGroup_Ingress({ IpProtocol: "tcp", FromPort: 2049, ToPort: 2049, SourceSecurityGroupId: props.sourceSecurityGroupId })]
|
|
8
|
+
: props.ingressCidr
|
|
9
|
+
? [new SecurityGroup_Ingress({ IpProtocol: "tcp", FromPort: 2049, ToPort: 2049, CidrIp: props.ingressCidr })]
|
|
10
|
+
: [];
|
|
11
|
+
const securityGroup = new SecurityGroup({
|
|
12
|
+
GroupDescription: "EFS mount target SG",
|
|
13
|
+
VpcId: props.vpcId,
|
|
14
|
+
...(ingressRules.length > 0 ? { SecurityGroupIngress: ingressRules } : {}),
|
|
15
|
+
});
|
|
16
|
+
const nameTag = new EFSFileSystem_ElasticFileSystemTag({
|
|
17
|
+
Key: "Name",
|
|
18
|
+
Value: props.name,
|
|
19
|
+
});
|
|
20
|
+
const fs = new EFSFileSystem({
|
|
21
|
+
Encrypted: true,
|
|
22
|
+
PerformanceMode: props.performanceMode ?? "generalPurpose",
|
|
23
|
+
ThroughputMode: props.throughputMode ?? "bursting",
|
|
24
|
+
FileSystemTags: [nameTag],
|
|
25
|
+
});
|
|
26
|
+
const posixUser = new EFSAccessPoint_PosixUser({ Uid: props.uid, Gid: props.gid });
|
|
27
|
+
const creationInfo = new EFSAccessPoint_CreationInfo({
|
|
28
|
+
OwnerUid: props.uid,
|
|
29
|
+
OwnerGid: props.gid,
|
|
30
|
+
Permissions: props.permissions ?? "755",
|
|
31
|
+
});
|
|
32
|
+
const rootDirectory = new EFSAccessPoint_RootDirectory({
|
|
33
|
+
Path: props.rootPath,
|
|
34
|
+
CreationInfo: creationInfo,
|
|
35
|
+
});
|
|
36
|
+
const apNameTag = new EFSAccessPoint_AccessPointTag({ Key: "Name", Value: props.name });
|
|
37
|
+
const accessPoint = new EFSAccessPoint({
|
|
38
|
+
FileSystemId: fs.FileSystemId,
|
|
39
|
+
PosixUser: posixUser,
|
|
40
|
+
RootDirectory: rootDirectory,
|
|
41
|
+
AccessPointTags: [apNameTag],
|
|
42
|
+
});
|
|
43
|
+
return { securityGroup, fs, accessPoint };
|
|
44
|
+
}, "EfsWithAccessPoint");
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EksCluster — a managed EKS control plane, its node group, and the two IAM
|
|
3
|
+
* roles they cannot exist without, as the one unit they are.
|
|
4
|
+
*
|
|
5
|
+
* The first consumer is kubemicrovm-ops' cluster plane (its "all infra from
|
|
6
|
+
* the tiers and targets" directive: the cluster stops being a
|
|
7
|
+
* reference-existing input and becomes provisionable), but nothing here is
|
|
8
|
+
* kubemicrovm-shaped — a cluster+nodegroup+roles bundle is what every EKS
|
|
9
|
+
* estate starts with, and cc-aws-canonical's bare cluster is the degenerate
|
|
10
|
+
* form of it.
|
|
11
|
+
*
|
|
12
|
+
* What is deliberately NOT here:
|
|
13
|
+
* - Networking. EKS requires subnets in at least two AZs, and `VpcDefault`
|
|
14
|
+
* (this directory) already provisions exactly that shape — the two
|
|
15
|
+
* composites compose rather than nest, so an adopter with their own VPC
|
|
16
|
+
* passes their own subnet ids.
|
|
17
|
+
* - Add-ons, OIDC/IRSA, access entries. Real per-estate decisions; a bundle
|
|
18
|
+
* that guessed them would fight every adopter. `defaults.cluster` /
|
|
19
|
+
* `defaults.nodegroup` are the escape hatch for the fields this surface
|
|
20
|
+
* does not name.
|
|
21
|
+
*
|
|
22
|
+
* On floci the cluster is k3s-backed and real (`aws eks update-kubeconfig`
|
|
23
|
+
* works, pods run — the cc-aws-canonical estate proved the path); the node
|
|
24
|
+
* group is accepted and tracked but backs no separate machines, which is the
|
|
25
|
+
* emulator being honest about what a laptop can host.
|
|
26
|
+
*/
|
|
27
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
28
|
+
import { Addon, EKSCluster, Nodegroup, Role } from "../generated/index.js";
|
|
29
|
+
import { Sub } from "../intrinsics.js";
|
|
30
|
+
const managedPolicy = (name) => Sub `arn:\${AWS::Partition}:iam::aws:policy/${name}`;
|
|
31
|
+
export const EksCluster = Composite((props) => {
|
|
32
|
+
const { defaults } = props;
|
|
33
|
+
const clusterRole = new Role(mergeDefaults({
|
|
34
|
+
AssumeRolePolicyDocument: {
|
|
35
|
+
Version: "2012-10-17",
|
|
36
|
+
Statement: [
|
|
37
|
+
{ Effect: "Allow", Principal: { Service: "eks.amazonaws.com" }, Action: "sts:AssumeRole" },
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
ManagedPolicyArns: [managedPolicy("AmazonEKSClusterPolicy")],
|
|
41
|
+
Tags: props.tags,
|
|
42
|
+
}, defaults?.clusterRole));
|
|
43
|
+
const cluster = new EKSCluster(mergeDefaults({
|
|
44
|
+
Name: props.name,
|
|
45
|
+
RoleArn: clusterRole.Arn,
|
|
46
|
+
Version: props.version,
|
|
47
|
+
ResourcesVpcConfig: {
|
|
48
|
+
SubnetIds: props.subnetIds,
|
|
49
|
+
...(props.securityGroupIds ? { SecurityGroupIds: props.securityGroupIds } : {}),
|
|
50
|
+
},
|
|
51
|
+
Tags: props.tags,
|
|
52
|
+
}, defaults?.cluster));
|
|
53
|
+
// Three fixed add-on slots, the same statically-evaluable shape
|
|
54
|
+
// vpc-default uses for its optional third AZ: a ternary is an expression
|
|
55
|
+
// (EVL-clean); a loop-built member map is control flow the reference
|
|
56
|
+
// composites must not contain (EVL002/EVL003). Members are addon1..addon3
|
|
57
|
+
// in the caller's order — logical ids stay stable as long as the order
|
|
58
|
+
// does, which the caller controls.
|
|
59
|
+
const a1 = props.addons?.[0];
|
|
60
|
+
const a2 = props.addons?.[1];
|
|
61
|
+
const a3 = props.addons?.[2];
|
|
62
|
+
const addon1 = a1
|
|
63
|
+
? new Addon({ ClusterName: props.name, AddonName: a1.name, AddonVersion: a1.version, Tags: props.tags }, { DependsOn: [cluster] })
|
|
64
|
+
: undefined;
|
|
65
|
+
const addon2 = a2
|
|
66
|
+
? new Addon({ ClusterName: props.name, AddonName: a2.name, AddonVersion: a2.version, Tags: props.tags }, { DependsOn: [cluster] })
|
|
67
|
+
: undefined;
|
|
68
|
+
const addon3 = a3
|
|
69
|
+
? new Addon({ ClusterName: props.name, AddonName: a3.name, AddonVersion: a3.version, Tags: props.tags }, { DependsOn: [cluster] })
|
|
70
|
+
: undefined;
|
|
71
|
+
if (!props.nodegroup) {
|
|
72
|
+
return {
|
|
73
|
+
clusterRole,
|
|
74
|
+
cluster,
|
|
75
|
+
...(addon1 ? { addon1 } : {}),
|
|
76
|
+
...(addon2 ? { addon2 } : {}),
|
|
77
|
+
...(addon3 ? { addon3 } : {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const nodeRole = new Role(mergeDefaults({
|
|
81
|
+
AssumeRolePolicyDocument: {
|
|
82
|
+
Version: "2012-10-17",
|
|
83
|
+
Statement: [
|
|
84
|
+
{ Effect: "Allow", Principal: { Service: "ec2.amazonaws.com" }, Action: "sts:AssumeRole" },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
ManagedPolicyArns: [
|
|
88
|
+
managedPolicy("AmazonEKSWorkerNodePolicy"),
|
|
89
|
+
managedPolicy("AmazonEKS_CNI_Policy"),
|
|
90
|
+
managedPolicy("AmazonEC2ContainerRegistryReadOnly"),
|
|
91
|
+
],
|
|
92
|
+
Tags: props.tags,
|
|
93
|
+
}, defaults?.nodeRole));
|
|
94
|
+
const nodegroup = new Nodegroup(mergeDefaults({
|
|
95
|
+
// The literal, not an attribute reference: Name is an input the caller
|
|
96
|
+
// gave us, and the generated class exposes accessors only for GetAtt
|
|
97
|
+
// attributes. The creation-order edge is DependsOn below.
|
|
98
|
+
ClusterName: props.name,
|
|
99
|
+
NodeRole: nodeRole.Arn,
|
|
100
|
+
Subnets: props.nodegroup.subnetIds ?? props.subnetIds,
|
|
101
|
+
InstanceTypes: props.nodegroup.instanceTypes ?? ["t3.medium"],
|
|
102
|
+
ScalingConfig: {
|
|
103
|
+
DesiredSize: props.nodegroup.desiredSize ?? 2,
|
|
104
|
+
MinSize: props.nodegroup.minSize ?? props.nodegroup.desiredSize ?? 2,
|
|
105
|
+
MaxSize: props.nodegroup.maxSize ?? props.nodegroup.desiredSize ?? 2,
|
|
106
|
+
},
|
|
107
|
+
Tags: props.tags ? Object.fromEntries(props.tags.map((t) => [t.Key, t.Value])) : undefined,
|
|
108
|
+
}, defaults?.nodegroup), { DependsOn: [cluster] });
|
|
109
|
+
return {
|
|
110
|
+
clusterRole,
|
|
111
|
+
cluster,
|
|
112
|
+
nodeRole,
|
|
113
|
+
nodegroup,
|
|
114
|
+
...(addon1 ? { addon1 } : {}),
|
|
115
|
+
...(addon2 ? { addon2 } : {}),
|
|
116
|
+
...(addon3 ? { addon3 } : {}),
|
|
117
|
+
};
|
|
118
|
+
}, "EksCluster");
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { EcsCluster, EcsService, EcsService_LoadBalancer, EcsService_NetworkConfiguration, EcsService_AwsVpcConfiguration, TaskDefinition, TaskDefinition_ContainerDefinition, TaskDefinition_PortMapping, TaskDefinition_LogConfiguration, TaskDefinition_KeyValuePair, LoadBalancer, TargetGroup, Listener, Listener_Action, Listener_Certificate, Listener_RedirectConfig, SecurityGroup, SecurityGroup_Ingress, LogGroup, Role, Role_Policy, } from "../generated/index.js";
|
|
3
|
+
import { Sub } from "../intrinsics.js";
|
|
4
|
+
import { ECRActions } from "../actions/ecr.js";
|
|
5
|
+
import { LogsActions } from "../actions/logs.js";
|
|
6
|
+
import { ecsTrustPolicy } from "./ecs-trust-policy.js";
|
|
7
|
+
/** A Fargate service behind its own Application Load Balancer: cluster, task definition, service, target group, listener, logs and roles. */
|
|
8
|
+
export const FargateAlb = Composite((props) => {
|
|
9
|
+
const containerPort = props.containerPort ?? 80;
|
|
10
|
+
const cpu = props.cpu ?? "256";
|
|
11
|
+
const memory = props.memory ?? "512";
|
|
12
|
+
const desiredCount = props.desiredCount ?? 2;
|
|
13
|
+
const healthCheckPath = props.healthCheckPath ?? "/";
|
|
14
|
+
const listenerPort = props.listenerPort ?? 80;
|
|
15
|
+
const logRetentionDays = props.logRetentionDays ?? 30;
|
|
16
|
+
const { defaults: defs } = props;
|
|
17
|
+
// ECS Cluster
|
|
18
|
+
const cluster = new EcsCluster(mergeDefaults({}, defs?.cluster));
|
|
19
|
+
// Execution role — ECR pull + CloudWatch Logs write
|
|
20
|
+
const executionPolicyDocument = {
|
|
21
|
+
Version: "2012-10-17",
|
|
22
|
+
Statement: [
|
|
23
|
+
{
|
|
24
|
+
Effect: "Allow",
|
|
25
|
+
Action: ECRActions.Pull,
|
|
26
|
+
Resource: "*",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
Effect: "Allow",
|
|
30
|
+
Action: LogsActions.Write,
|
|
31
|
+
Resource: "*",
|
|
32
|
+
},
|
|
33
|
+
// Allow pulling private-registry credentials when configured.
|
|
34
|
+
...(props.repositoryCredentials
|
|
35
|
+
? [{
|
|
36
|
+
Effect: "Allow",
|
|
37
|
+
Action: ["secretsmanager:GetSecretValue"],
|
|
38
|
+
Resource: props.repositoryCredentials,
|
|
39
|
+
}]
|
|
40
|
+
: []),
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
const executionPolicy = new Role_Policy({
|
|
44
|
+
PolicyName: "ExecutionPolicy",
|
|
45
|
+
PolicyDocument: executionPolicyDocument,
|
|
46
|
+
});
|
|
47
|
+
const executionRole = new Role(mergeDefaults({
|
|
48
|
+
AssumeRolePolicyDocument: ecsTrustPolicy,
|
|
49
|
+
Policies: [executionPolicy],
|
|
50
|
+
}, defs?.executionRole));
|
|
51
|
+
// Task role — app permissions
|
|
52
|
+
const taskRole = new Role(mergeDefaults({
|
|
53
|
+
AssumeRolePolicyDocument: ecsTrustPolicy,
|
|
54
|
+
ManagedPolicyArns: props.ManagedPolicyArns,
|
|
55
|
+
Policies: props.Policies,
|
|
56
|
+
}, defs?.taskRole));
|
|
57
|
+
// Log group
|
|
58
|
+
const logGroup = new LogGroup({
|
|
59
|
+
RetentionInDays: logRetentionDays,
|
|
60
|
+
});
|
|
61
|
+
// Container definition
|
|
62
|
+
const portMapping = new TaskDefinition_PortMapping({
|
|
63
|
+
ContainerPort: containerPort,
|
|
64
|
+
Protocol: "tcp",
|
|
65
|
+
});
|
|
66
|
+
const logConfiguration = new TaskDefinition_LogConfiguration({
|
|
67
|
+
LogDriver: "awslogs",
|
|
68
|
+
Options: {
|
|
69
|
+
"awslogs-group": logGroup,
|
|
70
|
+
"awslogs-region": Sub `\${AWS::Region}`,
|
|
71
|
+
"awslogs-stream-prefix": "ecs",
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
// `.map` keeps the `new`s out of the `for`/`if` (EVL002).
|
|
75
|
+
const environmentVars = props.environment
|
|
76
|
+
? Object.entries(props.environment).map(([name, value]) => new TaskDefinition_KeyValuePair({ Name: name, Value: value }))
|
|
77
|
+
: [];
|
|
78
|
+
const container = new TaskDefinition_ContainerDefinition({
|
|
79
|
+
Name: "app",
|
|
80
|
+
Image: props.image,
|
|
81
|
+
Essential: true,
|
|
82
|
+
PortMappings: [portMapping],
|
|
83
|
+
LogConfiguration: logConfiguration,
|
|
84
|
+
Environment: environmentVars.length > 0 ? environmentVars : undefined,
|
|
85
|
+
Command: props.command,
|
|
86
|
+
RepositoryCredentials: props.repositoryCredentials
|
|
87
|
+
? { CredentialsParameter: props.repositoryCredentials }
|
|
88
|
+
: undefined,
|
|
89
|
+
});
|
|
90
|
+
// Task definition
|
|
91
|
+
const taskDef = new TaskDefinition(mergeDefaults({
|
|
92
|
+
NetworkMode: "awsvpc",
|
|
93
|
+
RequiresCompatibilities: ["FARGATE"],
|
|
94
|
+
Cpu: cpu,
|
|
95
|
+
Memory: memory,
|
|
96
|
+
ExecutionRoleArn: executionRole.Arn,
|
|
97
|
+
TaskRoleArn: taskRole.Arn,
|
|
98
|
+
ContainerDefinitions: [container],
|
|
99
|
+
}, defs?.taskDef));
|
|
100
|
+
// ALB security group — ingress on the served port(s) from anywhere. With a
|
|
101
|
+
// cert that's 443 (HTTPS) + 80 (redirect); otherwise the plain listener port.
|
|
102
|
+
const ingressPorts = props.certificateArn ? [443, 80] : [listenerPort];
|
|
103
|
+
const albIngress = ingressPorts.map((port) => new SecurityGroup_Ingress({
|
|
104
|
+
IpProtocol: "tcp",
|
|
105
|
+
FromPort: port,
|
|
106
|
+
ToPort: port,
|
|
107
|
+
CidrIp: "0.0.0.0/0",
|
|
108
|
+
}));
|
|
109
|
+
const albSg = new SecurityGroup({
|
|
110
|
+
GroupDescription: "ALB security group",
|
|
111
|
+
VpcId: props.vpcId,
|
|
112
|
+
SecurityGroupIngress: albIngress,
|
|
113
|
+
});
|
|
114
|
+
// Task security group — ingress on container port from ALB SG
|
|
115
|
+
const taskIngress = new SecurityGroup_Ingress({
|
|
116
|
+
IpProtocol: "tcp",
|
|
117
|
+
FromPort: containerPort,
|
|
118
|
+
ToPort: containerPort,
|
|
119
|
+
SourceSecurityGroupId: albSg.GroupId,
|
|
120
|
+
});
|
|
121
|
+
const taskSg = new SecurityGroup({
|
|
122
|
+
GroupDescription: "Fargate task security group",
|
|
123
|
+
VpcId: props.vpcId,
|
|
124
|
+
SecurityGroupIngress: [taskIngress],
|
|
125
|
+
});
|
|
126
|
+
// Application Load Balancer
|
|
127
|
+
const alb = new LoadBalancer(mergeDefaults({
|
|
128
|
+
Type: "application",
|
|
129
|
+
Scheme: "internet-facing",
|
|
130
|
+
Subnets: props.publicSubnetIds,
|
|
131
|
+
SecurityGroups: [albSg.GroupId],
|
|
132
|
+
}, defs?.alb));
|
|
133
|
+
// Target group
|
|
134
|
+
const targetGroup = new TargetGroup(mergeDefaults({
|
|
135
|
+
TargetType: "ip",
|
|
136
|
+
Protocol: "HTTP",
|
|
137
|
+
Port: containerPort,
|
|
138
|
+
VpcId: props.vpcId,
|
|
139
|
+
HealthCheckPath: healthCheckPath,
|
|
140
|
+
}, defs?.targetGroup));
|
|
141
|
+
// Listener(s). With a cert: HTTPS:443 forwards to the target group and HTTP:80
|
|
142
|
+
// redirects to HTTPS. Without: a single HTTP listener on `listenerPort`.
|
|
143
|
+
const forwardAction = new Listener_Action({
|
|
144
|
+
Type: "forward",
|
|
145
|
+
TargetGroupArn: targetGroup.TargetGroupArn,
|
|
146
|
+
});
|
|
147
|
+
// Ternaries keep the `new`s out of the `if`/`else` (EVL002).
|
|
148
|
+
const listener = props.certificateArn
|
|
149
|
+
? new Listener({
|
|
150
|
+
LoadBalancerArn: alb.LoadBalancerArn,
|
|
151
|
+
Port: 443,
|
|
152
|
+
Protocol: "HTTPS",
|
|
153
|
+
Certificates: [new Listener_Certificate({ CertificateArn: props.certificateArn })],
|
|
154
|
+
DefaultActions: [forwardAction],
|
|
155
|
+
})
|
|
156
|
+
: new Listener({
|
|
157
|
+
LoadBalancerArn: alb.LoadBalancerArn,
|
|
158
|
+
Port: listenerPort,
|
|
159
|
+
Protocol: "HTTP",
|
|
160
|
+
DefaultActions: [forwardAction],
|
|
161
|
+
});
|
|
162
|
+
const redirectListener = props.certificateArn
|
|
163
|
+
? new Listener({
|
|
164
|
+
LoadBalancerArn: alb.LoadBalancerArn,
|
|
165
|
+
Port: 80,
|
|
166
|
+
Protocol: "HTTP",
|
|
167
|
+
DefaultActions: [
|
|
168
|
+
new Listener_Action({
|
|
169
|
+
Type: "redirect",
|
|
170
|
+
RedirectConfig: new Listener_RedirectConfig({
|
|
171
|
+
Protocol: "HTTPS",
|
|
172
|
+
Port: "443",
|
|
173
|
+
StatusCode: "HTTP_301",
|
|
174
|
+
}),
|
|
175
|
+
}),
|
|
176
|
+
],
|
|
177
|
+
})
|
|
178
|
+
: undefined;
|
|
179
|
+
// ECS Service
|
|
180
|
+
const serviceLoadBalancer = new EcsService_LoadBalancer({
|
|
181
|
+
ContainerName: "app",
|
|
182
|
+
ContainerPort: containerPort,
|
|
183
|
+
TargetGroupArn: targetGroup.TargetGroupArn,
|
|
184
|
+
});
|
|
185
|
+
const awsVpcConfig = new EcsService_AwsVpcConfiguration({
|
|
186
|
+
Subnets: props.privateSubnetIds,
|
|
187
|
+
SecurityGroups: [taskSg.GroupId],
|
|
188
|
+
AssignPublicIp: "DISABLED",
|
|
189
|
+
});
|
|
190
|
+
const networkConfig = new EcsService_NetworkConfiguration({
|
|
191
|
+
AwsvpcConfiguration: awsVpcConfig,
|
|
192
|
+
});
|
|
193
|
+
const service = new EcsService(mergeDefaults({
|
|
194
|
+
Cluster: cluster.Arn,
|
|
195
|
+
TaskDefinition: taskDef.TaskDefinitionArn,
|
|
196
|
+
LaunchType: "FARGATE",
|
|
197
|
+
DesiredCount: desiredCount,
|
|
198
|
+
HealthCheckGracePeriodSeconds: 60,
|
|
199
|
+
LoadBalancers: [serviceLoadBalancer],
|
|
200
|
+
NetworkConfiguration: networkConfig,
|
|
201
|
+
}, defs?.service), { DependsOn: [listener] });
|
|
202
|
+
return {
|
|
203
|
+
cluster,
|
|
204
|
+
executionRole,
|
|
205
|
+
taskRole,
|
|
206
|
+
logGroup,
|
|
207
|
+
taskDef,
|
|
208
|
+
albSg,
|
|
209
|
+
taskSg,
|
|
210
|
+
alb,
|
|
211
|
+
targetGroup,
|
|
212
|
+
listener,
|
|
213
|
+
...(redirectListener ? { redirectListener } : {}),
|
|
214
|
+
service,
|
|
215
|
+
};
|
|
216
|
+
}, "FargateAlb");
|