-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into health-status-agent-v2
- Loading branch information
Showing
23 changed files
with
364 additions
and
62 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 @@ | ||
hermit |
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 @@ | ||
.aws-iam-authenticator-0.5.12.pkg |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
*.tfplan | ||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Exclude all .tfvars files, which are likely to contain sentitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
*.tfvars | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc |
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,40 +1,74 @@ | ||
# Cloud Deployment | ||
|
||
**Motivation** | ||
Provide an easy and deterministic way to setup latest cloud environment so it can be monitored and used properly. | ||
**Motivation** | ||
Provide an easy and deterministic way to set up latest cloud environment, so it can be monitored and used properly. | ||
|
||
This guide deploys both an Elastic cloud environment, and an AWS EKS cluster. To only deploy specific resources, check out the examples section. | ||
|
||
**Prerequisite** | ||
* [terraform](https://www.terraform.io/) | ||
* [Terraform](https://developer.hashicorp.com/terraform/downloads) | ||
* the AWS CLI, [installed](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and [configured](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) | ||
* [AWS IAM Authenticator](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html) | ||
* the [Kubernetes CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/), also known as `kubectl` | ||
|
||
|
||
**How To** | ||
Create environment | ||
1. Create an [API token](https://cloud.elastic.co/deployment-features/keys) from your cloud console account. | ||
|
||
1.1 use the token `export EC_API_KEY={TOKEN}` | ||
|
||
2. run `cd deploy/cloud` | ||
3. run `terraform init` | ||
4. run `terraform apply --auto-approve` to create the environment from the latest version (the latest version is vary in cloud/regions combinations). | ||
To connect to the environment use the console ui or see the details how to connect to the environment, use `terraform output -json` | ||
2. to create the environment from the latest version (the latest version is varying in cloud/regions combinations). | ||
```bash | ||
cd deploy/cloud | ||
terraform init | ||
terraform apply --auto-approve | ||
3. Run the following command to retrieve the access credentials for your EKS cluster and configure kubectl. | ||
```bash | ||
aws eks --region $(terraform output -raw eks_region) update-kubeconfig \ | ||
--name $(terraform output -raw eks_cluster_name) | ||
Delete environment | ||
1. `terraform destroy --auto-approve` | ||
To connect to the environment use the console UI or see the details how to connect to the environment, using: | ||
```bash | ||
terraform output -json | ||
**Delete environment:** | ||
```bash | ||
terraform destroy --auto-approve | ||
**Next Steps** | ||
* [Setup](https://github.com/elastic/security-team/blob/main/docs/cloud-security-posture-team/onboarding/deploy-agent-cloudbeat-on-eks.mdx) EKS cluster | ||
* Setup Vanila cluster | ||
* Enable rules add slack webhook to connctor | ||
* Setup Self-Managed cluster | ||
* Enable rules add slack webhook to connector | ||
# Examples | ||
## Specific version | ||
To create an environment with specific version use | ||
To create an environment with specific version use | ||
`terraform apply --auto-approve -var="stack_version=8.5.1"` | ||
When working with non production versions it is required to also update the deployment regions. | ||
For example, to deploy `8.6.0-SNAPSHOT` use | ||
For example, to deploy `8.6.0-SNAPSHOT` use | ||
`terraform apply --auto-approve -var="stack_version=8.6.0-SNAPSHOT" -var="ess_region=gcp-us-west2"` | ||
## Named environment | ||
To give your environment a different prefix in the name use | ||
To give your environment a different prefix in the name use | ||
`terraform apply --auto-approve -var="deployment_name_prefix=elastic-deployment"` | ||
## Deploy specific resources | ||
To deploy specific resources use the `-target` flag. | ||
### Deploy only Elastic Cloud with no EKS cluster or Dashboard | ||
`terraform apply --auto-approve -target "module.ec_deployment"` | ||
### Deploy only Dashboard on an existing Elastic Cloud deployment | ||
`terraform apply --auto-approve -target "null_resource.rules" -target "null_resource.store_local_dashboard"` | ||
### Deploy only EKS cluster | ||
`terraform apply --auto-approve -target "module.eks"` |
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 @@ | ||
Based on the [Provision an EKS Cluster tutorial](https://developer.hashicorp.com/terraform/tutorials/kubernetes/eks), and [repo](https://github.com/hashicorp/learn-terraform-provision-eks-cluster). |
Oops, something went wrong.