Skip to content

Commit 933a31c

Browse files
committed
one-in-all ami
1 parent 64c254e commit 933a31c

File tree

1 file changed

+7
-55
lines changed

1 file changed

+7
-55
lines changed

cloudformation/template-1.5.0.yaml

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -127,32 +127,14 @@ Parameters:
127127
- warn
128128
- error
129129
Description: Log level for Defguard Gateway component
130-
DefguardCoreAmiId:
130+
DefguardAmiId:
131131
Type: String
132-
Description: (Optional) Custom AMI ID for Defguard Core instance. If not provided, a default AMI will be used based on the region.
133-
Default: "ami-089e02a9b43e74615"
132+
Description: AMI ID for Defguard.
133+
Default: "ami-01465cbd3f45f7cef"
134134
SshKeyName:
135135
Type: String
136136
Description: (Optional) EC2 Key Pair name for SSH access to instances. If not provided, SSH access will not be available. Requires a manual setup of SSH security group rules afterwards.
137137
Default: ""
138-
DefguardProxyVersion:
139-
Type: String
140-
Default: "1.5.0"
141-
Description: Version of Defguard Proxy package to install
142-
DefguardGatewayVersion:
143-
Type: String
144-
Default: "1.5.0"
145-
Description: Version of Defguard Gateway package to install
146-
Mappings:
147-
AmiMap:
148-
us-east-1:
149-
debian: ami-0702a3ce7f850fb87
150-
ap-northeast-1:
151-
debian: ami-023c12e6d24e0a6df
152-
eu-west-1:
153-
debian: ami-04034bfd5da1fa2ed
154-
eu-central-1:
155-
debian: ami-0aeb8600ead64c406
156138
Conditions:
157139
UseSshKey: !Not [!Equals [!Ref SshKeyName, ""]]
158140
Resources:
@@ -458,7 +440,7 @@ Resources:
458440
CoreInstance:
459441
Type: AWS::EC2::Instance
460442
Properties:
461-
ImageId: !Ref DefguardCoreAmiId
443+
ImageId: !Ref DefguardAmiId
462444
InstanceType: !Ref CoreInstanceType
463445
KeyName: !If [UseSshKey, !Ref SshKeyName, !Ref "AWS::NoValue"]
464446
NetworkInterfaces:
@@ -532,10 +514,7 @@ Resources:
532514
ProxyInstance:
533515
Type: AWS::EC2::Instance
534516
Properties:
535-
ImageId: !FindInMap
536-
- AmiMap
537-
- !Ref AWS::Region
538-
- debian
517+
ImageId: !Ref DefguardAmiId
539518
InstanceType: !Ref ProxyInstanceType
540519
KeyName: !If [UseSshKey, !Ref SshKeyName, !Ref "AWS::NoValue"]
541520
NetworkInterfaces:
@@ -553,18 +532,6 @@ Resources:
553532
}
554533

555534
(
556-
log "Updating apt repositories..."
557-
apt update
558-
559-
log "Installing curl..."
560-
apt install -y curl
561-
562-
log "Downloading defguard-proxy package..."
563-
curl -fsSL -o /tmp/defguard-proxy.deb https://github.com/Defguard/proxy/releases/download/v${DefguardProxyVersion}/defguard-proxy-${DefguardProxyVersion}-x86_64-unknown-linux-gnu.deb
564-
565-
log "Installing defguard-proxy package..."
566-
dpkg -i /tmp/defguard-proxy.deb
567-
568535
log "Writing proxy configuration to /etc/defguard/proxy.toml..."
569536
mkdir -p /etc/defguard
570537
tee /etc/defguard/proxy.toml <<EOF
@@ -594,10 +561,7 @@ Resources:
594561
GatewayInstance:
595562
Type: AWS::EC2::Instance
596563
Properties:
597-
ImageId: !FindInMap
598-
- AmiMap
599-
- !Ref AWS::Region
600-
- debian
564+
ImageId: !Ref DefguardAmiId
601565
InstanceType: !Ref GatewayInstanceType
602566
KeyName: !If [UseSshKey, !Ref SshKeyName, !Ref "AWS::NoValue"]
603567
NetworkInterfaces:
@@ -620,22 +584,10 @@ Resources:
620584
}
621585
622586
(
623-
log "Updating apt repositories..."
624-
apt update
625-
626-
log "Installing curl..."
627-
apt install -y curl
628-
629-
log "Downloading defguard-gateway package..."
630-
curl -fsSL -o /tmp/defguard-gateway.deb https://github.com/Defguard/gateway/releases/download/v${DefguardGatewayVersion}/defguard-gateway_${DefguardGatewayVersion}_x86_64-unknown-linux-gnu.deb
631-
632-
log "Installing defguard-gateway package..."
633-
dpkg -i /tmp/defguard-gateway.deb
634-
635587
log "Generating gateway token..."
636588
NETWORK_ID="1"
637589
SECRET="${GeneratedGatewaySecret.GatewaySecret}"
638-
ISSUER="Defguard"
590+
ISSUER="DefGuard"
639591
640592
HEADER='{"alg":"HS256","typ":"JWT"}'
641593
NOW=$(date +%s)

0 commit comments

Comments
 (0)