forgejo-deployment/infra/cfn/forgejo-network.yaml
Daisuke 8140c89e3a chore(infra/cfn): add Forgejo network CloudFormation resources
Add EFS MountTargets (two subnets), an ALB Target Group for Forgejo (port 3000, health
checks), and a Listener Rule for host git.n-daisuke897.com; export the TargetGroup ARN. No
application-level configuration changes.
2026-01-02 18:16:57 +09:00

87 lines
2.3 KiB
YAML

AWSTemplateFormatVersion: "2010-09-09"
Resources:
EFSMountTarget0:
UpdateReplacePolicy: "Delete"
Type: "AWS::EFS::MountTarget"
DeletionPolicy: "Delete"
Properties:
SecurityGroups:
- "sg-0201d595f634128ba"
FileSystemId:
!ImportValue forgejo-efs-EFSFileSystemId
SubnetId: "subnet-004fa7ef9de2dfb34"
EFSMountTarget1:
UpdateReplacePolicy: "Delete"
Type: "AWS::EFS::MountTarget"
DeletionPolicy: "Delete"
Properties:
SecurityGroups:
- "sg-0201d595f634128ba"
FileSystemId:
!ImportValue forgejo-efs-EFSFileSystemId
SubnetId: "subnet-064c8fcfd627077ef"
ElasticLoadBalancingV2TargetGroupForgejo:
UpdateReplacePolicy: "Delete"
Type: "AWS::ElasticLoadBalancingV2::TargetGroup"
DeletionPolicy: "Delete"
Properties:
IpAddressType: "ipv4"
HealthCheckIntervalSeconds: 30
Matcher:
HttpCode: "200"
HealthCheckPath: "/"
Port: 3000
HealthCheckEnabled: true
ProtocolVersion: "HTTP1"
UnhealthyThresholdCount: 2
HealthCheckTimeoutSeconds: 5
Name: "forgejo-tg"
VpcId: "vpc-0b056d88428fb2a6a"
HealthyThresholdCount: 5
HealthCheckProtocol: "HTTP"
TargetType: "ip"
HealthCheckPort: "traffic-port"
Protocol: "HTTP"
Tags:
- Value: "Git-server"
Key: "Project"
ElasticLoadBalancingV2ListenerRuleForgejo:
UpdateReplacePolicy: "Delete"
Type: "AWS::ElasticLoadBalancingV2::ListenerRule"
DeletionPolicy: "Delete"
Properties:
Actions:
- Order: 1
TargetGroupArn:
Ref: "ElasticLoadBalancingV2TargetGroupForgejo"
Type: "forward"
ForwardConfig:
TargetGroupStickinessConfig:
Enabled: false
DurationSeconds: 3600
TargetGroups:
- TargetGroupArn:
Ref: "ElasticLoadBalancingV2TargetGroupForgejo"
Weight: 1
Priority: 1
Conditions:
- Values:
- "git.n-daisuke897.com"
HostHeaderConfig:
Values:
- "git.n-daisuke897.com"
Field: "host-header"
Transforms: []
Outputs:
TargetGroupArn:
Description: ARN of the Forgejo target group
Value: !Ref ElasticLoadBalancingV2TargetGroupForgejo
Export:
Name: !Sub "${AWS::StackName}-TargetGroupArn"