generated from cloudposse/terraform-example-module
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## what * Allows extra arguments to be passed to the Tailscale daemon and/or the `tailscale up` command. * Prints additional info in user data * Adds some `trivy` ignore rules. ## why * These extra args were added as a part of my work for ephemeral node support. Eventually, we don't need this for our case, but it would be nice to have in terms of long term maintainability. ## references * N/A
- Loading branch information
Showing
6 changed files
with
133 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# `release-please` doesn't generate prettier compliant output, see relevant issues: | ||
# https://github.com/googleapis/release-please/issues/1902 | ||
# https://github.com/googleapis/release-please/issues/1802 | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Log group is not encrypted | ||
AVD-AWS-0017 | ||
|
||
# Bucket does not have versioning enabled | ||
AVD-AWS-0090 | ||
|
||
# Bucket does not encrypt data with a customer managed key | ||
AVD-AWS-0132 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,40 @@ | ||
#!/bin/bash -ex | ||
exec > >(tee /var/log/user-data.log | logger -t user-data -s 2>/dev/console) 2>&1 | ||
|
||
# Enable ip_forward to allow advertising routes | ||
echo "Starting user-data script..." | ||
|
||
echo "Enabling IP forwarding..." | ||
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf | ||
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf | ||
sudo sysctl -p /etc/sysctl.conf | ||
|
||
# Install tailscale | ||
echo "Installing Tailscale..." | ||
sudo yum install -y yum-utils | ||
sudo yum-config-manager --add-repo https://pkgs.tailscale.com/stable/amazon-linux/2/tailscale.repo | ||
sudo yum install -y tailscale | ||
|
||
%{ if tailscaled_extra_flags_enabled == true } | ||
echo "Exporting FLAGS to environment variable..." | ||
export FLAGS=${tailscaled_extra_flags}% | ||
%{ endif } | ||
|
||
# Setup tailscale | ||
echo "Enabling and starting tailscaled service..." | ||
sudo systemctl enable --now tailscaled | ||
|
||
# Wait a few for tailscaled to come up | ||
echo "Waiting for tailscaled to initialize..." | ||
sleep 5 | ||
|
||
# Start tailscale | ||
# We pass --advertise-tags below even though the authkey being created with those tags should result | ||
# in the same effect. This is to be more explicit because tailscale tags are a complicated topic. | ||
sudo tailscale up \ | ||
%{ if ssh_enabled == true }--ssh%{ endif } \ | ||
%{ if exit_node_enabled == true }--advertise-exit-node%{ endif } \ | ||
%{ if tailscale_up_extra_flags_enabled == true }${tailscale_up_extra_flags}%{ endif } \ | ||
--advertise-routes=${routes} \ | ||
--advertise-tags=${tags} \ | ||
--authkey=${authkey} \ | ||
--hostname=${hostname}%{ if ssh_enabled == true } --ssh%{ endif }%{ if exit_node_enabled == true } --advertise-exit-node%{ endif } | ||
--hostname=${hostname} \ | ||
--authkey=${authkey} | ||
|
||
echo "Tailscale setup completed." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters