Integrated cluster into stack
Update pipes Update actions/checkout Fix s3 url
This commit is contained in:
		
							
								
								
									
										4
									
								
								.github/workflows/push_develop.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/push_develop.yml
									
									
									
									
										vendored
									
									
								
							@ -11,7 +11,9 @@ jobs:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checkout Repo
 | 
			
		||||
      uses: actions/checkout@v1
 | 
			
		||||
      uses: actions/checkout@v2.1.0
 | 
			
		||||
      with:
 | 
			
		||||
        submodules: 'true'
 | 
			
		||||
    - name: Ship to S3
 | 
			
		||||
      uses: jakejarvis/s3-sync-action@master
 | 
			
		||||
      with:
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								.github/workflows/push_production.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								.github/workflows/push_production.yml
									
									
									
									
										vendored
									
									
								
							@ -11,7 +11,9 @@ jobs:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checkout Repo
 | 
			
		||||
      uses: actions/checkout@v1
 | 
			
		||||
      uses: actions/checkout@v2.1.0
 | 
			
		||||
      with:
 | 
			
		||||
        submodules: 'true'
 | 
			
		||||
    - name: Ship to S3
 | 
			
		||||
      uses: jakejarvis/s3-sync-action@master
 | 
			
		||||
      with:
 | 
			
		||||
@ -23,3 +25,10 @@ jobs:
 | 
			
		||||
        AWS_S3_BUCKET: sumu-stacks
 | 
			
		||||
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
 | 
			
		||||
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
 | 
			
		||||
    - name: Deploy to AWS CloudFormation
 | 
			
		||||
      uses: aws-actions/aws-cloudformation-github-deploy@v1
 | 
			
		||||
      with:
 | 
			
		||||
        name: ecs-nakama-stack
 | 
			
		||||
        template: top.yaml
 | 
			
		||||
        capabilities: "CAPABILITY_NAMED_IAM,CAPABILITY_IAM"
 | 
			
		||||
        parameter-overrides: VpcId=${{ secrets.VPC_ID }},Domain=${{ secrets.DOMAIN }},SubDomain=nakama,PortalCertificate=${{ secrets.CERTIFICATE_ARN }},PublicSubnets=${{ secrets.SUBNET_IDS }}
 | 
			
		||||
							
								
								
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
[submodule "cloudformation/cluster"]
 | 
			
		||||
	path = cloudformation/cluster
 | 
			
		||||
	url = git@github.com:josephbmanley/aws-cluster-stack.git
 | 
			
		||||
							
								
								
									
										1
									
								
								cloudformation/cluster
									
									
									
									
									
										Submodule
									
								
							
							
								
								
								
								
								
							
						
						
									
										1
									
								
								cloudformation/cluster
									
									
									
									
									
										Submodule
									
								
							 Submodule cloudformation/cluster added at a7d7961c27
									
								
							@ -21,15 +21,16 @@ Parameters:
 | 
			
		||||
  #-------------------
 | 
			
		||||
  # ECS Configuration
 | 
			
		||||
  #-------------------
 | 
			
		||||
  EcsCluster:
 | 
			
		||||
  EcsClusterOverride:
 | 
			
		||||
    Type: String
 | 
			
		||||
    Description: The cluster to run the Nakama service on.
 | 
			
		||||
    Description: The cluster to run the Nakama service on, if empty will create new cluster
 | 
			
		||||
    Default: ""
 | 
			
		||||
  
 | 
			
		||||
  #-----------------
 | 
			
		||||
  # Load Balancing 
 | 
			
		||||
  #-----------------
 | 
			
		||||
  PublicSubnets:
 | 
			
		||||
    Description: The public subnets for the ALB to run in.
 | 
			
		||||
    Description: The public subnets for the ALB to run in. (Seperate by spaces)
 | 
			
		||||
    Type: String
 | 
			
		||||
  PortalCertificate:
 | 
			
		||||
    Description: Arn of AWS Certificate
 | 
			
		||||
@ -111,6 +112,7 @@ Parameters:
 | 
			
		||||
Conditions:
 | 
			
		||||
  CreateRdsStack: !Equals [!Ref CreateDatabase, "true"]
 | 
			
		||||
  CreateDns: !Not [!Equals [!Ref Domain, ""]]
 | 
			
		||||
  CreateCluster: !Equals [!Ref EcsClusterOverride, ""]
 | 
			
		||||
 | 
			
		||||
Resources:
 | 
			
		||||
 | 
			
		||||
@ -154,14 +156,28 @@ Resources:
 | 
			
		||||
  LoadBalancing:
 | 
			
		||||
    Type: AWS::CloudFormation::Stack
 | 
			
		||||
    Properties:
 | 
			
		||||
      TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/${release}/cloudformation/nakama/load_balancing.yaml'
 | 
			
		||||
      TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/nakama/${release}/cloudformation/nakama/load_balancing.yaml'
 | 
			
		||||
      Parameters:
 | 
			
		||||
        environment: !Ref environment
 | 
			
		||||
        release: !Ref release
 | 
			
		||||
        VpcId: !Ref VpcId
 | 
			
		||||
        PublicSubnets: !Ref PublicSubnets
 | 
			
		||||
        PublicSubnets: !Join [",", !Split [" ", !Ref PublicSubnets]]
 | 
			
		||||
        PortalCertificate: !Ref PortalCertificate
 | 
			
		||||
 | 
			
		||||
  #-------------
 | 
			
		||||
  # ECS Cluster
 | 
			
		||||
  #-------------
 | 
			
		||||
  EcsCluster:
 | 
			
		||||
    Condition: CreateCluster
 | 
			
		||||
    Type: AWS::CloudFormation::Stack
 | 
			
		||||
    Properties:
 | 
			
		||||
      TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/nakama/${release}/cloudformation/cluster/top.yaml'
 | 
			
		||||
      Parameters:
 | 
			
		||||
        Environment: !Ref environment
 | 
			
		||||
        VpcId: !Ref VpcId
 | 
			
		||||
        SubnetIds: !Join [",", !Split [" ", !Ref PublicSubnets]]
 | 
			
		||||
        Project: "Nakama"
 | 
			
		||||
 | 
			
		||||
  #-------------------
 | 
			
		||||
  # ECS Task & Service
 | 
			
		||||
  #-------------------
 | 
			
		||||
@ -181,7 +197,7 @@ Resources:
 | 
			
		||||
    DependsOn: LoadBalancing
 | 
			
		||||
    Type: AWS::ECS::Service
 | 
			
		||||
    Properties:
 | 
			
		||||
      Cluster: !Ref EcsCluster
 | 
			
		||||
      Cluster: !If ["CreateCluster", !GetAtt EcsCluster.Outputs.Cluster, !Ref EcsClusterOverride]
 | 
			
		||||
      DesiredCount: 1
 | 
			
		||||
      TaskDefinition: !GetAtt TaskDefinition.Outputs.TaskArn
 | 
			
		||||
      LoadBalancers:  
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user