diff --git a/indexer-core/pom.xml b/indexer-core/pom.xml index d1950e8873648c981c8b063fa78a3d9182533ed5..3b5cc0b50052de962689cf0d9f2dc7a8d92dfce9 100644 --- a/indexer-core/pom.xml +++ b/indexer-core/pom.xml @@ -68,7 +68,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-search-core-lib</artifactId> - <version>1.0.10</version> + <version>1.0.14</version> </dependency> <dependency> diff --git a/provider/indexer-aws/CloudFormation/Manual/01-CreateCodePipeline.yml b/provider/indexer-aws/CloudFormation/Manual/01-CreateCodePipeline.yml index cfaad181934f70d70b9ce9213c9ab0f6b3175c1f..b6960466938d8b82d06f96f6973c3ff11f3648c3 100644 --- a/provider/indexer-aws/CloudFormation/Manual/01-CreateCodePipeline.yml +++ b/provider/indexer-aws/CloudFormation/Manual/01-CreateCodePipeline.yml @@ -1,680 +1,680 @@ # Copyright © Amazon Web Services -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. -AWSTemplateFormatVersion: 2010-09-09 -Description: > - This CloudFormation script creates the deployment pipeline for OSDU's indexer - service. The CodePipeline should automatically trigger whenever commits are - made on the tracked branch. The start and end of the CodePipeline should - trigger a SNS alert to keep track of when the deployment has started and when - it finishes. -Parameters: - Environment: - Description: Environment Name. Defaults to 'dev'. Can only be dev/uat/prod. - Type: String - AllowedValues: - - dev - - uat - - prod - Default: dev + AWSTemplateFormatVersion: 2010-09-09 + Description: > + This CloudFormation script creates the deployment pipeline for OSDU's indexer + service. The CodePipeline should automatically trigger whenever commits are + made on the tracked branch. The start and end of the CodePipeline should + trigger a SNS alert to keep track of when the deployment has started and when + it finishes. + Parameters: + Environment: + Description: Environment Name. Defaults to 'dev'. Can only be dev/uat/prod. + Type: String + AllowedValues: + - dev + - uat + - prod + Default: dev - DeploymentRegion: - Description: The AWS region to deploy the application to. The default is us-east-1. - Type: String - Default: us-east-1 + DeploymentRegion: + Description: The AWS region to deploy the application to. The default is us-east-1. + Type: String + Default: us-east-1 - SNSNotificationEmail: - Description: The email address to send SNS notifications about the build to. - Type: String - Default: barclay.walsh@parivedasolutions.com + SNSNotificationEmail: + Description: The email address to send SNS notifications about the build to. + Type: String + Default: barclay.walsh@parivedasolutions.com - CodeCommitRepositoryName: - Description: >- - The name of the Code Commit Repository that the CodePipeline source is - connected to. - Type: String - Default: os-indexer + CodeCommitRepositoryName: + Description: >- + The name of the Code Commit Repository that the CodePipeline source is + connected to. + Type: String + Default: os-indexer - CodeCommitBranchName: - Description: >- - The name of the Code Commit branch that the CodePipeline source is - connected to. - Type: String - Default: dev + CodeCommitBranchName: + Description: >- + The name of the Code Commit branch that the CodePipeline source is + connected to. + Type: String + Default: dev - MasterStackName: - Description: The name of the master stack that is being deployed by the CodePipeline. - Type: String - Default: os-indexer-master-stack + MasterStackName: + Description: The name of the master stack that is being deployed by the CodePipeline. + Type: String + Default: os-indexer-master-stack - MasterTemplateName: - Description: >- - The name of the master template that is called when creating the master - stack. - Type: String - Default: provider/indexer-aws/CloudFormation/Master/os-indexer-master.yml + MasterTemplateName: + Description: >- + The name of the master template that is called when creating the master + stack. + Type: String + Default: provider/indexer-aws/CloudFormation/Master/os-indexer-master.yml - SchemaCacheName: - Description: The name of the cache cluster for the schema cache. Needs to match the value in the environment params JSON. Will be prefixed with the environment name. - Type: String - MinLength: '1' - MaxLength: '64' - AllowedPattern: "^[a-zA-Z]+[0-9a-zA-Z_-]*$" - ConstraintDescription: Must start with a letter. Only numbers, letters, -, and _ accepted. Max. length 64 characters. - Default: indexerSchemaCache + SchemaCacheName: + Description: The name of the cache cluster for the schema cache. Needs to match the value in the environment params JSON. Will be prefixed with the environment name. + Type: String + MinLength: '1' + MaxLength: '64' + AllowedPattern: "^[a-zA-Z]+[0-9a-zA-Z_-]*$" + ConstraintDescription: Must start with a letter. Only numbers, letters, -, and _ accepted. Max. length 64 characters. + Default: indexerSchemaCache - IndexCacheName: - Description: The name of the cache cluster for the index cache. Needs to match the value in the environment params JSON. Will be prefixed with the environment name. - Type: String - MinLength: '1' - MaxLength: '64' - AllowedPattern: "^[a-zA-Z]+[0-9a-zA-Z_-]*$" - ConstraintDescription: Must start with a letter. Only numbers, letters, -, and _ accepted. Max. length 64 characters. - Default: indexerIndexCache + IndexCacheName: + Description: The name of the cache cluster for the index cache. Needs to match the value in the environment params JSON. Will be prefixed with the environment name. + Type: String + MinLength: '1' + MaxLength: '64' + AllowedPattern: "^[a-zA-Z]+[0-9a-zA-Z_-]*$" + ConstraintDescription: Must start with a letter. Only numbers, letters, -, and _ accepted. Max. length 64 characters. + Default: indexerIndexCache -Resources: - S3BucketCloudFormation: - Type: 'AWS::S3::Bucket' - DeletionPolicy: Delete - Properties: - BucketName: !Sub '${Environment}-os-indexer-cloudformation-scripts' - CloudFormationS3BucketPolicy: - Type: 'AWS::S3::BucketPolicy' - Properties: - Bucket: !Ref S3BucketCloudFormation - PolicyDocument: - Statement: - - Action: - - 's3:*' - Effect: Allow - Resource: - - !Sub 'arn:aws:s3:::${S3BucketCloudFormation}' - - !Sub 'arn:aws:s3:::${S3BucketCloudFormation}/*' - Principal: - AWS: - - !Sub 'arn:aws:iam::${AWS::AccountId}:root' - - !GetAtt - - CodeBuildRole - - Arn - - !GetAtt - - PipelineRole - - Arn - - !GetAtt - - CFNRole - - Arn - ArtifactStoreBucket: - Type: 'AWS::S3::Bucket' - DeletionPolicy: Delete - Properties: - VersioningConfiguration: - Status: Enabled - ArtifactStoreBucketPolicy: - Type: 'AWS::S3::BucketPolicy' - Properties: - Bucket: !Ref ArtifactStoreBucket - PolicyDocument: - Statement: - - Action: - - 's3:*' - Effect: Allow - Resource: - - !Sub 'arn:aws:s3:::${ArtifactStoreBucket}' - - !Sub 'arn:aws:s3:::${ArtifactStoreBucket}/*' - Principal: - AWS: - - !Sub 'arn:aws:iam::${AWS::AccountId}:root' - - !GetAtt - - CodeBuildRole - - Arn - - !GetAtt - - PipelineRole - - Arn - - !GetAtt - - CFNRole - - Arn - CachingBucket: - Type: AWS::S3::Bucket - DeletionPolicy: Delete - Properties: - VersioningConfiguration: - Status: Enabled + Resources: + S3BucketCloudFormation: + Type: 'AWS::S3::Bucket' + DeletionPolicy: Delete + Properties: + BucketName: !Sub '${Environment}-os-indexer-cloudformation-scripts' + CloudFormationS3BucketPolicy: + Type: 'AWS::S3::BucketPolicy' + Properties: + Bucket: !Ref S3BucketCloudFormation + PolicyDocument: + Statement: + - Action: + - 's3:*' + Effect: Allow + Resource: + - !Sub 'arn:aws:s3:::${S3BucketCloudFormation}' + - !Sub 'arn:aws:s3:::${S3BucketCloudFormation}/*' + Principal: + AWS: + - !Sub 'arn:aws:iam::${AWS::AccountId}:root' + - !GetAtt + - CodeBuildRole + - Arn + - !GetAtt + - PipelineRole + - Arn + - !GetAtt + - CFNRole + - Arn + ArtifactStoreBucket: + Type: 'AWS::S3::Bucket' + DeletionPolicy: Delete + Properties: + VersioningConfiguration: + Status: Enabled + ArtifactStoreBucketPolicy: + Type: 'AWS::S3::BucketPolicy' + Properties: + Bucket: !Ref ArtifactStoreBucket + PolicyDocument: + Statement: + - Action: + - 's3:*' + Effect: Allow + Resource: + - !Sub 'arn:aws:s3:::${ArtifactStoreBucket}' + - !Sub 'arn:aws:s3:::${ArtifactStoreBucket}/*' + Principal: + AWS: + - !Sub 'arn:aws:iam::${AWS::AccountId}:root' + - !GetAtt + - CodeBuildRole + - Arn + - !GetAtt + - PipelineRole + - Arn + - !GetAtt + - CFNRole + - Arn + CachingBucket: + Type: AWS::S3::Bucket + DeletionPolicy: Delete + Properties: + VersioningConfiguration: + Status: Enabled - CachingBucketPolicy: - Type: AWS::S3::BucketPolicy - Properties: - Bucket: !Ref CachingBucket - PolicyDocument: - Statement: - - Action: - - s3:* - Effect: Allow - Resource: - - !Sub arn:aws:s3:::${CachingBucket} - - !Sub arn:aws:s3:::${CachingBucket}/* - Principal: - AWS: - - !Sub arn:aws:iam::${AWS::AccountId}:root - - !GetAtt [CodeBuildRole,Arn] - - !GetAtt [PipelineRole,Arn] - - !GetAtt [CFNRole,Arn] + CachingBucketPolicy: + Type: AWS::S3::BucketPolicy + Properties: + Bucket: !Ref CachingBucket + PolicyDocument: + Statement: + - Action: + - s3:* + Effect: Allow + Resource: + - !Sub arn:aws:s3:::${CachingBucket} + - !Sub arn:aws:s3:::${CachingBucket}/* + Principal: + AWS: + - !Sub arn:aws:iam::${AWS::AccountId}:root + - !GetAtt [CodeBuildRole,Arn] + - !GetAtt [PipelineRole,Arn] + - !GetAtt [CFNRole,Arn] - SNSCodePipelineDeploymentFailed: - Type: 'AWS::SNS::Topic' - Properties: - Subscription: - - Endpoint: !Ref SNSNotificationEmail - Protocol: email - TopicName: !Sub '${Environment}-OS-Indexer-Deployment-CodePipeline-Failed' - EventRuleCodePipelineFailed: - Type: 'AWS::Events::Rule' - Properties: - Description: Triggered whenever the CodePipeline deployment stage has failed. - EventPattern: - source: - - aws.codepipeline - detail-type: - - CodePipeline Stage Execution State Change - detail: - state: - - FAILED - pipeline: - - !Sub '${Environment}-OSDU-OS-Indexer-CodePipeline' - Name: !Sub '${Environment}-CodePipelineEventRule-${CodeCommitRepositoryName}' - Targets: - - Arn: !Ref SNSCodePipelineDeploymentFailed - Id: Deployment-CodePipeline-Failed - InputTransformer: - InputPathsMap: - pipeline: $.detail.pipeline - InputTemplate: '"The Pipeline <pipeline> has failed."' - Pipeline: - Type: 'AWS::CodePipeline::Pipeline' - Properties: - ArtifactStore: - Location: !Ref ArtifactStoreBucket - Type: S3 - Name: !Sub '${Environment}-OSDU-OS-Indexer-CodePipeline' - RoleArn: !GetAtt - - PipelineRole - - Arn - Stages: - - Name: Source - Actions: - - Name: Source - ActionTypeId: - Category: Source - Owner: AWS - Provider: CodeCommit - Version: '1' - Configuration: - BranchName: !Ref CodeCommitBranchName - RepositoryName: !Ref CodeCommitRepositoryName - OutputArtifacts: - - Name: Source - RunOrder: '1' - - Name: Pre-Deployment-CodeBuild - Actions: - - Name: Pre-Deployment-CodeBuild - ActionTypeId: - Category: Build - Owner: AWS - Provider: CodeBuild - Version: '1' - InputArtifacts: + SNSCodePipelineDeploymentFailed: + Type: 'AWS::SNS::Topic' + Properties: + Subscription: + - Endpoint: !Ref SNSNotificationEmail + Protocol: email + TopicName: !Sub '${Environment}-OS-Indexer-Deployment-CodePipeline-Failed' + EventRuleCodePipelineFailed: + Type: 'AWS::Events::Rule' + Properties: + Description: Triggered whenever the CodePipeline deployment stage has failed. + EventPattern: + source: + - aws.codepipeline + detail-type: + - CodePipeline Stage Execution State Change + detail: + state: + - FAILED + pipeline: + - !Sub '${Environment}-OSDU-OS-Indexer-CodePipeline' + Name: !Sub '${Environment}-CodePipelineEventRule-${CodeCommitRepositoryName}' + Targets: + - Arn: !Ref SNSCodePipelineDeploymentFailed + Id: Deployment-CodePipeline-Failed + InputTransformer: + InputPathsMap: + pipeline: $.detail.pipeline + InputTemplate: '"The Pipeline <pipeline> has failed."' + Pipeline: + Type: 'AWS::CodePipeline::Pipeline' + Properties: + ArtifactStore: + Location: !Ref ArtifactStoreBucket + Type: S3 + Name: !Sub '${Environment}-OSDU-OS-Indexer-CodePipeline' + RoleArn: !GetAtt + - PipelineRole + - Arn + Stages: - Name: Source - OutputArtifacts: + Actions: + - Name: Source + ActionTypeId: + Category: Source + Owner: AWS + Provider: CodeCommit + Version: '1' + Configuration: + BranchName: !Ref CodeCommitBranchName + RepositoryName: !Ref CodeCommitRepositoryName + OutputArtifacts: + - Name: Source + RunOrder: '1' - Name: Pre-Deployment-CodeBuild - Configuration: - ProjectName: !Ref PreDeploymentCodeBuild - RunOrder: '2' - - Name: Deployment - Actions: - - Name: CloudFormation-Deployment-Master - ActionTypeId: - Category: Deploy - Owner: AWS - Provider: CloudFormation - Version: '1' - InputArtifacts: - - Name: Source - Configuration: - ActionMode: CREATE_UPDATE - Capabilities: CAPABILITY_NAMED_IAM - RoleArn: !GetAtt - - CFNRole - - Arn - StackName: !Sub '${Environment}-${MasterStackName}' - TemplatePath: !Sub 'Source::${MasterTemplateName}' - TemplateConfiguration: !Sub >- - Source::provider/indexer-aws/CloudFormation/Params/${Environment}.template_configuration.json - RunOrder: '3' + Actions: + - Name: Pre-Deployment-CodeBuild + ActionTypeId: + Category: Build + Owner: AWS + Provider: CodeBuild + Version: '1' + InputArtifacts: + - Name: Source + OutputArtifacts: + - Name: Pre-Deployment-CodeBuild + Configuration: + ProjectName: !Ref PreDeploymentCodeBuild + RunOrder: '2' + - Name: Deployment + Actions: + - Name: CloudFormation-Deployment-Master + ActionTypeId: + Category: Deploy + Owner: AWS + Provider: CloudFormation + Version: '1' + InputArtifacts: + - Name: Source + Configuration: + ActionMode: CREATE_UPDATE + Capabilities: CAPABILITY_NAMED_IAM + RoleArn: !GetAtt + - CFNRole + - Arn + StackName: !Sub '${Environment}-${MasterStackName}' + TemplatePath: !Sub 'Source::${MasterTemplateName}' + TemplateConfiguration: !Sub >- + Source::provider/indexer-aws/CloudFormation/Params/${Environment}.template_configuration.json + RunOrder: '3' - - Name: Post-Deployment-CodeBuild - Actions: - - Name: Post-Deployment-CodeBuild - ActionTypeId: - Category: Build - Owner: AWS - Provider: CodeBuild - Version: '1' - InputArtifacts: - - Name: Source - OutputArtifacts: - Name: Post-Deployment-CodeBuild - Configuration: - ProjectName: !Ref PostDeploymentCodeBuild - RunOrder: '4' - PreDeploymentCodeBuild: - Type: 'AWS::CodeBuild::Project' - Properties: - Name: !Sub '${Environment}-pre-deployment-codebuild-${CodeCommitRepositoryName}' - Description: CodeBuild commands which run prior to the CloudFormation deployment. - ServiceRole: - 'Fn::GetAtt': - - CodeBuildRole - - Arn - Artifacts: - Type: S3 - Location: !Ref ArtifactStoreBucket - Name: !Sub '${Environment}-pre-deployment-codebuild' - Environment: - Type: LINUX_CONTAINER - ComputeType: BUILD_GENERAL1_SMALL - Image: aws/codebuild/standard:2.0 - EnvironmentVariables: - - Name: ENVIRONMENT - Type: PLAINTEXT - Value: !Ref Environment - - Name: AWS_ACCOUNT_ID - Type: PLAINTEXT - Value: !Ref 'AWS::AccountId' - - Name: AWS_REGION - Type: PLAINTEXT - Value: !Ref DeploymentRegion - - Name: CFN_S3_BUCKET - Type: PLAINTEXT - Value: !Sub '${Environment}-os-indexer-cloudformation-scripts' - PrivilegedMode: false - Source: - BuildSpec: ./provider/indexer-aws/buildspec-pre-deploy.yml - Location: !Sub >- - https://git-codecommit.${AWS::Region}.amazonaws.com/v1/repos/${CodeCommitRepositoryName} - Type: CODECOMMIT - TimeoutInMinutes: 15 + Actions: + - Name: Post-Deployment-CodeBuild + ActionTypeId: + Category: Build + Owner: AWS + Provider: CodeBuild + Version: '1' + InputArtifacts: + - Name: Source + OutputArtifacts: + - Name: Post-Deployment-CodeBuild + Configuration: + ProjectName: !Ref PostDeploymentCodeBuild + RunOrder: '4' + PreDeploymentCodeBuild: + Type: 'AWS::CodeBuild::Project' + Properties: + Name: !Sub '${Environment}-pre-deployment-codebuild-${CodeCommitRepositoryName}' + Description: CodeBuild commands which run prior to the CloudFormation deployment. + ServiceRole: + 'Fn::GetAtt': + - CodeBuildRole + - Arn + Artifacts: + Type: S3 + Location: !Ref ArtifactStoreBucket + Name: !Sub '${Environment}-pre-deployment-codebuild' + Environment: + Type: LINUX_CONTAINER + ComputeType: BUILD_GENERAL1_SMALL + Image: aws/codebuild/standard:2.0 + EnvironmentVariables: + - Name: ENVIRONMENT + Type: PLAINTEXT + Value: !Ref Environment + - Name: AWS_ACCOUNT_ID + Type: PLAINTEXT + Value: !Ref 'AWS::AccountId' + - Name: AWS_REGION + Type: PLAINTEXT + Value: !Ref DeploymentRegion + - Name: CFN_S3_BUCKET + Type: PLAINTEXT + Value: !Sub '${Environment}-os-indexer-cloudformation-scripts' + PrivilegedMode: false + Source: + BuildSpec: ./provider/indexer-aws/buildspec-pre-deploy.yml + Location: !Sub >- + https://git-codecommit.${AWS::Region}.amazonaws.com/v1/repos/${CodeCommitRepositoryName} + Type: CODECOMMIT + TimeoutInMinutes: 15 - PostDeploymentCodeBuild: - Type: AWS::CodeBuild::Project - Properties: - Name: !Sub ${Environment}-post-deployment-codebuild-${CodeCommitRepositoryName} - Description: CodeBuild commands which run after the CloudFormation deployment. - ServiceRole: - Fn::GetAtt: [ CodeBuildRole, Arn ] - Artifacts: - Type: S3 - Location: !Ref ArtifactStoreBucket - Name: !Sub ${Environment}-post-deployment-codebuild - Environment: - Type: LINUX_CONTAINER - ComputeType: BUILD_GENERAL1_SMALL - Image: aws/codebuild/standard:2.0 - EnvironmentVariables: - - Name: ENVIRONMENT - Type: PLAINTEXT - Value: !Ref Environment - - Name: AWS_ACCOUNT_ID - Type: PLAINTEXT - Value: !Ref AWS::AccountId - - Name: AWS_REGION - Type: PLAINTEXT - Value: !Ref DeploymentRegion - - Name: VSTS_FEED_TOKEN - Type: PLAINTEXT - Value: '{{resolve:secretsmanager:dev-VSTSFeedToken:SecretString:vsts_feed_token}}' - - Name: S3_MAVEN_REPOSITORY - Type: PLAINTEXT - Value: !Sub ${Environment}-osdu-local-maven-repository - - Name: AWS_SECRET_ACCESS_KEY_MAVEN - Type: PLAINTEXT - Value: '{{resolve:secretsmanager:dev-MavenS3RepositoryIamCredentials:SecretString:secret_key}}' - - Name: AWS_ACCESS_KEY_ID_MAVEN - Type: PLAINTEXT - Value: '{{resolve:secretsmanager:dev-MavenS3RepositoryIamCredentials:SecretString:access_key}}' - - Name: IMAGE_TAG - Type: PLAINTEXT - Value: latest - - Name: IMAGE_REPO_NAME - Type: PLAINTEXT - Value: !Sub ${Environment}-${CodeCommitRepositoryName}-repository - - Name: QUEUE_IMAGE_REPO_NAME - Type: PLAINTEXT - Value: !Sub ${Environment}-${CodeCommitRepositoryName}-queue-repository - - Name: SCHEMA_CACHE_NAME - Type: PLAINTEXT - Value: !Ref SchemaCacheName - - Name: INDEX_CACHE_NAME - Type: PLAINTEXT - Value: !Ref IndexCacheName - - Name: APPLICATION_NAME - Type: PLAINTEXT - Value: !Ref CodeCommitRepositoryName - PrivilegedMode: true - Source: - BuildSpec: ./provider/indexer-aws/buildspec-post-deploy.yml - Location: !Sub https://git-codecommit.${AWS::Region}.amazonaws.com/v1/repos/${CodeCommitRepositoryName} - Type: CODECOMMIT - Cache: - Type: S3 - Location: !Sub ${CachingBucket}/${Environment} - TimeoutInMinutes: 15 - VpcConfig: - SecurityGroupIds: - - Fn::ImportValue: - !Sub "${Environment}-OSDU-CodeBuildSecurityGroup" - Subnets: - - Fn::ImportValue: - !Sub "${Environment}-OSDU-PrivateSubnet-AZ1" - - Fn::ImportValue: - !Sub "${Environment}-OSDU-PrivateSubnet-AZ2" - VpcId: - Fn::ImportValue: - !Sub "${Environment}-OSDU-VPC" + PostDeploymentCodeBuild: + Type: AWS::CodeBuild::Project + Properties: + Name: !Sub ${Environment}-post-deployment-codebuild-${CodeCommitRepositoryName} + Description: CodeBuild commands which run after the CloudFormation deployment. + ServiceRole: + Fn::GetAtt: [ CodeBuildRole, Arn ] + Artifacts: + Type: S3 + Location: !Ref ArtifactStoreBucket + Name: !Sub ${Environment}-post-deployment-codebuild + Environment: + Type: LINUX_CONTAINER + ComputeType: BUILD_GENERAL1_SMALL + Image: aws/codebuild/standard:2.0 + EnvironmentVariables: + - Name: ENVIRONMENT + Type: PLAINTEXT + Value: !Ref Environment + - Name: AWS_ACCOUNT_ID + Type: PLAINTEXT + Value: !Ref AWS::AccountId + - Name: AWS_REGION + Type: PLAINTEXT + Value: !Ref DeploymentRegion + - Name: VSTS_FEED_TOKEN + Type: PLAINTEXT + Value: '{{resolve:secretsmanager:dev-VSTSFeedToken:SecretString:vsts_feed_token}}' + - Name: S3_MAVEN_REPOSITORY + Type: PLAINTEXT + Value: !Sub ${Environment}-osdu-local-maven-repository + - Name: AWS_SECRET_ACCESS_KEY_MAVEN + Type: PLAINTEXT + Value: '{{resolve:secretsmanager:dev-MavenS3RepositoryIamCredentials:SecretString:secret_key}}' + - Name: AWS_ACCESS_KEY_ID_MAVEN + Type: PLAINTEXT + Value: '{{resolve:secretsmanager:dev-MavenS3RepositoryIamCredentials:SecretString:access_key}}' + - Name: IMAGE_TAG + Type: PLAINTEXT + Value: latest + - Name: IMAGE_REPO_NAME + Type: PLAINTEXT + Value: !Sub ${Environment}-${CodeCommitRepositoryName}-repository + - Name: QUEUE_IMAGE_REPO_NAME + Type: PLAINTEXT + Value: !Sub ${Environment}-${CodeCommitRepositoryName}-queue-repository + - Name: SCHEMA_CACHE_NAME + Type: PLAINTEXT + Value: !Ref SchemaCacheName + - Name: INDEX_CACHE_NAME + Type: PLAINTEXT + Value: !Ref IndexCacheName + - Name: APPLICATION_NAME + Type: PLAINTEXT + Value: !Ref CodeCommitRepositoryName + PrivilegedMode: true + Source: + BuildSpec: ./provider/indexer-aws/buildspec-post-deploy.yml + Location: !Sub https://git-codecommit.${AWS::Region}.amazonaws.com/v1/repos/${CodeCommitRepositoryName} + Type: CODECOMMIT + Cache: + Type: S3 + Location: !Sub ${CachingBucket}/${Environment} + TimeoutInMinutes: 15 + VpcConfig: + SecurityGroupIds: + - Fn::ImportValue: + !Sub "${Environment}-OSDU-CodeBuildSecurityGroup" + Subnets: + - Fn::ImportValue: + !Sub "${Environment}-OSDU-PrivateSubnet-AZ1" + - Fn::ImportValue: + !Sub "${Environment}-OSDU-PrivateSubnet-AZ2" + VpcId: + Fn::ImportValue: + !Sub "${Environment}-OSDU-VPC" - CFNRole: - Type: 'AWS::IAM::Role' - Properties: - AssumeRolePolicyDocument: - Statement: - - Action: - - 'sts:AssumeRole' - Effect: Allow - Principal: - Service: - - cloudformation.amazonaws.com - Version: 2012-10-17 - Path: / - Policies: - - PolicyName: !Sub 'CloudFormationRole-${CodeCommitRepositoryName}' - PolicyDocument: - Version: 2012-10-17 - Statement: - - Action: - - 's3:*' - - 'ec2:*' - - 'apigateway:*' - - 'cloudwatch:*' - - 'events:*' - - 'logs:*' - - 'xray:*' - - 'lambda:*' - - 'rds:*' - - 'codepipeline:*' - - 'codecommit:*' - - 'cloudformation:*' - - 'ecr:*' - - 'dynamodb:*' - - 'application-autoscaling:*' - - 'autoscaling:*' - - 'states:*' - - 'iam:CreateUser' - - 'iam:UpdateUser' - - 'iam:DeleteUser' - - 'iam:CreateAccessKey' - - 'iam:UpdateAccessKey' - - 'iam:DeleteAccessKey' - - 'iam:Delete*' - - 'iam:List*' - - 'iam:Get*' - - 'iam:Put*' - - 'iam:CreateServiceSpecificCredential' - - 'iam:DeactivateMFADevice' - - 'iam:GenerateServiceLastAccessedDetails' - - 'iam:UpdateOpenIDConnectProviderThumbprint' - - 'iam:PutRolePolicy' - - 'iam:AddRoleToInstanceProfile' - - 'iam:SimulateCustomPolicy' - - 'iam:UploadSSHPublicKey' - - 'iam:UpdateServiceSpecificCredential' - - 'iam:RemoveClientIDFromOpenIDConnectProvider' - - 'iam:UpdateRoleDescription' - - 'iam:UpdateServerCertificate' - - 'iam:CreateInstanceProfile' - - 'iam:GenerateCredentialReport' - - 'iam:UntagRole' - - 'iam:PutRolePermissionsBoundary' - - 'iam:TagRole' - - 'iam:ResetServiceSpecificCredential' - - 'iam:PassRole' - - 'iam:EnableMFADevice' - - 'iam:ResyncMFADevice' - - 'iam:UpdateSAMLProvider' - - 'iam:CreatePolicy' - - 'iam:CreateServiceLinkedRole' - - 'iam:UpdateRole' - - 'iam:AddClientIDToOpenIDConnectProvider' - - 'iam:SetDefaultPolicyVersion' - - 'iam:UpdateAssumeRolePolicy' - - 'iam:RemoveRoleFromInstanceProfile' - - 'iam:CreateRole' - - 'iam:AttachRolePolicy' - - 'iam:CreateLoginProfile' - - 'iam:DetachRolePolicy' - - 'iam:AttachUserPolicy' - - 'iam:DetachUserPolicy' - - 'iam:SimulatePrincipalPolicy' - - 'iam:CreateAccountAlias' - - 'iam:ChangePassword' - - 'iam:UpdateLoginProfile' - - 'iam:UpdateAccessKey' - - 'iam:UpdateSSHPublicKey' - - 'iam:UpdateAccountPasswordPolicy' - - 'iam:CreateSAMLProvider' - - 'iam:CreateVirtualMFADevice' - - 'iam:CreateAccessKey' - - 'iam:AddUserToGroup' - - 'iam:RemoveUserFromGroup' - - 'iam:CreatePolicyVersion' - - 'iam:UploadSigningCertificate' - - 'iam:TagUser' - - 'iam:CreateOpenIDConnectProvider' - - 'iam:UploadServerCertificate' - - 'iam:UntagUser' - - 'iam:UpdateSigningCertificate' - - 'sns:*' - - 'sqs:*' - - 'secretsmanager:*' - - 'acm:*' - - 'kms:*' - - 'cloudfront:*' - - 'route53:*' - - 'route53domains:*' - - 'elasticache:*' - - 'es:*' - - 'ecr:*' - - 'codedeploy:*' - - 'elasticloadbalancing:*' - - 'ecs:*' - - 'servicediscovery:CreatePrivateDnsNamespace' - - 'servicediscovery:CreateService' - - 'servicediscovery:GetNamespace' - - 'servicediscovery:GetOperation' - - 'servicediscovery:GetService' - - 'servicediscovery:ListNamespaces' - - 'servicediscovery:ListServices' - - 'servicediscovery:UpdateService' - - 'servicediscovery:DeleteService' - Effect: Allow - Resource: '*' - CodeBuildRole: - Type: 'AWS::IAM::Role' - Properties: - RoleName: !Sub 'CodeBuildRole-${CodeCommitRepositoryName}' - AssumeRolePolicyDocument: - Version: 2012-10-17 - Statement: - - Effect: Allow - Principal: - Service: - - codebuild.amazonaws.com - Action: - - 'sts:AssumeRole' - Path: /service-role/ - Policies: - - PolicyName: !Sub 'CodeBuildNestedCFNAccessPolicy-${CodeCommitRepositoryName}' - PolicyDocument: - Version: 2012-10-17 - Statement: - - Effect: Allow - Action: - - 'cloudformation:Get*' - - 'cloudformation:Describe*' - - 'cloudformation:List*' - Resource: - - '*' - - Effect: Allow - Action: - - 'codebuild:StartBuild' - Resource: - - 'Fn::Sub': >- - arn:aws:codebuild:${AWS::Region}:${AWS::AccountId}:project/* - - Effect: Allow - Action: - - 'codecommit:ListBranches' - - 'codecommit:ListRepositories' - - 'codecommit:BatchGetRepositories' - - 'codecommit:Get*' - - 'codecommit:GitPull' - Resource: - - !Sub >- - arn:aws:codecommit:${AWS::Region}:${AWS::AccountId}:${CodeCommitRepositoryName} - - Effect: Allow - Action: - - 'ec2:*' - - 'cloudformation:ValidateTemplate' - - 'elasticloadbalancing:Describe*' - - 'autoscaling:Describe*' - - 'iam:Get*' - - 'iam:List*' - - 'logs:Describe*' - - 'logs:Get*' - - 'tag:Get*' - - "ecr:*" - - "codedeploy:*" - - "ecs:*" - Resource: - - '*' - - Effect: Allow - Action: - - 'logs:CreateLogGroup' - - 'logs:CreateLogStream' - - 'logs:PutLogEvents' - Resource: - - 'Fn::Sub': >- - arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/* - - Effect: Allow - Action: - - 's3:*' - Resource: '*' - - Effect: Allow - Action: - - 'lambda:UpdateFunctionCode' - - 'lambda:UpdateFunctionConfiguration' - - 'lambda:PublishLayerVersion' - - 'lambda:GetLayerVersion' - Resource: '*' - - Effect: Allow - Action: - - 'apigateway:GET' - - 'apigateway:POST' - Resource: '*' - PipelineRole: - Type: 'AWS::IAM::Role' - Properties: - AssumeRolePolicyDocument: - Statement: - - Action: - - 'sts:AssumeRole' - Effect: Allow - Principal: - Service: - - codepipeline.amazonaws.com - Version: 2012-10-17 - Path: / - Policies: - - PolicyName: !Sub 'CodePipelineAccess-${CodeCommitRepositoryName}' - PolicyDocument: - Version: 2012-10-17 - Statement: - - Action: - - 's3:*' - - 'cloudformation:CreateStack' - - 'cloudformation:DescribeStacks' - - 'cloudformation:DeleteStack' - - 'cloudformation:UpdateStack' - - 'cloudformation:CreateChangeSet' - - 'cloudformation:ExecuteChangeSet' - - 'cloudformation:DeleteChangeSet' - - 'cloudformation:DescribeChangeSet' - - 'cloudformation:SetStackPolicy' - - 'cloudformation:ValidateTemplate' - - 'iam:PassRole' - - 'sns:Publish' - - 'lambda:ListFunctions' - - 'lambda:InvokeFunction' - - 'ec2:Describe*' - - 'ec2:Get*' - - 'ec2:Search*' - - 'ec2:*Vpc*' - - 'ec2:*Gateway' - - 'ec2:*Tags' - - 'ec2:*Subnet*' - - 'ec2:*Route*' - - 'ec2:*SecurityGroup' - - 'ec2:allocate*' - - 'ec2:release*' - Effect: Allow - Resource: '*' - - Action: - - 'codecommit:GetUploadArchiveStatus' - - 'codecommit:CancelUploadArchive' - - 'codecommit:GetBranch' - - 'codecommit:GetCommit' - - 'codecommit:GetUploadStatus' - - 'codecommit:UploadArchive' - Effect: Allow - Resource: '*' - - Effect: Allow - Action: - - 'codebuild:*' - Resource: - - 'Fn::Sub': >- - arn:aws:codebuild:${AWS::Region}:${AWS::AccountId}:project/* + CFNRole: + Type: 'AWS::IAM::Role' + Properties: + AssumeRolePolicyDocument: + Statement: + - Action: + - 'sts:AssumeRole' + Effect: Allow + Principal: + Service: + - cloudformation.amazonaws.com + Version: 2012-10-17 + Path: / + Policies: + - PolicyName: !Sub 'CloudFormationRole-${CodeCommitRepositoryName}' + PolicyDocument: + Version: 2012-10-17 + Statement: + - Action: + - 's3:*' + - 'ec2:*' + - 'apigateway:*' + - 'cloudwatch:*' + - 'events:*' + - 'logs:*' + - 'xray:*' + - 'lambda:*' + - 'rds:*' + - 'codepipeline:*' + - 'codecommit:*' + - 'cloudformation:*' + - 'ecr:*' + - 'dynamodb:*' + - 'application-autoscaling:*' + - 'autoscaling:*' + - 'states:*' + - 'iam:CreateUser' + - 'iam:UpdateUser' + - 'iam:DeleteUser' + - 'iam:CreateAccessKey' + - 'iam:UpdateAccessKey' + - 'iam:DeleteAccessKey' + - 'iam:Delete*' + - 'iam:List*' + - 'iam:Get*' + - 'iam:Put*' + - 'iam:CreateServiceSpecificCredential' + - 'iam:DeactivateMFADevice' + - 'iam:GenerateServiceLastAccessedDetails' + - 'iam:UpdateOpenIDConnectProviderThumbprint' + - 'iam:PutRolePolicy' + - 'iam:AddRoleToInstanceProfile' + - 'iam:SimulateCustomPolicy' + - 'iam:UploadSSHPublicKey' + - 'iam:UpdateServiceSpecificCredential' + - 'iam:RemoveClientIDFromOpenIDConnectProvider' + - 'iam:UpdateRoleDescription' + - 'iam:UpdateServerCertificate' + - 'iam:CreateInstanceProfile' + - 'iam:GenerateCredentialReport' + - 'iam:UntagRole' + - 'iam:PutRolePermissionsBoundary' + - 'iam:TagRole' + - 'iam:ResetServiceSpecificCredential' + - 'iam:PassRole' + - 'iam:EnableMFADevice' + - 'iam:ResyncMFADevice' + - 'iam:UpdateSAMLProvider' + - 'iam:CreatePolicy' + - 'iam:CreateServiceLinkedRole' + - 'iam:UpdateRole' + - 'iam:AddClientIDToOpenIDConnectProvider' + - 'iam:SetDefaultPolicyVersion' + - 'iam:UpdateAssumeRolePolicy' + - 'iam:RemoveRoleFromInstanceProfile' + - 'iam:CreateRole' + - 'iam:AttachRolePolicy' + - 'iam:CreateLoginProfile' + - 'iam:DetachRolePolicy' + - 'iam:AttachUserPolicy' + - 'iam:DetachUserPolicy' + - 'iam:SimulatePrincipalPolicy' + - 'iam:CreateAccountAlias' + - 'iam:ChangePassword' + - 'iam:UpdateLoginProfile' + - 'iam:UpdateAccessKey' + - 'iam:UpdateSSHPublicKey' + - 'iam:UpdateAccountPasswordPolicy' + - 'iam:CreateSAMLProvider' + - 'iam:CreateVirtualMFADevice' + - 'iam:CreateAccessKey' + - 'iam:AddUserToGroup' + - 'iam:RemoveUserFromGroup' + - 'iam:CreatePolicyVersion' + - 'iam:UploadSigningCertificate' + - 'iam:TagUser' + - 'iam:CreateOpenIDConnectProvider' + - 'iam:UploadServerCertificate' + - 'iam:UntagUser' + - 'iam:UpdateSigningCertificate' + - 'sns:*' + - 'sqs:*' + - 'secretsmanager:*' + - 'acm:*' + - 'kms:*' + - 'cloudfront:*' + - 'route53:*' + - 'route53domains:*' + - 'elasticache:*' + - 'es:*' + - 'ecr:*' + - 'codedeploy:*' + - 'elasticloadbalancing:*' + - 'ecs:*' + - 'servicediscovery:CreatePrivateDnsNamespace' + - 'servicediscovery:CreateService' + - 'servicediscovery:GetNamespace' + - 'servicediscovery:GetOperation' + - 'servicediscovery:GetService' + - 'servicediscovery:ListNamespaces' + - 'servicediscovery:ListServices' + - 'servicediscovery:UpdateService' + - 'servicediscovery:DeleteService' + Effect: Allow + Resource: '*' + CodeBuildRole: + Type: 'AWS::IAM::Role' + Properties: + RoleName: !Sub 'CodeBuildRole-${CodeCommitRepositoryName}' + AssumeRolePolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Principal: + Service: + - codebuild.amazonaws.com + Action: + - 'sts:AssumeRole' + Path: /service-role/ + Policies: + - PolicyName: !Sub 'CodeBuildNestedCFNAccessPolicy-${CodeCommitRepositoryName}' + PolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Action: + - 'cloudformation:Get*' + - 'cloudformation:Describe*' + - 'cloudformation:List*' + Resource: + - '*' + - Effect: Allow + Action: + - 'codebuild:StartBuild' + Resource: + - 'Fn::Sub': >- + arn:aws:codebuild:${AWS::Region}:${AWS::AccountId}:project/* + - Effect: Allow + Action: + - 'codecommit:ListBranches' + - 'codecommit:ListRepositories' + - 'codecommit:BatchGetRepositories' + - 'codecommit:Get*' + - 'codecommit:GitPull' + Resource: + - !Sub >- + arn:aws:codecommit:${AWS::Region}:${AWS::AccountId}:${CodeCommitRepositoryName} + - Effect: Allow + Action: + - 'ec2:*' + - 'cloudformation:ValidateTemplate' + - 'elasticloadbalancing:Describe*' + - 'autoscaling:Describe*' + - 'iam:Get*' + - 'iam:List*' + - 'logs:Describe*' + - 'logs:Get*' + - 'tag:Get*' + - "ecr:*" + - "codedeploy:*" + - "ecs:*" + Resource: + - '*' + - Effect: Allow + Action: + - 'logs:CreateLogGroup' + - 'logs:CreateLogStream' + - 'logs:PutLogEvents' + Resource: + - 'Fn::Sub': >- + arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/* + - Effect: Allow + Action: + - 's3:*' + Resource: '*' + - Effect: Allow + Action: + - 'lambda:UpdateFunctionCode' + - 'lambda:UpdateFunctionConfiguration' + - 'lambda:PublishLayerVersion' + - 'lambda:GetLayerVersion' + Resource: '*' + - Effect: Allow + Action: + - 'apigateway:GET' + - 'apigateway:POST' + Resource: '*' + PipelineRole: + Type: 'AWS::IAM::Role' + Properties: + AssumeRolePolicyDocument: + Statement: + - Action: + - 'sts:AssumeRole' + Effect: Allow + Principal: + Service: + - codepipeline.amazonaws.com + Version: 2012-10-17 + Path: / + Policies: + - PolicyName: !Sub 'CodePipelineAccess-${CodeCommitRepositoryName}' + PolicyDocument: + Version: 2012-10-17 + Statement: + - Action: + - 's3:*' + - 'cloudformation:CreateStack' + - 'cloudformation:DescribeStacks' + - 'cloudformation:DeleteStack' + - 'cloudformation:UpdateStack' + - 'cloudformation:CreateChangeSet' + - 'cloudformation:ExecuteChangeSet' + - 'cloudformation:DeleteChangeSet' + - 'cloudformation:DescribeChangeSet' + - 'cloudformation:SetStackPolicy' + - 'cloudformation:ValidateTemplate' + - 'iam:PassRole' + - 'sns:Publish' + - 'lambda:ListFunctions' + - 'lambda:InvokeFunction' + - 'ec2:Describe*' + - 'ec2:Get*' + - 'ec2:Search*' + - 'ec2:*Vpc*' + - 'ec2:*Gateway' + - 'ec2:*Tags' + - 'ec2:*Subnet*' + - 'ec2:*Route*' + - 'ec2:*SecurityGroup' + - 'ec2:allocate*' + - 'ec2:release*' + Effect: Allow + Resource: '*' + - Action: + - 'codecommit:GetUploadArchiveStatus' + - 'codecommit:CancelUploadArchive' + - 'codecommit:GetBranch' + - 'codecommit:GetCommit' + - 'codecommit:GetUploadStatus' + - 'codecommit:UploadArchive' + Effect: Allow + Resource: '*' + - Effect: Allow + Action: + - 'codebuild:*' + Resource: + - 'Fn::Sub': >- + arn:aws:codebuild:${AWS::Region}:${AWS::AccountId}:project/* -Outputs: - CodeBuildRoleArn: - Description: The ARN of the role used by the CodeBuild projects. - Value: !GetAtt CodeBuildRole.Arn - Export: - Name: !Sub ${Environment}-${CodeCommitRepositoryName}-CodeBuildRoleArn + Outputs: + CodeBuildRoleArn: + Description: The ARN of the role used by the CodeBuild projects. + Value: !GetAtt CodeBuildRole.Arn + Export: + Name: !Sub ${Environment}-${CodeCommitRepositoryName}-CodeBuildRoleArn - CFNRoleArn: - Description: The ARN of the role used by CloudFormation templates run from the automated pipeline. - Value: !GetAtt CFNRole.Arn - Export: - Name: !Sub ${Environment}-${CodeCommitRepositoryName}-CFNRoleArn + CFNRoleArn: + Description: The ARN of the role used by CloudFormation templates run from the automated pipeline. + Value: !GetAtt CFNRole.Arn + Export: + Name: !Sub ${Environment}-${CodeCommitRepositoryName}-CFNRoleArn - PipelineRoleArn: - Description: The ARN of the role used by the application's CodePipeline. - Value: !GetAtt PipelineRole.Arn - Export: - Name: !Sub ${Environment}-${CodeCommitRepositoryName}-PipelineRoleArn + PipelineRoleArn: + Description: The ARN of the role used by the application's CodePipeline. + Value: !GetAtt PipelineRole.Arn + Export: + Name: !Sub ${Environment}-${CodeCommitRepositoryName}-PipelineRoleArn \ No newline at end of file diff --git a/provider/indexer-aws/pom.xml b/provider/indexer-aws/pom.xml index 08083711b6201e8f547746014981cd170d09690f..57afb0c0181d9b85ae1e9b5b4621ca0ded2415c3 100644 --- a/provider/indexer-aws/pom.xml +++ b/provider/indexer-aws/pom.xml @@ -55,7 +55,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-search-core-lib</artifactId> - <version>1.0.11</version> + <version>1.0.14</version> <scope>compile</scope> </dependency>