From 15156c352b8bb716e59c288b1483f7819e1f10b1 Mon Sep 17 00:00:00 2001 From: Khai Do Date: Wed, 3 Jan 2024 10:40:54 -0800 Subject: [PATCH] [IT-3266] Remove bastian hosts Once we setup DB updates from github instances we will no longer need an AWS bastian host for each environment. depends on https://github.com/Sage-Bionetworks/agora-data-manager/pull/116 --- config/agoradev/develop/agora-bastian.yaml | 19 ---- config/agoraprod/prod/agora-bastian.yaml | 19 ---- config/agoraprod/staging/agora-bastian.yaml | 19 ---- templates/bastian.yaml | 108 -------------------- 4 files changed, 165 deletions(-) delete mode 100644 config/agoradev/develop/agora-bastian.yaml delete mode 100644 config/agoraprod/prod/agora-bastian.yaml delete mode 100644 config/agoraprod/staging/agora-bastian.yaml delete mode 100644 templates/bastian.yaml diff --git a/config/agoradev/develop/agora-bastian.yaml b/config/agoradev/develop/agora-bastian.yaml deleted file mode 100644 index 0a7450b..0000000 --- a/config/agoradev/develop/agora-bastian.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Provision an EC2 bastian host for agora -template: - path: bastian.yaml -stack_name: agora-bastian-develop -stack_tags: - Environment: "develop" -dependencies: - - agoradev/develop/agora.yaml - - agoradev/develop/agoravpc.yaml -parameters: - VpcName: "agoravpc" - # Name of an the environment either develop, staging or prod - Environment: "develop" - # Name of an existing VPC subnet to run the instance in - VpcSubnet: "PublicSubnet" - # Name of an existing EC2 KeyPair to enable SSH access to the instance - KeyName: "agora-ci" - # (Optional) ID of the base AMI (supported distros: AWS linux) - AMIId: ami-05b72d008a5718961 # AMI with mongo and synapse tools diff --git a/config/agoraprod/prod/agora-bastian.yaml b/config/agoraprod/prod/agora-bastian.yaml deleted file mode 100644 index 15dbc92..0000000 --- a/config/agoraprod/prod/agora-bastian.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Provision an EC2 bastian host for agora -template: - path: bastian.yaml -stack_name: agora-bastian-prod -stack_tags: - Environment: "prod" -dependencies: - - agoraprod/prod/agora.yaml - - agoraprod/prod/agora-docdb.yaml -parameters: - VpcName: "agoravpc-prod" - # Name of an the environment either develop, staging or prod - Environment: "prod" - # Name of an existing VPC subnet to run the instance in - VpcSubnet: "PublicSubnet" - # Name of an existing EC2 KeyPair to enable SSH access to the instance - KeyName: "agora-ci" - # (Optional) ID of the base AMI (supported distros: AWS linux) - AMIId: ami-05b72d008a5718961 # AMI with mongo and synapse tools diff --git a/config/agoraprod/staging/agora-bastian.yaml b/config/agoraprod/staging/agora-bastian.yaml deleted file mode 100644 index 48529ca..0000000 --- a/config/agoraprod/staging/agora-bastian.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Provision an EC2 bastian host for agora -template: - path: bastian.yaml -stack_name: agora-bastian-staging -stack_tags: - Environment: "staging" -dependencies: - - agoraprod/staging/agoravpc.yaml - - agoraprod/staging/agora-docdb.yaml -parameters: - VpcName: "agoravpc-staging" - # Name of an the environment either develop, staging or prod - Environment: "staging" - # Name of an existing VPC subnet to run the instance in - VpcSubnet: "PublicSubnet" - # Name of an existing EC2 KeyPair to enable SSH access to the instance - KeyName: "agora-ci" - # (Optional) ID of the base AMI (supported distros: AWS linux) - AMIId: ami-05b72d008a5718961 # AMI with mongo and synapse tools diff --git a/templates/bastian.yaml b/templates/bastian.yaml deleted file mode 100644 index 9c6f231..0000000 --- a/templates/bastian.yaml +++ /dev/null @@ -1,108 +0,0 @@ -AWSTemplateFormatVersion: 2010-09-09 -Description: >- - A bastian host, connect to Jumpcloud, and associate with a jumpcloud systems group. -Parameters: - KeyName: - Description: Name of an existing EC2 KeyPair to enable SSH access to the instance - Type: 'AWS::EC2::KeyPair::KeyName' - ConstraintDescription: must be the name of an existing EC2 KeyPair. - Default: "scicomp" - InstanceType: - Description: WebServer EC2 instance type - Type: String - Default: t3.nano - AllowedValues: - - t3.nano - - t3.micro - - t3.small - - t3.medium - - t3.large - ConstraintDescription: must be a valid EC2 instance type. - VpcSubnet: - Description: Name of an existing VPC subnet to run the instance in. - Type: String - Default: PrivateSubnet - ConstraintDescription: >- - Allowed values (PrivateSubnet, PrivateSubnet1, PrivateSubnet2, PublicSubnet, PublicSubnet1, PublicSubnet2) - AllowedValues: - - PrivateSubnet - - PrivateSubnet1 - - PrivateSubnet2 - - PublicSubnet - - PublicSubnet1 - - PublicSubnet2 - VpcName: - Description: Name of an existing VPC to run the instance in. - Type: String - Environment: - Description: The application environment - Type: String - AllowedValues: - - develop - - staging - - prod - AMIId: - Description: ID of the AMI to deploy - Type: AWS::EC2::Image::Id -Conditions: - PublicEc2Resources: !Or [!Equals [ !Ref VpcSubnet, PublicSubnet ], !Equals [ !Ref VpcSubnet, PublicSubnet1 ], !Equals [ !Ref VpcSubnet, PublicSubnet2 ] ] -Resources: - Ec2Instance: - Type: 'AWS::EC2::Instance' - Properties: - ImageId: !Ref AMIId - InstanceType: !Ref InstanceType - KeyName: !Ref KeyName - PropagateTagsToVolumeOnCreation: true - IamInstanceProfile: !Ref InstanceProfile - SubnetId: !ImportValue - 'Fn::Sub': '${AWS::Region}-${VpcName}-${VpcSubnet}' - SecurityGroupIds: - - !ImportValue - 'Fn::Sub': '${AWS::Region}-${VpcName}-BastianSecurityGroup' - - !ImportValue - 'Fn::Sub': '${AWS::Region}-agora-docdb-${Environment}-DocumentDbAccessSecurityGroup' - Tags: - - Key: "ManagedInstanceMaintenanceTarget" - Value: "yes" - - Key: "PatchGroup" - Value: "prod-default" - - InstanceRole: - Type: AWS::IAM::Role - Properties: - Path: / - ManagedPolicyArns: - - "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" - AssumeRolePolicyDocument: - Version: '2012-10-17' - Statement: - - Effect: Allow - Principal: - Service: - - ec2.amazonaws.com - - ssm.amazonaws.com #For maintenance service - Action: - - sts:AssumeRole - - InstanceProfile: - Type: AWS::IAM::InstanceProfile - Properties: - Path: / - Roles: - - !Ref 'InstanceRole' - -Outputs: - Ec2InstanceId: - Value: !Ref Ec2Instance - Export: - Name: !Sub '${AWS::Region}-${AWS::StackName}-Ec2InstanceId' - Ec2InstancePrivateIp: - Value: !GetAtt Ec2Instance.PrivateIp - Export: - Name: !Sub '${AWS::Region}-${AWS::StackName}-Ec2InstancePrivateIp' - Ec2InstancePublicIp: - Condition: PublicEc2Resources - Value: !GetAtt Ec2Instance.PublicIp - Export: - Name: !Sub '${AWS::Region}-${AWS::StackName}-Ec2InstancePublicIp'