Skip to content

Commit 318d736

Browse files
committed
chore: wip
1 parent 8599871 commit 318d736

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

.stacks/core/cloud/src/cloud.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,15 @@ export class StacksCloud extends Stack {
286286
}
287287

288288
manageCompute() {
289+
const vpc = this.vpc
290+
289291
// ECS Cluster
290292
const cluster = new ecs.Cluster(this, 'ECSCluster', {
291293
clusterName: `${this.appName}-${appEnv}-ecs-cluster`,
292294
containerInsights: true,
293-
vpc: this.vpc,
295+
vpc,
294296
})
295297

296-
const vpc = this.vpc
297-
298298
// ECS Task Execution Role
299299
const ecsTaskExecutionRole = new iam.Role(this, 'ECSTaskExecutionRole', {
300300
assumedBy: new iam.ServicePrincipal('ecs-tasks.amazonaws.com'),
@@ -329,7 +329,6 @@ export class StacksCloud extends Stack {
329329
vpc,
330330
internetFacing: true,
331331
securityGroup,
332-
333332
})
334333

335334
const listener = loadBalancer.addListener('PublicLoadBalancerListener', {
@@ -340,7 +339,7 @@ export class StacksCloud extends Stack {
340339
// Target Group
341340
const targetGroup = new elbv2.ApplicationTargetGroup(this, 'ServiceTargetGroup', {
342341
vpc,
343-
port: 3000,
342+
port: 80,
344343
protocol: elbv2.ApplicationProtocol.HTTP,
345344
targetType: elbv2.TargetType.IP,
346345
healthCheck: {
@@ -370,7 +369,7 @@ export class StacksCloud extends Stack {
370369
targetGroups: [targetGroup],
371370
})
372371

373-
service.connections.allowFrom(loadBalancer, ec2.Port.allTraffic())
372+
service.connections.allowFrom(loadBalancer, ec2.Port.allTraffic(), 'Load Balancer access to ECS Service')
374373

375374
const table = new dynamodb.Table(this, 'HitCounters', {
376375
partitionKey: { name: 'counter', type: dynamodb.AttributeType.STRING },
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "stacks-cloud",
3+
"type": "module",
4+
"dependencies": {
5+
"@aws-sdk/client-dynamodb": "^3.433.0",
6+
"@aws-sdk/lib-dynamodb": "^3.433.0",
7+
"@smithy/smithy-client": "^2.1.3"
8+
}
9+
}

.stacks/core/cloud/src/server/publish.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
REPO_URI=$(aws ecr create-repository --repository-name stacks-bun-hitcounter --query 'repository.repositoryUri' --output text)
1+
REPO_URI=$(aws ecr create-repository --repository-name stacks-bun-hitcounter --query 'repository.repositoryUri' --output text --profile stacks)
22
docker build -t $REPO_URI .
33
docker push $REPO_URI

config/cloud.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export default {
3636
api: false, // enables api
3737
fileSystem: true, // enables file system
3838
},
39+
40+
// compute: {},
41+
3942
// queues: false,
4043
// queue-concurrency: 50
4144
} satisfies CloudConfig

0 commit comments

Comments
 (0)