Skip to content

Commit

Permalink
Update example scenario (#226)
Browse files Browse the repository at this point in the history
* Formatting and types

* Adding an analytics parameter

* Add providers & versions

* undo analytic source
  • Loading branch information
andrew-aiken authored Jan 26, 2024
1 parent 532bd4b commit 3316cff
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 25 deletions.
17 changes: 11 additions & 6 deletions core/terraform/example-scenario/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
#Required: Always output the AWS Account ID
output "cloudgoat_output_aws_account_id" {
value = "${data.aws_caller_identity.aws-account-id.account_id}"
value = data.aws_caller_identity.current.account_id
}
#Example: IAM User Credentials

#Example: IAM User Access Key
output "cloudgoat_output_johnsmith_access_key_id" {
value = "${aws_iam_access_key.cg-johnsmith.id}"
value = aws_iam_access_key.cg_johnsmith.id
}

#Example: IAM User Secret Key
output "cloudgoat_output_johnsmith_secret_key" {
value = "${aws_iam_access_key.cg-johnsmith.secret}"
value = aws_iam_access_key.cg_johnsmith.secret
}

#Example: output for an SSH key
output "cloudgoat_output_ssh_keyname" {
value = "An SSH key-pair named ${var.ssh-key-name} has been generated stored in this directory."
value = "An SSH key-pair named ${var.ssh_public_key} has been generated stored in this directory."
}

#Example: Always output any important URLs, IPs, or other such infromation
output "cloudgoat_output_load_balancer_url" {
value = "${aws_lb.cg-lb.dns_name}"
value = aws_lb.cg_lb.dns_name
}
18 changes: 18 additions & 0 deletions core/terraform/example-scenario/terraform/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
# Minimum Terraform version
required_version = ">= 1.5"

# Minimum AWS provider version
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0.0"
}
}
}

# Specify what region and credentials to use
provider "aws" {
profile = var.profile
region = var.region
}
57 changes: 38 additions & 19 deletions core/terraform/example-scenario/terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,33 +1,52 @@
#Required: AWS Profile
#Required
variable "profile" {

description = "The AWS profile to use"
type = string
}
#Required: AWS Region

#Required
variable "region" {
default = "us-east-1"
type = string
}
#Required: CGID Variable for unique naming
variable "cgid" {

#Required
variable "cgid" {
description = "CGID variable for unique naming"
type = string
}
#Required: User's Public IP Address(es)

#Required
variable "cg_whitelist" {
type = list
description = "User's public IP address(es)"
default = ["0.0.0.0/0"]
type = list(string)
}

#Example
variable "rds_username" {
description = "RDS PostgreSQL Instance Username"
default = "cgadmin"
type = string
}

#Example: RDS PostgreSQL Instance Credentials
variable "rds-username" {
default = "cgadmin"
#Example
variable "rds_password" {
description = "RDS PostgreSQL Instance Password"
default = "Purplepwny2029"
type = string
}
variable "rds-password" {
default = "Purplepwny2029"

#Example
variable "ssh_public_key" {
description = "SSH Public Key"
default = "../cloudgoat.pub"
type = string
}
#Example: SSH Public Key
variable "ssh-public-key-for-ec2" {
default = "../cloudgoat.pub"

#Example
variable "ssh_private_key" {
description = "SSH Private Key"
default = "../cloudgoat"
type = string
}
#Example: SSH Private Key
variable "ssh-private-key-for-ec2" {
default = "../cloudgoat"
}

0 comments on commit 3316cff

Please sign in to comment.