forked from newcontext-oss/opencti-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request newcontext-oss#17 from newcontext-oss/refactor
standardized, improved documentation
- Loading branch information
Showing
18 changed files
with
86 additions
and
111 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 |
---|---|---|
|
@@ -15,21 +15,23 @@ cd aws/ | |
Before you get going, there are a some variables you will probably want to set. All of these can be found in `aws/terraform.tfvars`: | ||
- `allowed_ips_application`: Array containing each of the IPs that are allowed to access the web application. Default `0.0.0.0/0` all IPs. | ||
- `availability_zone`: The AWS availability zone. Default `us-east-1a`. | ||
- `instance_type`: The AWS instance type to use. Default `t3.2xlarge` (8x32). | ||
- `login_email`: The e-mail address used to login to the application. Default `[email protected]`. | ||
- `region`: The AWS region used. Default `us-east`. **NOTE:** if you change this, you will need to change the remote state region in `aws/main.tf`. Variable interpolation is not allowed in that block so it has to be hardcoded. | ||
- `root_volume_size`: The root volume size for the EC2 instance. Without this, the volume is 7.7GB and fills up in a day. Default `32` (GB). Note that this will incur costs. | ||
- `storage_bucket`: The name of the S3 bucket to store scripts and remote state in. Default `opencti-storage`. | ||
- `subnet_id`: The AWS subnet to use. No default specified. | ||
- `vpc_id`: The VPC to use. No default specified. | ||
|
||
If your AWS credentials are not stored in `~/.aws/credentials`, you will need to edit that line in `aws/main.tf`. | ||
|
||
#### Remote state | ||
The remote state is defined in `aws/main.tf`. Variable interpolation is not allowed in that block and the easiest choice (both for writing the code and for you using the code) was to pick sensible defaults and hardcode them. The variables are: | ||
- `bucket`: The name of the S3 bucket to store the state file in. Default `opencti-storage`. | ||
- `key`: The name of the state file. Default `terraform_state`. | ||
- `region`: The region to use. Default `us-east-1`. | ||
- `storage_bucket`: The name of the S3 bucket to store the state file in. Default `opencti-storage`. | ||
|
||
This is mentioned as an FYI for the end user, but if you change the region in `aws/terraform.tfvars`, you will want to change the region here, too. If you want to change the S3 bucket name (defined as a local variable in `aws/main.tf`), you will also want to change it here. | ||
**Important:** If you change the region in `aws/terraform.tfvars`, you will want to change the region here, too. If you want to change the S3 bucket name (defined in `aws/terraform.tfvars`), you will also want to change it here. | ||
|
||
### Azure | ||
First, change into the `azure/` directory: | ||
|
@@ -45,6 +47,7 @@ Before you deploy, you may wish to change some of the settings. These are all in | |
- `location`: The Azure region to deploy in. Default `eastus`. | ||
- `login_email`: The e-mail address used to login to the OpenCTI web frontend. Default `[email protected]`. | ||
- `os_disk_size`: The VM's disk size (in GB). Default `32` (the [minimum recommended spec](https://github.com/OpenCTI-Platform/opencti/blob/5ede2579ee3c09c248d2111b483560f07d2f2c18/opencti-documentation/docs/getting-started/requirements.md)). | ||
- `storage_bucket`: Name of the storage bucket for storing scripts. Default `opencti-storage`. | ||
|
||
### GCP | ||
Change into the `gcp/` directory: | ||
|
This file was deleted.
Oops, something went wrong.
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
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,7 +1,9 @@ | ||
# allowed_ips_application = ["0.0.0.0/0"] | ||
# availability_zone = "us-east-1a" | ||
# instance_type = "t3.2xlarge" | ||
# login_email = "[email protected]" | ||
# region = "us-east-1" | ||
# root_volume_size = 32 | ||
# storage_bucket = "opencti-storage" | ||
subnet_id = "" | ||
vpc_id = "" |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# EC2 Instance | ||
resource "aws_instance" "opencti_instance" { | ||
ami = local.ami_id | ||
instance_type = var.instance_type | ||
|
||
associate_public_ip_address = true | ||
iam_instance_profile = aws_iam_instance_profile.opencti_profile.name | ||
root_block_device { | ||
volume_size = var.root_volume_size | ||
} | ||
subnet_id = var.subnet_id | ||
|
||
# The wrapper script is used by each of the providers and each variable has to be filled out in order to run. Unfortunately, this means that if you change something in one provider, you have to change it in each of the others. It's not ideal, but FYI. | ||
user_data = templatefile("../userdata/installation-wrapper-script.sh", { | ||
account_name = "only for azure", | ||
cloud = "aws", | ||
connection_string = "only for azure", | ||
connectors_script_name = local.opencti_connectors_script_name, | ||
install_script_name = local.opencti_install_script_name, | ||
login_email = var.login_email, | ||
storage_bucket = var.storage_bucket | ||
}) | ||
|
||
vpc_security_group_ids = [aws_security_group.opencti_sg.id] | ||
|
||
tags = { | ||
Name = "opencti" | ||
} | ||
} |
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,5 +1,6 @@ | ||
account_name = "" | ||
account_name = "Pay-As-You-Go" | ||
# admin_user = "azureuser" | ||
# location = "eastus" | ||
login_email = "[email protected]" | ||
# os_disk_size = 32 | ||
# storage_bucket = "opencti" |
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
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
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
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