@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,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* safety / rollback family — explicit snapshot-and-restore capabilities, used
|
|
3
|
+
* alongside the per-capability `rollback` compensation for cases that need an
|
|
4
|
+
* up-front capture (e.g. before a `cfn-deploy` with `onReplace: "snapshot-first"`).
|
|
5
|
+
*
|
|
6
|
+
* Both dispatch to the kind-appropriate AWS backup/restore mechanism through the
|
|
7
|
+
* injectable `CloudExecutor` (DynamoDB backup, RDS DB snapshot, EBS snapshot).
|
|
8
|
+
*/
|
|
9
|
+
import { defaultCloudExecutor } from "./cloud-executor.js";
|
|
10
|
+
/**
|
|
11
|
+
* Capture a restorable snapshot before a risky/destructive apply step, via the
|
|
12
|
+
* kind-appropriate AWS backup mechanism through the injectable `CloudExecutor`
|
|
13
|
+
* (DynamoDB on-demand backup, RDS DB snapshot, or EBS volume snapshot). Returns
|
|
14
|
+
* the backup/snapshot id `rollback-previous` restores from.
|
|
15
|
+
*/
|
|
16
|
+
export function createSnapshotBeforeCapability(executor = defaultCloudExecutor()) {
|
|
17
|
+
return {
|
|
18
|
+
kind: "snapshot-before",
|
|
19
|
+
async run(_ctx, input) {
|
|
20
|
+
return executor.snapshot.create({ resource: input.resource, resourceKind: input.resourceKind });
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Default `snapshot-before` capability, backed by the real `CloudExecutor`. */
|
|
25
|
+
export const snapshotBeforeCapability = createSnapshotBeforeCapability();
|
|
26
|
+
/**
|
|
27
|
+
* Roll a resource back to its prior state — an explicit, caller-composed
|
|
28
|
+
* compensation (not the auto-triggered per-capability `rollback`). Dispatches by
|
|
29
|
+
* the input shape: an ECS service (`{service, cluster, taskDefinition}`) rolls to
|
|
30
|
+
* that task definition, and fails without one (#2605); a snapshot (`{snapshotId, resource}`) restores that capture.
|
|
31
|
+
* An unrecognized shape fails with a clear message rather than a cryptic
|
|
32
|
+
* `undefined` access (chant #990 — an ECS-shaped input used to reach the
|
|
33
|
+
* snapshot path and throw "reading 'includes'" on the absent snapshotId).
|
|
34
|
+
*/
|
|
35
|
+
export function createRollbackPreviousCapability(executor = defaultCloudExecutor()) {
|
|
36
|
+
return {
|
|
37
|
+
kind: "rollback-previous",
|
|
38
|
+
async run(_ctx, input) {
|
|
39
|
+
if ("service" in input && input.service) {
|
|
40
|
+
if (!input.taskDefinition) {
|
|
41
|
+
throw new Error(`rollback-previous: ECS service "${input.service}" needs a taskDefinition to roll back to; ` +
|
|
42
|
+
`nothing records the previous one. For an earlier release use \`chant components rollback\``);
|
|
43
|
+
}
|
|
44
|
+
await executor.ecs.rollbackService({
|
|
45
|
+
cluster: input.cluster,
|
|
46
|
+
service: input.service,
|
|
47
|
+
taskDefinition: input.taskDefinition,
|
|
48
|
+
desiredCount: input.desiredCount,
|
|
49
|
+
});
|
|
50
|
+
return { restored: true };
|
|
51
|
+
}
|
|
52
|
+
if ("snapshotId" in input && input.snapshotId) {
|
|
53
|
+
await executor.snapshot.restore({ resource: input.resource, snapshotId: input.snapshotId });
|
|
54
|
+
return { restored: true };
|
|
55
|
+
}
|
|
56
|
+
throw new Error(`rollback-previous: unrecognized input — expected { service, cluster } (ECS service rollback) or ` +
|
|
57
|
+
`{ snapshotId, resource } (snapshot restore), got keys [${Object.keys(input).join(", ")}]`);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Default `rollback-previous` capability, backed by the real `CloudExecutor`. */
|
|
62
|
+
export const rollbackPreviousCapability = createRollbackPreviousCapability();
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wait / verify family — the cloud-specific members, owned by the aws lexicon:
|
|
3
|
+
* `wait-for-stack` (CloudFormation), `wait-steady-state` (ECS), `wait-job`
|
|
4
|
+
* (EMR). The agnostic waits (`wait-cluster-healthy`, `wait-endpoint`,
|
|
5
|
+
* `health-gate`) stay in core. All poll a real cloud through the injectable aws
|
|
6
|
+
* `CloudExecutor` (./cloud-executor.ts); none has a rollback — a wait is a
|
|
7
|
+
* read-only observation, never a mutation.
|
|
8
|
+
*/
|
|
9
|
+
import { defaultCloudExecutor, sleep } from "./cloud-executor.js";
|
|
10
|
+
/** Poll a CloudFormation stack until it reaches a terminal status. No rollback: a wait is a read-only observation. */
|
|
11
|
+
export function createWaitForStackCapability(executor = defaultCloudExecutor()) {
|
|
12
|
+
return {
|
|
13
|
+
kind: "wait-for-stack",
|
|
14
|
+
async run(_ctx, input) {
|
|
15
|
+
const { stackStatus } = await executor.cloudformation.waitForStack(input.stack, {
|
|
16
|
+
intervalMs: input.intervalMs,
|
|
17
|
+
timeoutMs: input.timeoutMs,
|
|
18
|
+
});
|
|
19
|
+
return { stackStatus };
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Default `wait-for-stack` capability, backed by the real aws `CloudExecutor`. */
|
|
24
|
+
export const waitForStackCapability = createWaitForStackCapability();
|
|
25
|
+
/** Poll an ECS service until running count matches desired and no deployment is in flight. No rollback: read-only. */
|
|
26
|
+
export function createWaitSteadyStateCapability(executor = defaultCloudExecutor()) {
|
|
27
|
+
return {
|
|
28
|
+
kind: "wait-steady-state",
|
|
29
|
+
async run(_ctx, input) {
|
|
30
|
+
const cluster = input.cluster ?? "default";
|
|
31
|
+
const intervalMs = input.intervalMs ?? 10000;
|
|
32
|
+
const deadline = Date.now() + (input.timeoutMs ?? 10 * 60000);
|
|
33
|
+
while (true) {
|
|
34
|
+
const state = await executor.ecs.describeService(cluster, input.service);
|
|
35
|
+
if (state.stable)
|
|
36
|
+
return { runningCount: state.runningCount };
|
|
37
|
+
if (Date.now() > deadline) {
|
|
38
|
+
throw new Error(`wait-steady-state "${input.service}" timed out before reaching steady state`);
|
|
39
|
+
}
|
|
40
|
+
await sleep(intervalMs);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Default `wait-steady-state` capability, backed by the real aws `CloudExecutor`. */
|
|
46
|
+
export const waitSteadyStateCapability = createWaitSteadyStateCapability();
|
|
47
|
+
/**
|
|
48
|
+
* Poll a submitted job/step (e.g. an EMR job run started by `emr-start-job-run`)
|
|
49
|
+
* until it reaches a terminal state, failing the step if that state is not
|
|
50
|
+
* `COMPLETED`. No rollback: read-only observation.
|
|
51
|
+
*/
|
|
52
|
+
export function createWaitJobCapability(executor = defaultCloudExecutor()) {
|
|
53
|
+
return {
|
|
54
|
+
kind: "wait-job",
|
|
55
|
+
async run(_ctx, input) {
|
|
56
|
+
const { state } = await executor.emr.waitForJobRun(input.runId, {
|
|
57
|
+
intervalMs: input.intervalMs,
|
|
58
|
+
timeoutMs: input.timeoutMs,
|
|
59
|
+
});
|
|
60
|
+
if (state !== "COMPLETED") {
|
|
61
|
+
throw new Error(`wait-job "${input.runId}" ended in terminal state "${state}", expected "COMPLETED"`);
|
|
62
|
+
}
|
|
63
|
+
return { state };
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** Default `wait-job` capability, backed by the real aws `CloudExecutor`. */
|
|
68
|
+
export const waitJobCapability = createWaitJobCapability();
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { Role, Runtime, Runtime_AgentRuntimeArtifact, Runtime_Code, Runtime_CodeConfiguration, Runtime_ContainerConfiguration, Runtime_NetworkConfiguration, Runtime_VpcConfig, RuntimeEndpoint, Memory, BedrockAgentCoreGateway, GatewayTarget, WorkloadIdentity, } from "../generated/index.js";
|
|
3
|
+
import { agentCoreTrustPolicy } from "./agentcore-trust-policy.js";
|
|
4
|
+
import { Sub } from "../intrinsics.js";
|
|
5
|
+
/**
|
|
6
|
+
* ARN of the managed `DEFAULT` endpoint AgentCore provisions with a Runtime,
|
|
7
|
+
* as an `Fn::Sub` over the Runtime's ARN. No CloudFormation attribute carries
|
|
8
|
+
* it (the Runtime schema exposes only `AgentRuntimeArn`/`AgentRuntimeId`/
|
|
9
|
+
* `AgentRuntimeVersion`/`Status`), but the format is fixed by the
|
|
10
|
+
* CreateAgentRuntimeEndpoint API:
|
|
11
|
+
* `arn:aws:bedrock-agentcore:<region>:<account>:runtime/<id>/runtime-endpoint/<name>`.
|
|
12
|
+
*/
|
|
13
|
+
export function agentCoreDefaultEndpointArn(runtime) {
|
|
14
|
+
return Sub `${runtime.AgentRuntimeArn}/runtime-endpoint/DEFAULT`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Bedrock AgentCore's real limits, verified against the CloudFormation
|
|
18
|
+
* registry schema for `AWS::BedrockAgentCore::{Runtime,RuntimeEndpoint,Memory}`
|
|
19
|
+
* (#882).
|
|
20
|
+
*
|
|
21
|
+
* Exported for the same reason as `MICROVM_LIMITS` (#1374, #1420): a
|
|
22
|
+
* consumer driving AgentCore through another control plane needs the same
|
|
23
|
+
* numbers, and copying them is how two sources of truth start.
|
|
24
|
+
*/
|
|
25
|
+
export const AGENTCORE_LIMITS = {
|
|
26
|
+
/**
|
|
27
|
+
* `Runtime`/`RuntimeEndpoint`/`Memory` `Name`/`AgentRuntimeName` fields
|
|
28
|
+
* are bound to this pattern — no hyphens, unlike chant's usual kebab-case
|
|
29
|
+
* component names. `Gateway`/`GatewayTarget`/`WorkloadIdentity` names
|
|
30
|
+
* accept hyphens, so only the Runtime family needs sanitizing.
|
|
31
|
+
*/
|
|
32
|
+
runtimeNamePattern: /^[a-zA-Z][a-zA-Z0-9_]{0,47}$/,
|
|
33
|
+
maxRuntimeNameLength: 48,
|
|
34
|
+
/** `Memory` event retention bounds, in days. */
|
|
35
|
+
memoryEventExpiryDays: { min: 3, max: 365, default: 30 },
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Non-identifier characters become `_`, and a leading digit/underscore gets
|
|
39
|
+
* an `A` prefix so the result always starts with a letter — then truncated
|
|
40
|
+
* to {@link AGENTCORE_LIMITS}'s `maxRuntimeNameLength`.
|
|
41
|
+
*/
|
|
42
|
+
function toRuntimeIdentifier(name) {
|
|
43
|
+
const cleaned = name.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
44
|
+
const identifier = /^[a-zA-Z]/.test(cleaned) ? cleaned : `A${cleaned}`;
|
|
45
|
+
return identifier.slice(0, AGENTCORE_LIMITS.maxRuntimeNameLength);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A Bedrock AgentCore agent as one CloudFormation-serializable bundle — the
|
|
49
|
+
* composite/base path from #882: `Runtime` + `Memory` +
|
|
50
|
+
* `Gateway`/`GatewayTarget` + `WorkloadIdentity` + IAM, deployable with
|
|
51
|
+
* `cfn-deploy` + `wait-for-stack` and no bespoke verb.
|
|
52
|
+
*
|
|
53
|
+
* `WorkloadIdentityDetails` on both `Runtime` and `BedrockAgentCoreGateway`
|
|
54
|
+
* is CFN `readOnly` — AWS provisions a workload identity per resource
|
|
55
|
+
* automatically, and neither accepts one as an input. The `WorkloadIdentity`
|
|
56
|
+
* resource this composite creates is therefore standalone (not cross-wired
|
|
57
|
+
* to `runtime`/`gateway`), included because #882 calls for it — it exists
|
|
58
|
+
* for workflows (e.g. a future credential-provider capability) that need an
|
|
59
|
+
* explicit workload identity of their own.
|
|
60
|
+
*
|
|
61
|
+
* There is no `RuntimeEndpoint` in the bundle by default. AgentCore creates a
|
|
62
|
+
* managed `DEFAULT` endpoint with every Runtime and repoints it at each new
|
|
63
|
+
* version on its own, so a CloudFormation `DEFAULT` endpoint is redundant. It
|
|
64
|
+
* is also the race that sank a live deploy (#978): the Runtime resource's
|
|
65
|
+
* `CREATE_COMPLETE` fires while AgentCore is still turning the artifact into
|
|
66
|
+
* a READY agent version, and the endpoint's CREATE then fails with "Agent
|
|
67
|
+
* version 1 must be in READY status". Invoking the Runtime with no qualifier
|
|
68
|
+
* hits the managed DEFAULT endpoint; {@link agentCoreDefaultEndpointArn}
|
|
69
|
+
* builds its ARN from the Runtime's. `endpointName` adds an explicit
|
|
70
|
+
* non-DEFAULT endpoint for the `agentcore-deploy` version-promotion flow,
|
|
71
|
+
* which is deferred (GA-gated, #882) — this composite only wires the
|
|
72
|
+
* CloudFormation shape it would eventually apply against.
|
|
73
|
+
*/
|
|
74
|
+
export const AgentCoreAgent = Composite((props) => {
|
|
75
|
+
const { defaults } = props;
|
|
76
|
+
// Exactly one artifact source. Both-or-neither is a modeling mistake CFN
|
|
77
|
+
// would also reject (AgentRuntimeArtifact is a one-of), caught here so the
|
|
78
|
+
// error names the composite prop rather than a raw CFN validation string.
|
|
79
|
+
if ((props.containerUri === undefined) === (props.code === undefined)) {
|
|
80
|
+
throw new Error("AgentCoreAgent requires exactly one of containerUri or code");
|
|
81
|
+
}
|
|
82
|
+
const networkMode = props.networkMode ?? "PUBLIC";
|
|
83
|
+
// Check presence, not `.length`: a cross-stack value (Fn::Split of a Parameter,
|
|
84
|
+
// the shape stackOutput/Ref/Split produce) is a truthy intrinsic object with no
|
|
85
|
+
// `.length`, so a `.length` check wrongly rejects a value that WAS supplied
|
|
86
|
+
// (#938). An actually-empty list is caught by CloudFormation at deploy time.
|
|
87
|
+
if (networkMode === "VPC" && (props.vpcSubnetIds === undefined || props.vpcSecurityGroupIds === undefined)) {
|
|
88
|
+
throw new Error("AgentCoreAgent requires vpcSubnetIds and vpcSecurityGroupIds when networkMode is \"VPC\"");
|
|
89
|
+
}
|
|
90
|
+
const memoryEventExpiryDays = props.memoryEventExpiryDays ?? AGENTCORE_LIMITS.memoryEventExpiryDays.default;
|
|
91
|
+
if (memoryEventExpiryDays < AGENTCORE_LIMITS.memoryEventExpiryDays.min ||
|
|
92
|
+
memoryEventExpiryDays > AGENTCORE_LIMITS.memoryEventExpiryDays.max) {
|
|
93
|
+
throw new Error(`AgentCoreAgent memoryEventExpiryDays must be between ${AGENTCORE_LIMITS.memoryEventExpiryDays.min} and ${AGENTCORE_LIMITS.memoryEventExpiryDays.max}`);
|
|
94
|
+
}
|
|
95
|
+
const runtimeName = toRuntimeIdentifier(props.name);
|
|
96
|
+
// Runtime + Memory share one execution role — both are AgentCore-hosted
|
|
97
|
+
// and assume the same service principal (see agentcore-trust-policy.ts).
|
|
98
|
+
const role = new Role(mergeDefaults({
|
|
99
|
+
AssumeRolePolicyDocument: agentCoreTrustPolicy,
|
|
100
|
+
ManagedPolicyArns: props.ManagedPolicyArns,
|
|
101
|
+
Policies: props.Policies,
|
|
102
|
+
}, defaults?.role));
|
|
103
|
+
// Gateway assumes its own role to invoke targets (e.g. this agent's own
|
|
104
|
+
// Runtime endpoint) — kept separate from the Runtime/Memory role so its
|
|
105
|
+
// permissions don't have to grow with the agent's own execution needs.
|
|
106
|
+
const gatewayRole = new Role(mergeDefaults({
|
|
107
|
+
AssumeRolePolicyDocument: agentCoreTrustPolicy,
|
|
108
|
+
}, defaults?.gatewayRole));
|
|
109
|
+
const networkConfiguration = new Runtime_NetworkConfiguration({
|
|
110
|
+
NetworkMode: networkMode,
|
|
111
|
+
NetworkModeConfig: networkMode === "VPC"
|
|
112
|
+
? new Runtime_VpcConfig({
|
|
113
|
+
SecurityGroups: props.vpcSecurityGroupIds,
|
|
114
|
+
Subnets: props.vpcSubnetIds,
|
|
115
|
+
})
|
|
116
|
+
: undefined,
|
|
117
|
+
});
|
|
118
|
+
// CFN `Code.S3` is a free-form location object in the generated type; its
|
|
119
|
+
// keys (Bucket/Prefix/VersionId) come straight from the CloudFormation
|
|
120
|
+
// schema for AWS::BedrockAgentCore::Runtime.
|
|
121
|
+
const artifact = props.code
|
|
122
|
+
? new Runtime_AgentRuntimeArtifact({
|
|
123
|
+
CodeConfiguration: new Runtime_CodeConfiguration({
|
|
124
|
+
Code: new Runtime_Code({
|
|
125
|
+
S3: {
|
|
126
|
+
Bucket: props.code.s3Bucket,
|
|
127
|
+
Prefix: props.code.s3Prefix,
|
|
128
|
+
...(props.code.s3VersionId !== undefined ? { VersionId: props.code.s3VersionId } : {}),
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
EntryPoint: props.code.entryPoint,
|
|
132
|
+
Runtime: props.code.runtime,
|
|
133
|
+
}),
|
|
134
|
+
})
|
|
135
|
+
: new Runtime_AgentRuntimeArtifact({
|
|
136
|
+
ContainerConfiguration: new Runtime_ContainerConfiguration({
|
|
137
|
+
ContainerUri: props.containerUri,
|
|
138
|
+
}),
|
|
139
|
+
});
|
|
140
|
+
const runtime = new Runtime(mergeDefaults({
|
|
141
|
+
AgentRuntimeName: runtimeName,
|
|
142
|
+
AgentRuntimeArtifact: artifact,
|
|
143
|
+
RoleArn: role.Arn,
|
|
144
|
+
NetworkConfiguration: networkConfiguration,
|
|
145
|
+
ProtocolConfiguration: props.protocolConfiguration ?? "MCP",
|
|
146
|
+
EnvironmentVariables: props.environmentVariables,
|
|
147
|
+
}, defaults?.runtime));
|
|
148
|
+
// Explicit endpoints only for a non-DEFAULT alias (#978): AgentCore owns
|
|
149
|
+
// DEFAULT, and creating it here races the Runtime's async version-READY.
|
|
150
|
+
if (props.endpointName === "DEFAULT") {
|
|
151
|
+
throw new Error("AgentCoreAgent endpointName must not be \"DEFAULT\": AgentCore provisions the managed DEFAULT endpoint itself");
|
|
152
|
+
}
|
|
153
|
+
const endpoint = props.endpointName !== undefined
|
|
154
|
+
? new RuntimeEndpoint(mergeDefaults({
|
|
155
|
+
AgentRuntimeId: runtime.AgentRuntimeId,
|
|
156
|
+
Name: toRuntimeIdentifier(props.endpointName),
|
|
157
|
+
}, defaults?.endpoint))
|
|
158
|
+
: undefined;
|
|
159
|
+
const memory = new Memory(mergeDefaults({
|
|
160
|
+
Name: `${runtimeName}Memory`.slice(0, 48),
|
|
161
|
+
EventExpiryDuration: memoryEventExpiryDays,
|
|
162
|
+
MemoryExecutionRoleArn: role.Arn,
|
|
163
|
+
}, defaults?.memory));
|
|
164
|
+
const workloadIdentity = new WorkloadIdentity(mergeDefaults({
|
|
165
|
+
Name: `${props.name}-identity`,
|
|
166
|
+
AllowedResourceOauth2ReturnUrls: props.allowedResourceOauth2ReturnUrls,
|
|
167
|
+
}, defaults?.workloadIdentity));
|
|
168
|
+
const gateway = new BedrockAgentCoreGateway(mergeDefaults({
|
|
169
|
+
Name: `${props.name}-gateway`,
|
|
170
|
+
AuthorizerType: props.gatewayAuthorizerType ?? "AWS_IAM",
|
|
171
|
+
RoleArn: gatewayRole.Arn,
|
|
172
|
+
}, defaults?.gateway));
|
|
173
|
+
// Default target: route the gateway's MCP tools straight back to this
|
|
174
|
+
// agent's own Runtime endpoint (the shape Gateway's HTTP/AgentcoreRuntime
|
|
175
|
+
// target configuration exists for). Override `defaults.gatewayTarget` to
|
|
176
|
+
// point at a Lambda/OpenAPI/other target instead.
|
|
177
|
+
const gatewayTarget = new GatewayTarget(mergeDefaults({
|
|
178
|
+
GatewayIdentifier: gateway.GatewayIdentifier,
|
|
179
|
+
Name: `${props.name}-target`,
|
|
180
|
+
TargetConfiguration: {
|
|
181
|
+
Http: {
|
|
182
|
+
AgentcoreRuntime: { Arn: runtime.AgentRuntimeArn },
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
}, defaults?.gatewayTarget));
|
|
186
|
+
return { role, gatewayRole, runtime, ...(endpoint ? { endpoint } : {}), memory, workloadIdentity, gateway, gatewayTarget };
|
|
187
|
+
}, "AgentCoreAgent");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The service principal Bedrock AgentCore assumes to run a Runtime and to
|
|
2
|
+
// invoke Gateway targets. Same shape as ecs-trust-policy.ts/lambdaTrustPolicy
|
|
3
|
+
// in lambda-function.ts, one principal shared by both AgentCore-hosted roles.
|
|
4
|
+
export const agentCoreTrustPolicy = {
|
|
5
|
+
Version: "2012-10-17",
|
|
6
|
+
Statement: [
|
|
7
|
+
{
|
|
8
|
+
Effect: "Allow",
|
|
9
|
+
Principal: { Service: "bedrock-agentcore.amazonaws.com" },
|
|
10
|
+
Action: "sts:AssumeRole",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
2
|
+
import { EcsCluster, LoadBalancer, Listener, Listener_Action, Listener_FixedResponseConfig, Listener_Certificate, SecurityGroup, SecurityGroup_Ingress, Role, Role_Policy, } from "../generated/index.js";
|
|
3
|
+
import { ECRActions } from "../actions/ecr.js";
|
|
4
|
+
import { LogsActions } from "../actions/logs.js";
|
|
5
|
+
import { ecsTrustPolicy } from "./ecs-trust-policy.js";
|
|
6
|
+
/** A shared ECS cluster and internet-facing Application Load Balancer with its listener and execution role, for FargateService instances to attach to. */
|
|
7
|
+
export const AlbShared = Composite((props) => {
|
|
8
|
+
const listenerPort = props.listenerPort ?? 80;
|
|
9
|
+
const protocol = props.protocol ?? "HTTP";
|
|
10
|
+
const { defaults: defs } = props;
|
|
11
|
+
// ECS Cluster
|
|
12
|
+
const cluster = new EcsCluster(mergeDefaults({}, defs?.cluster));
|
|
13
|
+
// Execution role — ECR pull + CloudWatch Logs write
|
|
14
|
+
const executionPolicyDocument = {
|
|
15
|
+
Version: "2012-10-17",
|
|
16
|
+
Statement: [
|
|
17
|
+
{
|
|
18
|
+
Effect: "Allow",
|
|
19
|
+
Action: ECRActions.Pull,
|
|
20
|
+
Resource: "*",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
Effect: "Allow",
|
|
24
|
+
Action: LogsActions.Write,
|
|
25
|
+
Resource: "*",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
const executionPolicy = new Role_Policy({
|
|
30
|
+
PolicyName: "ExecutionPolicy",
|
|
31
|
+
PolicyDocument: executionPolicyDocument,
|
|
32
|
+
});
|
|
33
|
+
const executionRole = new Role(mergeDefaults({
|
|
34
|
+
AssumeRolePolicyDocument: ecsTrustPolicy,
|
|
35
|
+
Policies: [executionPolicy],
|
|
36
|
+
}, defs?.executionRole));
|
|
37
|
+
// ALB security group — ingress on listener port from anywhere
|
|
38
|
+
const albIngress = new SecurityGroup_Ingress({
|
|
39
|
+
IpProtocol: "tcp",
|
|
40
|
+
FromPort: listenerPort,
|
|
41
|
+
ToPort: listenerPort,
|
|
42
|
+
CidrIp: "0.0.0.0/0",
|
|
43
|
+
});
|
|
44
|
+
const albSg = new SecurityGroup({
|
|
45
|
+
GroupDescription: "ALB security group",
|
|
46
|
+
VpcId: props.vpcId,
|
|
47
|
+
SecurityGroupIngress: [albIngress],
|
|
48
|
+
});
|
|
49
|
+
// Application Load Balancer
|
|
50
|
+
const alb = new LoadBalancer(mergeDefaults({
|
|
51
|
+
Type: "application",
|
|
52
|
+
Scheme: "internet-facing",
|
|
53
|
+
Subnets: props.publicSubnetIds,
|
|
54
|
+
SecurityGroups: [albSg.GroupId],
|
|
55
|
+
}, defs?.alb));
|
|
56
|
+
// Listener — default action is fixed-response 404
|
|
57
|
+
const fixedResponse = new Listener_FixedResponseConfig({
|
|
58
|
+
StatusCode: "404",
|
|
59
|
+
ContentType: "text/plain",
|
|
60
|
+
MessageBody: "Not Found",
|
|
61
|
+
});
|
|
62
|
+
const defaultAction = new Listener_Action({
|
|
63
|
+
Type: "fixed-response",
|
|
64
|
+
FixedResponseConfig: fixedResponse,
|
|
65
|
+
});
|
|
66
|
+
const listenerProps = {
|
|
67
|
+
LoadBalancerArn: alb.LoadBalancerArn,
|
|
68
|
+
Port: listenerPort,
|
|
69
|
+
Protocol: protocol,
|
|
70
|
+
DefaultActions: [defaultAction],
|
|
71
|
+
// HTTPS listeners carry a cert; a ternary keeps the `new` out of an `if` (EVL002).
|
|
72
|
+
Certificates: protocol === "HTTPS" && props.certificateArn
|
|
73
|
+
? [new Listener_Certificate({ CertificateArn: props.certificateArn })]
|
|
74
|
+
: undefined,
|
|
75
|
+
};
|
|
76
|
+
const listener = new Listener(mergeDefaults(listenerProps, defs?.listener));
|
|
77
|
+
return {
|
|
78
|
+
cluster,
|
|
79
|
+
executionRole,
|
|
80
|
+
albSg,
|
|
81
|
+
alb,
|
|
82
|
+
listener,
|
|
83
|
+
};
|
|
84
|
+
}, "AlbShared");
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BucketDeployment — the seeded-bucket shape: an S3 bucket sized to receive
|
|
3
|
+
* deploy-time content, encrypted and access-blocked by default, its
|
|
4
|
+
* deletion behaviour and (optionally) its public-read policy declared up
|
|
5
|
+
* front rather than left to CloudFormation's own defaults.
|
|
6
|
+
*
|
|
7
|
+
* `s3deploy.BucketDeployment` is the most-used CDK pattern across the
|
|
8
|
+
* aws-bench corpus (37 instantiations across 8 apps, chant#1139) and it
|
|
9
|
+
* names two things CDK bundles together that chant keeps apart on purpose:
|
|
10
|
+
*
|
|
11
|
+
* - The bucket itself: `AWS::S3::Bucket` plus its encryption, access-block
|
|
12
|
+
* and (for the static-site shape) website/public-policy configuration.
|
|
13
|
+
* That is a fixed set of CloudFormation resources, so it is what this
|
|
14
|
+
* composite declares — the same shape `LambdaS3` (../composites) already
|
|
15
|
+
* gives a bucket, minus the Lambda trigger wiring.
|
|
16
|
+
* - Uploading local files into it at deploy time. CDK does this with a
|
|
17
|
+
* Lambda-backed custom resource (`cr.AwsCustomResource`, the same family
|
|
18
|
+
* the epic notes maps to chant Ops rather than composites — chant has no
|
|
19
|
+
* CloudFormation custom-resource machinery, and inventing one just to
|
|
20
|
+
* reproduce a `PutObject` loop would be new plumbing for a solved
|
|
21
|
+
* problem). chant already ships this as a deploy-time **capability**,
|
|
22
|
+
* `s3-sync` (`../components/apply.ts`'s `createS3SyncCapability`, backed
|
|
23
|
+
* by the real `aws s3 sync`/`aws s3 cp` CLI through `CloudExecutor`, with
|
|
24
|
+
* the typed step-builder `s3Sync` in `../components/builders.ts`) — it
|
|
25
|
+
* was defined for exactly this and, before this composite, had no
|
|
26
|
+
* composite pairing it with a bucket to sync into. A component composes
|
|
27
|
+
* the two:
|
|
28
|
+
*
|
|
29
|
+
* const seeded = BucketDeployment({ bucketName: Sub`${AWS.StackName}-site` });
|
|
30
|
+
* // ...component `deploy` phase:
|
|
31
|
+
* s3Sync({ from: "archive:site-build", to: Sub`s3://${seeded.bucket.Ref}` })
|
|
32
|
+
*
|
|
33
|
+
* That split — graph-time declaration here, deploy-time action in the
|
|
34
|
+
* component layer — is the existing precedent (`s3-sync` shipped in #566
|
|
35
|
+
* unused by any composite until this one), not a new one invented for this
|
|
36
|
+
* composite.
|
|
37
|
+
*
|
|
38
|
+
* "Cleanup" (the epic's third word) is `removalPolicy`, CloudFormation's own
|
|
39
|
+
* `DeletionPolicy` on the bucket resource. CDK's `autoDeleteObjects` — the
|
|
40
|
+
* Lambda-backed hook that empties a bucket before CloudFormation is allowed
|
|
41
|
+
* to delete it — has the same custom-resource shape as content upload and
|
|
42
|
+
* the same answer: out of scope here, and worth an `s3 rm --recursive`
|
|
43
|
+
* step ahead of a stack teardown in the component that owns the deploy.
|
|
44
|
+
*/
|
|
45
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
46
|
+
import { Bucket, Bucket_BucketEncryption, Bucket_ServerSideEncryptionRule, Bucket_ServerSideEncryptionByDefault, Bucket_PublicAccessBlockConfiguration, Bucket_VersioningConfiguration, Bucket_WebsiteConfiguration, S3BucketPolicy, } from "../generated/index.js";
|
|
47
|
+
import { Sub } from "../intrinsics.js";
|
|
48
|
+
export const BucketDeployment = Composite((props) => {
|
|
49
|
+
const { defaults } = props;
|
|
50
|
+
const publicRead = props.website !== undefined;
|
|
51
|
+
const encryptionDefault = new Bucket_ServerSideEncryptionByDefault({ SSEAlgorithm: "AES256" });
|
|
52
|
+
const encryptionRule = new Bucket_ServerSideEncryptionRule({ ServerSideEncryptionByDefault: encryptionDefault });
|
|
53
|
+
const bucketEncryption = new Bucket_BucketEncryption({ ServerSideEncryptionConfiguration: [encryptionRule] });
|
|
54
|
+
// A ternary, not an `if`, so the block-scoped `new` stays an expression
|
|
55
|
+
// (EVL002) — the same reasoning eks-cluster.ts's addon slots document.
|
|
56
|
+
const publicAccessBlock = new Bucket_PublicAccessBlockConfiguration(publicRead
|
|
57
|
+
? { BlockPublicAcls: false, BlockPublicPolicy: false, IgnorePublicAcls: false, RestrictPublicBuckets: false }
|
|
58
|
+
: { BlockPublicAcls: true, BlockPublicPolicy: true, IgnorePublicAcls: true, RestrictPublicBuckets: true });
|
|
59
|
+
const versioningConfiguration = props.versioned
|
|
60
|
+
? new Bucket_VersioningConfiguration({ Status: "Enabled" })
|
|
61
|
+
: undefined;
|
|
62
|
+
const websiteConfiguration = props.website
|
|
63
|
+
? new Bucket_WebsiteConfiguration({
|
|
64
|
+
IndexDocument: props.website.indexDocument,
|
|
65
|
+
...(props.website.errorDocument ? { ErrorDocument: props.website.errorDocument } : {}),
|
|
66
|
+
})
|
|
67
|
+
: undefined;
|
|
68
|
+
const bucket = new Bucket(mergeDefaults({
|
|
69
|
+
BucketName: props.bucketName,
|
|
70
|
+
BucketEncryption: bucketEncryption,
|
|
71
|
+
PublicAccessBlockConfiguration: publicAccessBlock,
|
|
72
|
+
...(versioningConfiguration ? { VersioningConfiguration: versioningConfiguration } : {}),
|
|
73
|
+
...(websiteConfiguration ? { WebsiteConfiguration: websiteConfiguration } : {}),
|
|
74
|
+
Tags: props.tags,
|
|
75
|
+
}, defaults?.bucket), { DeletionPolicy: props.removalPolicy === "destroy" ? "Delete" : "Retain" });
|
|
76
|
+
const bucketPolicy = publicRead
|
|
77
|
+
? new S3BucketPolicy(mergeDefaults({
|
|
78
|
+
Bucket: bucket.Ref,
|
|
79
|
+
PolicyDocument: {
|
|
80
|
+
Version: "2012-10-17",
|
|
81
|
+
Statement: [
|
|
82
|
+
{ Effect: "Allow", Principal: "*", Action: "s3:GetObject", Resource: Sub `${bucket.Arn}/*` },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
}, defaults?.bucketPolicy))
|
|
86
|
+
: undefined;
|
|
87
|
+
// Spread rather than a ternary between two object shapes (EksCluster's
|
|
88
|
+
// addon slots, ../eks-cluster.ts, hit the same union-return typing wall):
|
|
89
|
+
// a key that is sometimes present, never a key whose value is sometimes
|
|
90
|
+
// `undefined` — `CompositeMembers`' index signature requires `Declarable`,
|
|
91
|
+
// not `Declarable | undefined`.
|
|
92
|
+
return { bucket, ...(bucketPolicy ? { bucketPolicy } : {}) };
|
|
93
|
+
}, "BucketDeployment");
|