Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ghdwlsgur/terraform-vpn-server

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ghdwlsgur/terraform-vpn-server

  • v1.0.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

Stand With Ukraine Codacy Badge

A repository used as a teraform module for govpn.

default file location: /opt/homebrew/lib/govpn/govpn-terraform

How to Use

1. make terraform workspace

# location: govpn-terraform

terraform init
terraform workspace new us-east-1
terraform workspace select us-east-1

The workspace name is the region name.

2. make key.tf file

cat > "./terraform.tfstate.d/us-east-1/key.tf" <<-EOF
resource "tls_private_key" "tls" {
    algorithm = "RSA"
    rsa_bits = 4096
}

resource "aws_key_pair" "govpn_key" {
    key_name = "govpn_us-east-1"
    public_key = tls_private_key.tls.public_key_openssh
}
EOF

3. make main.tf file

cat > "./terraform.tfstate.d/us-east-1/main.tf" <<-EOF
module "instance" {
    source = "../../module/instance"
    aws_region = "us-east-1"
    ec2_ami = "ami-0fc55bd26b303f7a8"
    instance_type = "t2.large"
    availability_zone = "us-east-1a"
    key_name = aws_key_pair.govpn_key.key_name
    private_key_openssh = tls_private_key.tls.private_key_openssh
    private_key_pem = tls_private_key.tls.private_key_pem
}
EOF

choose AMI, Availability_zone, Instance Type

4. make output.tf file

cat > "./terraform.tfstate.d/us-east-1/output.tf" <<-EOF

output "ssh_private_key" {
    value = tls_private_key.tls.private_key_pem
    sensitive = true
}

output "access_key" {
    value = module.instance.OutlineClientAccessKey
}
EOF

5. make provider.tf file

cat > "./terraform.tfstate.d/us-east-1/provider.tf" <<-EOF
provider "aws" {
    region = "us-east-1"
}
EOF

6. terraform apply

# location: govpn-terraform/terraform.tfstate.d/us-east-1

terraform init
terraform plan
terraform apply --auto-approve -lock=false

7. terraform destroy

# location: govpn-terraform/terraform.tfstate.d/us-east-1

terraform destroy --auto-approve -lock=false

8. delete workspace

# location: govpn-terraform

terraform workspace select default
terraform woskspace delete us-east-1

FAQs

Package last updated on 07 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc