Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IT-3184] Fix nextflow Elasticache setup #251

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/infra-dev/nextflow-elasticache-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ dependencies:

parameters:
VpcId: !stack_output_external nextflow-vpc::VPCId
SubnetId: !stack_output_external nextflow-ecs-cluster::EcsAutoScalingGroupSubnetId
VpcSubnetIDs:
- !stack_output_external nextflow-vpc::PrivateSubnet1
- !stack_output_external nextflow-vpc::PrivateSubnet2
- !stack_output_external nextflow-vpc::PrivateSubnet3
EcsSecurityGroupId: !stack_output_external nextflow-ecs-security-group::SecurityGroupId

stack_tags:
Expand Down
33 changes: 15 additions & 18 deletions templates/nextflow-elasticache-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Parameters:
Description: ID of VPC
Type: AWS::EC2::VPC::Id

VpcSubnetIDs:
Description: The VPC subnet IDs.
Type: List<AWS::EC2::Subnet::Id>

EcsSecurityGroupId:
Type: AWS::EC2::SecurityGroup::Id
Description: Security group ID for ECS cluster to grant database access

SubnetId:
Description: The ID of the ECS subnet group.
Type: String

Resources:
ElasticacheSecurityGroup:
Type: 'AWS::EC2::SecurityGroup'
Expand All @@ -24,29 +24,23 @@ Resources:
IpProtocol: tcp
FromPort: 6379
ToPort: 6379
ElasticacheSubnetGroup:
Type: AWS::ElastiCache::SubnetGroup
Properties:
Description: Elasticache subnet group
SubnetIds: !Ref VpcSubnetIDs
ElasticacheCluster:
Type: AWS::ElastiCache::CacheCluster
Properties:
CacheNodeType: cache.r6gd.xlarge
CacheNodeType: cache.r6g.large
Engine: redis
NumCacheNodes: '1'
TransitEncryptionEnabled: true
NumCacheNodes: "1"
VpcSecurityGroupIds:
- !GetAtt ElasticacheSecurityGroup.GroupId
CacheSubnetGroupName: !Ref SubnetId
CacheSubnetGroupName: !Ref ElasticacheSubnetGroup

Outputs:

ElasticacheClusterEndpointAddress:
Value: !GetAtt ElasticacheCluster.ConfigurationEndpoint.Address
Export:
Name: !Sub '${AWS::Region}-${AWS::StackName}-ElasticacheClusterEndpointAddress'

ElasticacheClusterEndpointPort:
Value: !GetAtt ElasticacheCluster.ConfigurationEndpoint.Port
Export:
Name: !Sub '${AWS::Region}-${AWS::StackName}-ElasticacheClusterEndpointPort'

RedisEndpointAddress:
Value: !GetAtt ElasticacheCluster.RedisEndpoint.Address
Export:
Expand All @@ -56,3 +50,6 @@ Outputs:
Value: !GetAtt ElasticacheCluster.RedisEndpoint.Port
Export:
Name: !Sub '${AWS::Region}-${AWS::StackName}-RedisEndpointPort'

RedisEndpoint:
Value: !Sub 'redis://${ElasticacheCluster.RedisEndpoint.Address}:${ElasticacheCluster.RedisEndpoint.Port}'