### Full Example: Lambda Token Authorizer Setup Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/apigateway/package-summary.html A complete example demonstrating the setup of a REST API with a default token authorizer. This includes defining the Lambda function, the authorizer, and the API Gateway itself with default options. ```java public class MyStack extends Stack { public MyStack(Construct scope, String id) { super(scope, id); Function authorizerFn = Function.Builder.create(this, "MyAuthorizerFunction") .runtime(Runtime.NODEJS_LATEST) .handler("index.handler") .code(AssetCode.fromAsset(join(__dirname, "integ.token-authorizer.handler"))) .build(); TokenAuthorizer authorizer = TokenAuthorizer.Builder.create(this, "MyAuthorizer") .handler(authorizerFn) .build(); RestApi restapi = RestApi.Builder.create(this, "MyRestApi") .cloudWatchRole(true) .defaultMethodOptions(MethodOptions.builder() .authorizer(authorizer) .build()) .defaultCorsPreflightOptions(CorsOptions.builder() .allowOrigins(Cors.ALL_ORIGINS) .build()) .build(); restapi.root.addMethod("ANY", MockIntegration.Builder.create() .integrationResponses(List.of(IntegrationResponse.builder().statusCode("200").build())) .passthroughBehavior(PassthroughBehavior.NEVER) .requestTemplates(Map.of( "application/json", "{ \"statusCode\": 200 }")) .build(), MethodOptions.builder() .methodResponses(List.of(MethodResponse.builder().statusCode("200").build())) .build()); } } ``` -------------------------------- ### Full Example: Lambda Request Authorizer Setup Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/apigateway/package-summary.html A comprehensive example demonstrating the setup of a RestApi with Lambda authorizers. It includes defining the Lambda function, creating the RestApi, and configuring two distinct request authorizers with different identity sources. The example also shows how to attach these authorizers to different methods and resources. ```java import path.*; import software.amazon.awscdk.services.lambda.*; import software.amazon.awscdk.App; import software.amazon.awscdk.Stack; import software.amazon.awscdk.services.apigateway.MockIntegration; import software.amazon.awscdk.services.apigateway.PassthroughBehavior; import software.amazon.awscdk.services.apigateway.RestApi; import software.amazon.awscdk.services.apigateway.RequestAuthorizer; import software.amazon.awscdk.services.apigateway.IdentitySource; // Against the RestApi endpoint from the stack output, run // `curl -s -o /dev/null -w "%{http_code}" ` should return 401 // `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: deny' ?allow=yes` should return 403 // `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: allow' ?allow=yes` should return 200 App app = new App(); Stack stack = new Stack(app, "RequestAuthorizerInteg"); Function authorizerFn = Function.Builder.create(stack, "MyAuthorizerFunction") .runtime(Runtime.NODEJS_LATEST) .handler("index.handler") .code(AssetCode.fromAsset(join(__dirname, "integ.request-authorizer.handler"))) .build(); RestApi restapi = RestApi.Builder.create(stack, "MyRestApi").cloudWatchRole(true).build(); RequestAuthorizer authorizer = RequestAuthorizer.Builder.create(stack, "MyAuthorizer") .handler(authorizerFn) .identitySources(List.of(IdentitySource.header("Authorization"), IdentitySource.queryString("allow"))) .build(); RequestAuthorizer secondAuthorizer = RequestAuthorizer.Builder.create(stack, "MySecondAuthorizer") .handler(authorizerFn) .identitySources(List.of(IdentitySource.header("Authorization"), IdentitySource.queryString("allow"))) .build(); restapi.root.addMethod("ANY", MockIntegration.Builder.create() .integrationResponses(List.of(IntegrationResponse.builder().statusCode("200").build())) .passthroughBehavior(PassthroughBehavior.NEVER) .requestTemplates(Map.of( "application/json", "{ \"statusCode\": 200 }")) .build(), MethodOptions.builder() .methodResponses(List.of(MethodResponse.builder().statusCode("200").build())) .authorizer(authorizer) .build()); restapi.root.resourceForPath("auth").addMethod("ANY", MockIntegration.Builder.create() .integrationResponses(List.of(IntegrationResponse.builder().statusCode("200").build())) .passthroughBehavior(PassthroughBehavior.NEVER) .requestTemplates(Map.of( "application/json", "{ \"statusCode\": 200 }")) .build(), MethodOptions.builder() .methodResponses(List.of(MethodResponse.builder().statusCode("200").build())) .authorizer(secondAuthorizer) .build()); ``` -------------------------------- ### Example GET Request to StepFunctionsRestApi with Path and Query String Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/apigateway/package-summary.html This example shows a curl command for making a GET request to a StepFunctionsRestApi endpoint with a specific path and query parameters. ```bash curl -X GET https://example.com/users/5?foo=bar ``` -------------------------------- ### Basic Commands Action Setup Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/codepipeline/actions/package-summary.html This snippet demonstrates the basic setup of a Commands action, including a source action and pipeline creation. It shows how to define commands to be executed. ```java // Source action Bucket bucket = Bucket.Builder.create(this, "SourceBucket") .versioned(true) .build(); Artifact sourceArtifact = new Artifact("SourceArtifact"); S3SourceAction sourceAction = S3SourceAction.Builder.create() .actionName("Source") .output(sourceArtifact) .bucket(bucket) .bucketKey("my.zip") .build(); // Commands action Artifact outputArtifact = new Artifact("OutputArtifact"); CommandsAction commandsAction = CommandsAction.Builder.create() .actionName("Commands") .commands(List.of("echo \"some commands\"")) .input(sourceArtifact) .output(outputArtifact) .build(); Pipeline pipeline = Pipeline.Builder.create(this, "Pipeline") .stages(List.of(StageProps.builder() .stageName("Source") .actions(List.of(sourceAction)) .build(), StageProps.builder() .stageName("Commands") .actions(List.of(commandsAction)) .build())) .build(); ``` -------------------------------- ### Get Week Start Day Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/quicksight/CfnDashboardPropsMixin.AssetOptionsProperty.Jsii%24Proxy.html Retrieves the configured start day of the week for an analysis. ```java final String getWeekStart() ``` -------------------------------- ### Example Docker Build Options Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/DockerBuildOptions.html Demonstrates how to configure Docker build options, including build arguments and specifying a Dockerfile. ```java Function.Builder.create(this, "Function") .code(Code.fromAsset("/path/to/handler", AssetOptions.builder() .bundling(BundlingOptions.builder() .image(DockerImage.fromBuild("/path/to/dir/with/DockerFile", DockerBuildOptions.builder() .buildArgs(Map.of( "ARG1", "value1")) .build())) .command(List.of("my", "cool", "command")) .build()) .build())) .runtime(Runtime.PYTHON_3_9) .handler("index.handler") .build(); ``` -------------------------------- ### Get Start Date Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/quicksight/CfnAnalysisPropsMixin.WhatIfRangeScenarioProperty.Jsii%24Proxy.html Retrieves the start date for the forecast results date range. ```java final String getStartDate() The start date in the date range that you need the forecast results for. ``` -------------------------------- ### Instantiate FileSystem Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/FileSystem.html Example of how to instantiate the FileSystem class. Replace placeholder values with your actual configuration. ```java import software.amazon.awscdk.*; FileSystem fileSystem = new FileSystem(); ``` -------------------------------- ### Get Start Time Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/customerprofiles/CfnSegmentDefinitionPropsMixin.RangeOverrideProperty.Jsii%24Proxy.html Retrieves the start time for when to include objects in the range override. ```java final Number getStart() The start time of when to include objects. ``` -------------------------------- ### Project Step Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/quicksight/CfnDataSetPropsMixin.TransformStepProperty.html Demonstrates how to configure a project step for data transformation, specifying columns to project and source mappings. ```java .projectStep(ProjectOperationProperty.builder() .alias("alias") .projectedColumns(List.of("projectedColumns")) .source(TransformOperationSourceProperty.builder() .columnIdMappings(List.of(DataSetColumnIdMappingProperty.builder() .sourceColumnId("sourceColumnId") .targetColumnId("targetColumnId") .build())) .transformOperationId("transformOperationId") .build()) .build()) ``` -------------------------------- ### CDC Start Position Examples Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/dms/CfnReplicationTaskMixinProps.html Specifies when a change data capture (CDC) operation should start. Use either CdcStartPosition or CdcStartTime. Examples include date, checkpoint, LSN, and SCN formats. ```bash --cdc-start-position "2018-03-08T12:12:12" ``` ```bash --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" ``` ```bash --cdc-start-position "mysql-bin-changelog.000024:373" ``` -------------------------------- ### Get Start of Range Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/appmesh/CfnRoute.MatchRangeProperty.Jsii%24Proxy.html Retrieves the start value of the range. This method is part of the CfnRoute.MatchRangeProperty interface. ```java final Number getStart() ``` -------------------------------- ### CfnApplicationSettingsPropsMixin Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/pinpoint/CfnApplicationSettingsPropsMixin.html Demonstrates how to instantiate CfnApplicationSettingsPropsMixin with various properties. ```APIDOC ## CfnApplicationSettingsPropsMixin Example ### Description This example shows how to create an instance of `CfnApplicationSettingsPropsMixin` by providing a `CfnApplicationSettingsMixinProps` object, which includes nested properties for `campaignHook`, `limits`, and `quietTime`. ### Method ```java CfnApplicationSettingsPropsMixin.Builder.create(...).strategy(...).build() ``` ### Parameters #### Request Body - **props** (`CfnApplicationSettingsMixinProps`) - Required - The properties for the application settings. - **applicationId** (`String`) - Required - The ID of the application. - **campaignHook** (`CampaignHookProperty`) - Optional - Settings for campaign hooks. - **lambdaFunctionName** (`String`) - Required - The Lambda function name. - **mode** (`String`) - Optional - The mode for the campaign hook. - **webUrl** (`String`) - Optional - The web URL for the campaign hook. - **cloudWatchMetricsEnabled** (`Boolean`) - Optional - Whether CloudWatch metrics are enabled. - **limits** (`LimitsProperty`) - Optional - The sending limits for campaigns. - **daily** (`Integer`) - Optional - The daily limit. - **maximumDuration** (`Integer`) - Optional - The maximum duration in seconds. - **messagesPerSecond** (`Integer`) - Optional - The messages per second limit. - **total** (`Integer`) - Optional - The total limit. - **quietTime** (`QuietTimeProperty`) - Optional - The quiet time settings. - **end** (`String`) - Required - The end time of the quiet period. - **start** (`String`) - Required - The start time of the quiet period. - **strategy** (`IMergeStrategy`) - Optional - The merge strategy to use. ``` -------------------------------- ### Create a Hosted Configuration Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/appconfig/HostedConfigurationProps.html Example of how to create a hosted configuration with inline text content and validators. Ensure 'application' and 'fn' are defined elsewhere. ```java Application application; Function fn; HostedConfiguration.Builder.create(this, "MyHostedConfiguration") .application(application) .content(ConfigurationContent.fromInlineText("This is my configuration content.")) .validators(List.of(JsonSchemaValidator.fromFile("schema.json"), LambdaValidator.fromFunction(fn))) .build(); ``` -------------------------------- ### HttpIntegration Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/apigateway/HttpIntegration.html Example of creating an HttpIntegration for a GET method on a resource, including setting up an authorizer. ```APIDOC ## HttpIntegration Example This example demonstrates how to create an `HttpIntegration` for a GET method on a resource. It also shows how to configure a `RequestAuthorizer` and associate it with the method. ### Method Signature `HttpIntegration(String url, HttpIntegrationProps props)` ### Parameters * **url** (string) - The HTTP endpoint URI. * **props** (`HttpIntegrationProps`) - Properties for configuring the HTTP integration. ### Example Usage ```java Function authFn; Resource books; RequestAuthorizer auth = RequestAuthorizer.Builder.create(this, "booksAuthorizer") .handler(authFn) .identitySources(List.of(IdentitySource.header("Authorization"))) .build(); books.addMethod("GET", new HttpIntegration("http://amazon.com"), MethodOptions.builder() .authorizer(auth) .build()); ``` ``` -------------------------------- ### Instantiating DeployOptions in Java Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cloud_assembly_schema/DeployOptions.html This example demonstrates how to create an instance of the DeployOptions interface using its builder pattern in Java. It shows how to set various deployment-specific configurations. ```java import software.amazon.awscdk.cloud_assembly_schema.*; // The code below shows an example of how to instantiate this type. // The values are placeholders you should change. DeployOptions deployOptions = DeployOptions.builder() .all(false) .app("app") .assetMetadata(false) .caBundlePath("caBundlePath") .changeSetName("changeSetName") .ci(false) .color(false) .concurrency(123) .context(Map.of( "contextKey", "context")) .debug(false) .ec2Creds(false) .exclusively(false) .execute(false) .force(false) .ignoreErrors(false) .json(false) .lookups(false) .notices(false) .notificationArns(List.of("notificationArns")) .output("output") .outputsFile("outputsFile") .parameters(Map.of( "parametersKey", "parameters")) .pathMetadata(false) .profile("profile") .proxy("proxy") .requireApproval(RequireApproval.NEVER) .reuseAssets(List.of("reuseAssets")) .roleArn("roleArn") .rollback(false) .stacks(List.of("stacks")) .staging(false) .strict(false) .toolkitStackName("toolkitStackName") .trace(false) .usePreviousParameters(false) .verbose(false) .versionReporting(false) .build(); ``` -------------------------------- ### Get Fixed Availability Start Time Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/mediapackagev2/CfnOriginEndpointPropsMixin.DashAvailabilityStartTimeConfigurationProperty.Jsii%24Proxy.html Retrieves the fixed availability start time configuration. ```java final String getFixedAvailabilityStartTime() ``` -------------------------------- ### Tool Configuration Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/wisdom/CfnAIAgentPropsMixin.html Demonstrates how to configure a tool with annotations, description, input schema, instruction examples, output filters, output schema, override input values, title, tool ID, tool name, tool type, and user interaction configuration. ```java .toolConfigurations(List.of(ToolConfigurationProperty.builder() .annotations(annotations) .description("description") .inputSchema(inputSchema) .instruction(ToolInstructionProperty.builder() .examples(List.of("examples")) .instruction("instruction") .build()) .outputFilters(List.of(ToolOutputFilterProperty.builder() .jsonPath("jsonPath") .outputConfiguration(ToolOutputConfigurationProperty.builder() .outputVariableNameOverride("outputVariableNameOverride") .sessionDataNamespace("sessionDataNamespace") .build()) .build())) .outputSchema(outputSchema) .overrideInputValues(List.of(ToolOverrideInputValueProperty.builder() .jsonPath("jsonPath") .value(ToolOverrideInputValueConfigurationProperty.builder() .constant(ToolOverrideConstantInputValueProperty.builder() .type("type") .value("value") .build()) .build()) .build())) .title("title") .toolId("toolId") .toolName("toolName") .toolType("toolType") .userInteractionConfiguration(UserInteractionConfigurationProperty.builder() .isUserConfirmationRequired(false) .build()) .build())) .build()) ``` -------------------------------- ### Lambda Integration Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/apigateway/package-summary.html Example of integrating a GET /book/{book_id} method with an AWS Lambda function. ```APIDOC ## GET /book/{book_id} ### Description Integrates the GET /book/{book_id} method with an AWS Lambda function. ### Method GET ### Endpoint /book/{book_id} ### Parameters #### Path Parameters - **book_id** (string) - Required - The ID of the book. ### Request Body None explicitly defined for this example. ### Response #### Success Response (200) - **body** (any) - The response from the Lambda function. ### Request Example ```java Function getBookHandler; Resource book; LambdaIntegration getBookIntegration = new LambdaIntegration(getBookHandler); book.addMethod("GET", getBookIntegration); ``` ### Response Example ```json { "example": "response from Lambda function" } ``` ``` -------------------------------- ### CfnApplicationVersionPropsMixin Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/elasticbeanstalk/CfnApplicationVersionPropsMixin.html Example of how to instantiate CfnApplicationVersionPropsMixin with application name, description, and source bundle details. ```APIDOC ## CfnApplicationVersionPropsMixin Example ### Description This example demonstrates how to create an instance of `CfnApplicationVersionPropsMixin` to configure an AWS Elastic Beanstalk application version. It includes setting the application name, a description, and the source bundle location from an S3 bucket. ### Usage ```java import software.amazon.awscdk.cfnpropertymixins.services.elasticbeanstalk.*; import software.amazon.awscdk.*; // Assuming IMergeStrategy and SourceBundleProperty are defined elsewhere // IMergeStrategy mergeStrategy; // SourceBundleProperty sourceBundle; CfnApplicationVersionPropsMixin cfnApplicationVersionPropsMixin = CfnApplicationVersionPropsMixin.Builder.create(CfnApplicationVersionMixinProps.builder() .applicationName("applicationName") .description("description") .sourceBundle(SourceBundleProperty.builder() .s3Bucket("s3Bucket") .s3Key("s3Key") .build()) .build()) // .strategy(mergeStrategy) // Uncomment and provide if strategy is needed .build(); ``` ### Parameters This example uses the `CfnApplicationVersionPropsMixin.Builder` to construct the mixin. The primary configuration is passed via `CfnApplicationVersionMixinProps`: - **applicationName** (string) - Required - The name of the Elastic Beanstalk application. - **description** (string) - Optional - A description for the application version. - **sourceBundle** (SourceBundleProperty) - Required - Specifies the Amazon S3 location of the source bundle. - **s3Bucket** (string) - Required - The name of the S3 bucket containing the source bundle. - **s3Key** (string) - Required - The key (path) to the source bundle within the S3 bucket. An optional `strategy` parameter can also be applied to the mixin. ``` -------------------------------- ### Get Start Timestamp Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/securityhub/CfnAutomationRulePropsMixin.DateFilterProperty.Jsii%24Proxy.html Retrieves the start timestamp for the date filter. This method is part of the CfnAutomationRulePropsMixin.DateFilterProperty interface. ```java final String getStart() ``` -------------------------------- ### Instantiate RootDirectoryProperty Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/efs/CfnAccessPointPropsMixin.RootDirectoryProperty.html Example of how to instantiate the RootDirectoryProperty with creation information and a path. Ensure to replace placeholder values with your actual configuration. ```java import software.amazon.awscdk.cfnpropertymixins.services.efs.*; RootDirectoryProperty rootDirectoryProperty = RootDirectoryProperty.builder() .creationInfo(CreationInfoProperty.builder() .ownerGid("ownerGid") .ownerUid("ownerUid") .permissions("permissions") .build()) .path("path") .build(); ``` -------------------------------- ### Get Start Time Property Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/opensearchservice/CfnDomainPropsMixin.AutomatedSnapshotPauseOptionsProperty.Jsii%24Proxy.html Retrieves the 'startTime' property, representing the start time for snapshot pausing. ```java final String getStartTime() ``` -------------------------------- ### CfnDataAutomationProjectMixinProps Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/bedrock/CfnDataAutomationProjectMixinProps.html Example of how to construct CfnDataAutomationProjectMixinProps with various configurations including image, video, and tags. ```java software.amazon.awscdk.services.bedrock.CfnDataAutomationProjectMixinProps.builder() .projectName("project-name") .projectDescription("project-description") .projectType("project-type") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .standardOutputConfiguration(StandardOutputConfigurationProperty.builder() .image(ImageStandardOutputConfigurationProperty.builder() .generativeField(ImageStandardGenerativeFieldProperty.builder() .state("state") .types(List.of("types")) .build()) .build()) .video(VideoStandardOutputConfigurationProperty.builder() .extraction(VideoStandardExtractionProperty.builder() .boundingBox(VideoBoundingBoxProperty.builder() .state("state") .build()) .category(VideoExtractionCategoryProperty.builder() .state("state") .types(List.of("types")) .build()) .build()) .generativeField(VideoStandardGenerativeFieldProperty.builder() .state("state") .types(List.of("types")) .build()) .build()) .build()) .build(); ``` -------------------------------- ### CfnVirtualServicePropsMixin Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/appmesh/CfnVirtualServicePropsMixin.html Example of how to instantiate CfnVirtualServicePropsMixin with its properties. ```APIDOC ## CfnVirtualServicePropsMixin ### Description Creates a virtual service within a service mesh. A virtual service is an abstraction of a real service that is provided by a virtual node directly or indirectly by means of a virtual router. ### Example ```java import software.amazon.awscdk.cfnpropertymixins.services.appmesh.*; import software.amazon.awscdk.*; IMergeStrategy mergeStrategy; CfnVirtualServicePropsMixin cfnVirtualServicePropsMixin = CfnVirtualServicePropsMixin.Builder.create(CfnVirtualServiceMixinProps.builder() .meshName("meshName") .meshOwner("meshOwner") .spec(VirtualServiceSpecProperty.builder() .provider(VirtualServiceProviderProperty.builder() .virtualNode(VirtualNodeServiceProviderProperty.builder() .virtualNodeName("virtualNodeName") .build()) .virtualRouter(VirtualRouterServiceProviderProperty.builder() .virtualRouterName("virtualRouterName") .build()) .build()) .build()) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .virtualServiceName("virtualServiceName") .build()) .strategy(mergeStrategy) .build(); ``` ### Methods #### applyTo Apply the mixin properties to the construct. #### getProps Returns the properties of the mixin. #### getStrategy Returns the merge strategy of the mixin. #### supports Check if this mixin supports the given construct. ``` -------------------------------- ### Get Start Time Method Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/inspectorv2/CfnCisScanConfigurationPropsMixin.DailyScheduleProperty.Jsii%24Proxy.html Retrieves the schedule start time. This method is part of the CfnCisScanConfigurationPropsMixin.DailyScheduleProperty interface. ```java final Object getStartTime() The schedule start time. ``` -------------------------------- ### Instantiate FileSystemGIDProperty Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/fsx/CfnS3AccessPointAttachmentPropsMixin.FileSystemGIDProperty.html Example of how to instantiate the FileSystemGIDProperty using its builder. Replace placeholder values with your actual GID. ```java import software.amazon.awscdk.cfnpropertymixins.services.fsx.*; // The code below shows an example of how to instantiate this type. // The values are placeholders you should change. FileSystemGIDProperty fileSystemGIDProperty = FileSystemGIDProperty.builder() .gid(123) .build(); ``` -------------------------------- ### Get Start Time Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/iot/CfnJobTemplatePropsMixin.MaintenanceWindowProperty.Jsii%24Proxy.html Retrieves the start time of the next maintenance window. This method is part of the MaintenanceWindowProperty interface. ```java final String getStartTime() Displays the start time of the next maintenance window. ``` -------------------------------- ### Create and Deploy AppConfig Environment Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/appconfig/EnvironmentProps.html Example demonstrating how to create an Application and an Environment, then deploy HostedConfigurations to that environment using AWS CDK in Java. ```java Application app = new Application(this, "MyApp"); Environment env = Environment.Builder.create(this, "MyEnv") .application(app) .build(); HostedConfiguration.Builder.create(this, "MyFirstHostedConfig") .application(app) .deployTo(List.of(env)) .content(ConfigurationContent.fromInlineText("This is my first configuration content.")) .build(); HostedConfiguration.Builder.create(this, "MySecondHostedConfig") .application(app) .deployTo(List.of(env)) .content(ConfigurationContent.fromInlineText("This is my second configuration content.")) .build(); ``` -------------------------------- ### HttpStepFunctionsIntegration Examples Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/aws_apigatewayv2_integrations/HttpStepFunctionsIntegration.html Demonstrates how to create HttpStepFunctionsIntegration instances for different Step Functions operations (start execution, start sync execution, stop execution) and add them to an HTTP API. Includes examples of using ParameterMapping for specific subtypes. ```java import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpStepFunctionsIntegration; import software.amazon.awscdk.services.stepfunctions.*; StateMachine stateMachine; HttpApi httpApi; httpApi.addRoutes(AddRoutesOptions.builder() .path("/start") .methods(List.of(HttpMethod.POST)) .integration(HttpStepFunctionsIntegration.Builder.create("StartExecutionIntegration") .stateMachine(stateMachine) .subtype(HttpIntegrationSubtype.STEPFUNCTIONS_START_EXECUTION) .build()) .build()); httpApi.addRoutes(AddRoutesOptions.builder() .path("/start-sync") .methods(List.of(HttpMethod.POST)) .integration(HttpStepFunctionsIntegration.Builder.create("StartSyncExecutionIntegration") .stateMachine(stateMachine) .subtype(HttpIntegrationSubtype.STEPFUNCTIONS_START_SYNC_EXECUTION) .build()) .build()); httpApi.addRoutes(AddRoutesOptions.builder() .path("/stop") .methods(List.of(HttpMethod.POST)) .integration(HttpStepFunctionsIntegration.Builder.create("StopExecutionIntegration") .stateMachine(stateMachine) .subtype(HttpIntegrationSubtype.STEPFUNCTIONS_STOP_EXECUTION) // For the `STOP_EXECUTION` subtype, it is necessary to specify the `executionArn`. .parameterMapping(new ParameterMapping().custom("ExecutionArn", "$request.querystring.executionArn")) .build()) .build()); ``` -------------------------------- ### Create a Fargate Compute Environment with Job Queues Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/batch/FargateComputeEnvironment.html Demonstrates how to create a Fargate compute environment with spot instances enabled and associate it with multiple job queues of different priorities. Requires an existing VPC. ```java IVpc vpc; FargateComputeEnvironment sharedComputeEnv = FargateComputeEnvironment.Builder.create(this, "spotEnv") .vpc(vpc) .spot(true) .build(); JobQueue lowPriorityQueue = JobQueue.Builder.create(this, "JobQueue") .priority(1) .build(); JobQueue highPriorityQueue = JobQueue.Builder.create(this, "JobQueue") .priority(10) .build(); lowPriorityQueue.addComputeEnvironment(sharedComputeEnv, 1); highPriorityQueue.addComputeEnvironment(sharedComputeEnv, 1); ``` -------------------------------- ### Get Start Timestamp Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/securityhub/CfnInsightPropsMixin.DateFilterProperty.Jsii%24Proxy.html Retrieves the start timestamp for the date filter. Used to specify the lower bound of a time period. ```java final String getStart() A timestamp that provides the start date for the date filter. ``` -------------------------------- ### Get Start Time Property Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/redshift/CfnScheduledActionMixinProps.Jsii%24Proxy.html Retrieves the start time in UTC for the schedule. This specifies when the scheduled action becomes active. ```java final java.lang.String getStartTime() The start time in UTC when the schedule is active. ``` -------------------------------- ### CfnTargetDomainPropsMixin Instantiation Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/securityagent/CfnTargetDomainPropsMixin.html Example demonstrating how to instantiate CfnTargetDomainPropsMixin using its builder, including setting tags, target domain name, and verification method. ```APIDOC ## CfnTargetDomainPropsMixin Instantiation This example shows how to create an instance of `CfnTargetDomainPropsMixin` using the builder pattern. It includes common properties like tags, the target domain name, and the verification method. ### Class `software.amazon.awscdk.cfnpropertymixins.services.securityagent.CfnTargetDomainPropsMixin` ### Example Usage ```java import software.amazon.awscdk.cfnpropertymixins.services.securityagent.*; import software.amazon.awscdk.*; // Assuming IMergeStrategy and CfnTag are imported and available IMergeStrategy mergeStrategy; CfnTargetDomainPropsMixin cfnTargetDomainPropsMixin = CfnTargetDomainPropsMixin.Builder.create(CfnTargetDomainMixinProps.builder() .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .targetDomainName("targetDomainName") .verificationMethod("verificationMethod") .build()) .strategy(mergeStrategy) .build(); ``` ### Properties - **`strategy`** (`IMergeStrategy`): The merge strategy to apply. - **`targetDomainName`** (`String`): The name of the target domain to register. - **`verificationMethod`** (`String`): The method used to verify the target domain. - **`tags`** (`List`): A list of tags to associate with the target domain. ### See Also - [AWS CloudFormation Resource Specification for AWS::SecurityAgent::TargetDomain](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-securityagent-targetdomain.html) ``` -------------------------------- ### CfnSimulationApplicationVersionPropsMixin Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/robomaker/CfnSimulationApplicationVersionPropsMixin.html Example of how to instantiate CfnSimulationApplicationVersionPropsMixin with its builder. ```APIDOC ## CfnSimulationApplicationVersionPropsMixin A fluent builder for `CfnSimulationApplicationVersionPropsMixin`. ### Description This class provides mixin properties for the AWS::RoboMaker::SimulationApplicationVersion resource. It allows users to specify properties when creating a new version of a RoboMaker simulation application. ### Example ```java import software.amazon.awscdk.cfnpropertymixins.services.robomaker.*; import software.amazon.awscdk.*; IMergeStrategy mergeStrategy; CfnSimulationApplicationVersionPropsMixin cfnSimulationApplicationVersionPropsMixin = CfnSimulationApplicationVersionPropsMixin.Builder.create(CfnSimulationApplicationVersionMixinProps.builder() .application("application") .currentRevisionId("currentRevisionId") .build()) .strategy(mergeStrategy) .build(); ``` ### Properties * **application** (string) - Required - The name of the simulation application. * **currentRevisionId** (string) - Required - The current revision ID of the simulation application. * **strategy** (IMergeStrategy) - Optional - The merge strategy to use when creating the simulation application version. ### See Also * [AWS CloudFormation User Guide - AWS::RoboMaker::SimulationApplicationVersion](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-robomaker-simulationapplicationversion.html) ``` -------------------------------- ### Get Week Start Day Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/quicksight/CfnTemplatePropsMixin.AssetOptionsProperty.Jsii%24Proxy.html Retrieves the day of the week on which the analysis week starts. This method is part of the CfnTemplatePropsMixin.AssetOptionsProperty interface. ```java final String getWeekStart() Determines the week start day for an analysis. ``` -------------------------------- ### Get Replication Starting Position Type Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/msk/CfnReplicatorPropsMixin.ReplicationStartingPositionProperty.Jsii%24Proxy.html Retrieves the type of the replication starting position. This method is part of the ReplicationStartingPositionProperty interface. ```java final String getType() The type of replication starting position. ``` -------------------------------- ### Create and Configure a Load Balancer Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/elasticloadbalancing/LoadBalancer.html This example demonstrates how to create a LoadBalancer, add a listener, and register a service as a target. It requires a Cluster, TaskDefinition, and Vpc to be defined. ```java Cluster cluster; TaskDefinition taskDefinition; Vpc vpc; Ec2Service service = Ec2Service.Builder.create(this, "Service").cluster(cluster).taskDefinition(taskDefinition).minHealthyPercent(100).build(); LoadBalancer lb = LoadBalancer.Builder.create(this, "LB").vpc(vpc).build(); lb.addListener(LoadBalancerListener.builder().externalPort(80).build()); lb.addTarget(service.loadBalancerTarget(LoadBalancerTargetOptions.builder() \ .containerName("MyContainer") \ .containerPort(80) \ .build())); ``` -------------------------------- ### FargateComputeEnvironment Usage Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/batch/FargateComputeEnvironment.html This example demonstrates how to create a Fargate compute environment with spot instances and associate it with job queues. ```APIDOC ## FargateComputeEnvironment ### Description A ManagedComputeEnvironment that uses ECS orchestration on Fargate instances. ### Example ```java IVpc vpc; FargateComputeEnvironment sharedComputeEnv = FargateComputeEnvironment.Builder.create(this, "spotEnv") .vpc(vpc) .spot(true) .build(); JobQueue lowPriorityQueue = JobQueue.Builder.create(this, "JobQueue") .priority(1) .build(); JobQueue highPriorityQueue = JobQueue.Builder.create(this, "JobQueue") .priority(10) .build(); lowPriorityQueue.addComputeEnvironment(sharedComputeEnv, 1); highPriorityQueue.addComputeEnvironment(sharedComputeEnv, 1); ``` ### Builder `FargateComputeEnvironment.Builder` is a fluent builder for `FargateComputeEnvironment`. ``` -------------------------------- ### Get Restricted Period Start Date Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/connectcampaignsv2/CfnCampaignPropsMixin.RestrictedPeriodProperty.Jsii%24Proxy.html Retrieves the start date of the restricted period. This method is part of the RestrictedPeriodProperty interface. ```java final String getStartDate() The start date of the restricted period. ``` -------------------------------- ### Get Start Time Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/applicationsignals/CfnServiceLevelObjective.CalendarIntervalProperty.Jsii%24Proxy.html Retrieves the date and time for the start of the first interval. This is a concrete method within the Jsii$Proxy class. ```java final Number getStartTime() ``` -------------------------------- ### Instantiate MediaPackageOutputDestinationSettingsProperty Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/medialive/CfnChannelPropsMixin.MediaPackageOutputDestinationSettingsProperty.html This example demonstrates how to create an instance of MediaPackageOutputDestinationSettingsProperty using its builder. Replace placeholder values with your actual configuration. ```java import software.amazon.awscdk.cfnpropertymixins.services.medialive.*; MediaPackageOutputDestinationSettingsProperty mediaPackageOutputDestinationSettingsProperty = MediaPackageOutputDestinationSettingsProperty.builder() .channelEndpointId("channelEndpointId") .channelGroup("channelGroup") .channelId("channelId") .channelName("channelName") .mediaPackageRegionName("mediaPackageRegionName") .build(); ``` -------------------------------- ### Compute Environment Example Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/batch/package-summary.html Illustrates a compute environment with different instance types and their vCPU capacities. ```text Compute Environment: 1. m5.xlarge => 4 vCPU 2. m5.2xlarge => 8 vCPU ``` -------------------------------- ### CfnTag Usage Examples Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/class-use/CfnTag.html Examples demonstrating how to get and set tags for different AWS Network Manager resources using CfnTag. ```APIDOC ## Getting Tags ### `CfnLink.getTagsRaw()` **Description**: Retrieves the tags associated with a link. **Returns**: `List` - The list of tags for the link. ### `CfnSite.getTagsRaw()` **Description**: Retrieves the tags associated with a site. **Returns**: `List` - The list of tags for the site. ### `CfnSiteToSiteVpnAttachment.getTagsRaw()` **Description**: Retrieves the tags associated with the Site-to-Site VPN attachment. **Returns**: `List` - The list of tags. ### `CfnTransitGatewayPeering.getTagsRaw()` **Description**: Retrieves the key-value tags associated with the peering connection. **Returns**: `List` - The list of tags. ### `CfnTransitGatewayRouteTableAttachment.getTagsRaw()` **Description**: Retrieves the key-value pairs associated with the transit gateway route table attachment. **Returns**: `List` - The list of tags. ### `CfnVpcAttachment.getTagsRaw()` **Description**: Retrieves the tags associated with the VPC attachment. **Returns**: `List` - The list of tags. ## Setting Tags ### `CfnDirectConnectGatewayAttachment.setTags(List value)` **Description**: Sets the tags for the Direct Connect Gateway attachment. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnConnectAttachment.setTagsRaw(List value)` **Description**: Sets the tags associated with the Connect attachment. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnConnectPeer.setTagsRaw(List value)` **Description**: Sets the list of key-value tags associated with the Connect peer. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnCoreNetwork.setTagsRaw(List value)` **Description**: Sets the list of key-value tags associated with a core network. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnDevice.setTagsRaw(List value)` **Description**: Sets the tags for the device. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnGlobalNetwork.setTagsRaw(List value)` **Description**: Sets the tags for the global network. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnLink.setTagsRaw(List value)` **Description**: Sets the tags for the link. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnSite.setTagsRaw(List value)` **Description**: Sets the tags for the site. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnSiteToSiteVpnAttachment.setTagsRaw(List value)` **Description**: Sets the tags associated with the Site-to-Site VPN attachment. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnTransitGatewayPeering.setTagsRaw(List value)` **Description**: Sets the list of key-value tags associated with the peering. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnTransitGatewayRouteTableAttachment.setTagsRaw(List value)` **Description**: Sets the list of key-value pairs associated with the transit gateway route table attachment. **Parameters**: - **value** (`List`) - The list of tags to set. ### `CfnVpcAttachment.setTagsRaw(List value)` **Description**: Sets the tags associated with the VPC attachment. **Parameters**: - **value** (`List`) - The list of tags to set. ## Builder Methods for Setting Tags ### `CfnConnectAttachment.Builder.tags(List tags)` **Description**: Sets the tags associated with the Connect attachment during builder configuration. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnConnectAttachment.ProposedNetworkFunctionGroupChangeProperty.Builder.tags(List tags)` **Description**: Sets the tags for the proposed network function group change. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnConnectAttachment.ProposedSegmentChangeProperty.Builder.tags(List tags)` **Description**: Sets the tags for the proposed segment change. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnConnectAttachmentProps.Builder.tags(List tags)` **Description**: Sets the tags for `CfnConnectAttachmentProps`. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnConnectPeer.Builder.tags(List tags)` **Description**: Sets the list of key-value tags associated with the Connect peer during builder configuration. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnConnectPeerProps.Builder.tags(List tags)` **Description**: Sets the tags for `CfnConnectPeerProps`. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnCoreNetwork.Builder.tags(List tags)` **Description**: Sets the list of key-value tags associated with a core network during builder configuration. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnCoreNetworkProps.Builder.tags(List tags)` **Description**: Sets the tags for `CfnCoreNetworkProps`. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnDevice.Builder.tags(List tags)` **Description**: Sets the tags for the device during builder configuration. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnDeviceProps.Builder.tags(List tags)` **Description**: Sets the tags for `CfnDeviceProps`. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnDirectConnectGatewayAttachment.Builder.tags(List tags)` **Description**: Sets the tags for the Direct Connect Gateway attachment during builder configuration. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnDirectConnectGatewayAttachment.ProposedNetworkFunctionGroupChangeProperty.Builder.tags(List tags)` **Description**: Sets the tags for the proposed network function group change. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnDirectConnectGatewayAttachment.ProposedSegmentChangeProperty.Builder.tags(List tags)` **Description**: Sets the tags for the proposed segment change. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnDirectConnectGatewayAttachmentProps.Builder.tags(List tags)` **Description**: Sets the tags for `CfnDirectConnectGatewayAttachmentProps`. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnGlobalNetwork.Builder.tags(List tags)` **Description**: Sets the tags for the global network during builder configuration. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnGlobalNetworkProps.Builder.tags(List tags)` **Description**: Sets the tags for `CfnGlobalNetworkProps`. **Parameters**: - **tags** (`List`) - The list of tags to associate. ### `CfnLink.Builder.tags(List tags)` **Description**: Sets the tags for the link during builder configuration. **Parameters**: - **tags** (`List`) - The list of tags to associate. ``` -------------------------------- ### Get Tooltip Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/quicksight/CfnDashboardPropsMixin.FilledMapConfigurationProperty.Jsii%24Proxy.html Retrieves the tooltip display setup for the visual. ```java final Object getTooltip() The tooltip display setup of the visual. ``` -------------------------------- ### Instantiate VpcOriginConfigProperty Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/cloudfront/CfnDistributionPropsMixin.VpcOriginConfigProperty.html Example of how to instantiate the VpcOriginConfigProperty with placeholder values. Ensure to replace placeholders with actual configuration details. ```java import software.amazon.awscdk.cfnpropertymixins.services.cloudfront.*; VpcOriginConfigProperty vpcOriginConfigProperty = VpcOriginConfigProperty.builder() .originKeepaliveTimeout(123) .originReadTimeout(123) .ownerAccountId("ownerAccountId") .vpcOriginId("vpcOriginId") .build(); ``` -------------------------------- ### Get Legend Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/quicksight/CfnDashboardPropsMixin.FilledMapConfigurationProperty.Jsii%24Proxy.html Retrieves the legend display setup for the visual. ```java final Object getLegend() The legend display setup of the visual. ``` -------------------------------- ### Creating a Stack and Defining Resources Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/Stack.html This example demonstrates how to create a new Stack and define resources within it, such as an S3 Bucket and a DynamoDB Table with specific configurations. ```java import software.amazon.awscdk.*; import software.amazon.awscdk.services.s3.*; IBucket bucket; App app = new App(); Stack stack = new Stack(app, "Stack"); Table.Builder.create(stack, "Table") .partitionKey(Attribute.builder() .name("id") .type(AttributeType.STRING) .build()) .importSource(ImportSourceSpecification.builder() .compressionType(InputCompressionType.GZIP) .inputFormat(InputFormat.csv(CsvOptions.builder() .delimiter(",") .headerList(List.of("id", "name")) .build())) .bucket(bucket) .keyPrefix("prefix") .build()) .build(); ``` -------------------------------- ### Instantiate PartitionKeyProperty Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/timestream/CfnTablePropsMixin.PartitionKeyProperty.html Shows how to create an instance of PartitionKeyProperty using its builder. Replace placeholder values with your actual configuration. ```java import software.amazon.awscdk.cfnpropertymixins.services.timestream.*; PartitionKeyProperty partitionKeyProperty = PartitionKeyProperty.builder() .enforcementInRecord("enforcementInRecord") .name("name") .type("type") .build(); ``` -------------------------------- ### Get Interactions Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/cfnpropertymixins/services/quicksight/CfnDashboardPropsMixin.FilledMapConfigurationProperty.Jsii%24Proxy.html Retrieves the general visual interactions setup. ```java final Object getInteractions() The general visual interactions setup for a visual. ``` -------------------------------- ### ECS Cluster Setup with Fargate Source: https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/ecs/ClusterProps.html Demonstrates how to set up an ECS cluster, define a task, and configure a service to run tasks using Fargate launch targets. This example includes VPC lookup, task definition with container configuration, and environment variable overrides. ```java IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder() .isDefault(true) .build()); Cluster cluster = Cluster.Builder.create(this, "FargateCluster").vpc(vpc).build(); TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD") .memoryMiB("512") .cpu("256") .compatibility(Compatibility.FARGATE) .build(); ContainerDefinition containerDefinition = taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder() .image(ContainerImage.fromRegistry("foo/bar")) .memoryLimitMiB(256) .build()); EcsRunTask runTask = EcsRunTask.Builder.create(this, "RunFargate") .integrationPattern(IntegrationPattern.RUN_JOB) .cluster(cluster) .taskDefinition(taskDefinition) .assignPublicIp(true) .containerOverrides(List.of(ContainerOverride.builder() .containerDefinition(containerDefinition) .environment(List.of(TaskEnvironmentVariable.builder().name("SOME_KEY").value(JsonPath.stringAt("$.SomeKey")).build())) .build())) .launchTarget(new EcsFargateLaunchTarget()) .propagatedTagSource(PropagatedTagSource.TASK_DEFINITION) .build(); ```