Introduce dedicated CloudFormation templates for Forgejo networking (EFS mount targets, ALB target group and listener rule) and S3 storage, including bucket creation and scoped access policy.
79 lines
2.1 KiB
YAML
79 lines
2.1 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: []
|