Package: aws-solutions-constructs.aws-fargate-opensearch
aws-fargate-opensearch module---All classes are under active development and subject to non-backward compatible changes or removal in any
future version. These are not subject to theSemantic Versioningmodel.
This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_fargate_opensearchTypescript@aws-solutions-constructs/aws-fargate-opensearchJavasoftware.amazon.awsconstructs.services.fargateopensearchOverviewThis AWS Solutions Construct implements an AWS Fargate service that can write/read to an Amazon OpenSearch Service domain.Here is a minimal deployable pattern definition:Typescriptimport{Construct}from'constructs';import{Stack,StackProps}from'aws-cdk-lib';import{FargateToOpenSearch,FargateToOpenSearchProps}from'@aws-solutions-constructs/aws-fargate-opensearch';constconstructProps:FargateToOpenSearchProps={publicApi:true,ecrRepositoryArn:"arn:aws:ecr:us-east-1:123456789012:repository/your-ecr-repo",openSearchDomainName:'testdomain',//TODO:EnsuretheCognitodomainnameisgloballyuniquecognitoDomainName:'globallyuniquedomain'+Aws.ACCOUNT_ID};newFargateToOpenSearch(this,'test-construct',constructProps);Pythonfromaws_solutions_constructs.aws_fargate_opensearchimportFargateToOpenSearch,FargateToOpenSearchPropsfromaws_cdkimport(Stack)fromconstructsimportConstructFargateToOpenSearch(self,'test_construct',public_api=True,ecr_repository_arn="arn:aws:ecr:us-east-1:123456789012:repository/your-ecr-repo",open_search_domain_name='testdomain',# TODO: Ensure the Cognito domain name is globally uniquecognito_domain_name='globallyuniquedomain'+Aws.ACCOUNT_ID)Javaimportsoftware.constructs.Construct;importsoftware.amazon.awscdk.Stack;importsoftware.amazon.awscdk.StackProps;importsoftware.amazon.awsconstructs.services.fargateopensearch.*;newFargateToOpenSearch(this,"test_construct",newFargateToOpenSearchProps.Builder().publicApi(true).ecrRepositoryArn("arn:aws:ecr:us-east-1:123456789012:repository/your-ecr-repo".openSearchDomainName("testdomain")// TODO: Ensure the Cognito domain name is globally unique.cognitoDomainName("globallyuniquedomain"+Aws.ACCOUNT_ID).build());Pattern Construct PropsNameTypeDescriptionpublicApibooleanWhether the construct is deploying a private or public API. This has implications for the VPC.vpcProps?ec2.VpcPropsOptional custom properties for a VPC the construct will create. This VPC will be used by any Private Hosted Zone the construct creates (that's why loadBalancerProps and privateHostedZoneProps can't include a VPC). Providing both this and existingVpc is an error.existingVpc?ec2.IVpcAn existing VPC in which to deploy the construct. Providing both this and vpcProps is an error. If the client provides an existing load balancer and/or existing Private Hosted Zone, those constructs must exist in this VPC.clusterProps?ecs.ClusterPropsOptional properties to create a new ECS cluster. To provide an existing cluster, use the cluster attribute of fargateServiceProps.ecrRepositoryArn?stringThe arn of an ECR Repository containing the image to use to generate the containers. Either this or the image property of containerDefinitionProps must be provided. format: arn:aws:ecr:region:account number:repository/Repository NameecrImageVersion?stringThe version of the image to use from the repository. Defaults to 'Latest'.containerDefinitionProps?ecs.ContainerDefinitionProps | anyOptional props to define the container created for the Fargate Service (defaults found in fargate-defaults.ts).fargateTaskDefinitionProps?ecs.FargateTaskDefinitionProps | anyOptional props to define the Fargate Task Definition for this construct  (defaults found in fargate-defaults.ts).fargateServiceProps?ecs.FargateServiceProps | anyOptional values to override default Fargate Task definition properties (fargate-defaults.ts). The construct will default to launching the service is the most isolated subnets available (precedence: Isolated, Private and Public). Override those and other defaults here.existingFargateServiceObject?ecs.FargateServiceA Fargate Service already instantiated (probably by another Solutions Construct). If this is specified, then no props defining a new service can be provided, including: ecrImageVersion, containerDefinitionProps, fargateTaskDefinitionProps, ecrRepositoryArn, fargateServiceProps, clusterProps.existingContainerDefinitionObject?ecs.ContainerDefinitionA container definition already instantiated as part of a Fargate service. This must be the container in the existingFargateServiceObject.openSearchDomainProps?opensearchservice.CfnDomainPropsOptional user provided props to override the default props for the OpenSearch Service.openSearchDomainNamestringDomain name for the OpenSearch Service.cognitoDomainName?stringOptional Amazon Cognito domain name. If omitted the Amazon Cognito domain will default to the OpenSearch Service domain name.createCloudWatchAlarms?booleanWhether to create the recommended CloudWatch alarms.domainEndpointEnvironmentVariableName?stringOptional name for the OpenSearch Service domain endpoint environment variable set for the Lambda function. Default isDOMAIN_ENDPOINT.Pattern PropertiesNameTypeDescriptionvpcec2.IVpcThe VPC used by the construct (whether created by the construct or provided by the client).serviceecs.FargateServiceThe AWS Fargate service used by this construct (whether created by this construct or passed to this construct at initialization).containerecs.ContainerDefinitionThe container associated with the AWS Fargate service in the service property.userPoolcognito.UserPoolReturns an instance ofcognito.UserPoolcreated by the construct.userPoolClientcognito.UserPoolClientReturns an instance ofcognito.UserPoolClientcreated by the construct.identityPoolcognito.CfnIdentityPoolReturns an instance ofcognito.CfnIdentityPoolcreated by the construct.openSearchDomainopensearchservice.CfnDomainReturns an instance ofopensearch.CfnDomaincreated by the construct.openSearchRoleiam.RoleReturns an instance ofiam.Rolecreated by the construct foropensearch.CfnDomain.cloudWatchAlarms?cloudwatch.Alarm[]Returns a list ofcloudwatch.Alarmcreated by the construct.Default settingsOut of the box implementation of the Construct without any override will set the following defaults:AWS Fargate ServiceSets up an AWS Fargate serviceUses the existing service if providedCreates a new service if none providedService will run in isolated subnets if available, then private subnets if available and finally public subnetsAdds environment variables to the container with the OpenSearch Service domain endpointAdd permissions to the container IAM role allowing it to write/read to the OpenSearch Service domain endpointAmazon CognitoSet password policy for User PoolsEnforce the advanced security mode for User PoolsAmazon OpenSearch ServiceDeploy best practices CloudWatch Alarms for the OpenSearch Service domainSecure the OpenSearch Service dashboard access with Cognito User PoolsEnable server-side encryption for OpenSearch Service domain using AWS managed KMS KeyEnable node-to-node encryption for the OpenSearch Service domainConfigure the cluster for the OpenSearch Service domainArchitecture© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.