From 8f26ce1dcc72c2907f2ec811eb35ec7b2cdd58fa Mon Sep 17 00:00:00 2001 From: Veetaha Date: Fri, 21 Mar 2025 11:10:29 +0000 Subject: [PATCH 1/2] Add a link to Cloudmith registry --- README.md | 13 ++++++++++++- asset-account/terraform/stack-set/README.md | 14 ++++++++++++++ .../stack-set/examples/self-managed/admin.tf | 10 +++++++--- .../stack-set/examples/service-managed/main.tf | 9 ++++++--- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 72d15c0..b07bd42 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ # Elastio Stack -This repository contains necessary code to deploy the resources of elastio scanning solution in your cloud account (currently only AWS is supported). +This repository contains necessary IaC code to deploy the resources of elastio scanning solution in your cloud account. + +## Configure the Elastio Terraform Modules Registry + +Elastio terraform modules are published to the public Cloudsmith registry. In order to use them from that registry add this to your [`.terraformrc`](https://developer.hashicorp.com/terraform/cli/config/config-file), which should reside in your home directory (if you are on Linux): + + +```hcl +credentials "terraform.cloudsmith.io" { + token = "elastio/public/" +} +``` diff --git a/asset-account/terraform/stack-set/README.md b/asset-account/terraform/stack-set/README.md index d1a38ae..0383280 100644 --- a/asset-account/terraform/stack-set/README.md +++ b/asset-account/terraform/stack-set/README.md @@ -5,5 +5,19 @@ See [this README](../..) for more details on what this stack does. This is a Terraform module, that is a thin wrapper on top of an [`aws_cloudformation_stack_set`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set) and [`aws_cloudformation_stack_instances`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_instances) resources used to deploy the Elastio Asset Account stack. See the `examples` directory for some examples of how this module can be used: + - `self-managed` - deploy the stack set using the [self-managed permission model](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create-self-managed.html) - `service-managed` - deploy the stack set using the [service-managed permission model](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-associate-stackset-with-org.html) + +## Installation + +[Configure](../../../README.md#configuring-the-terraform-modules-registry) the Elastio terraform module registry, and add this to your project: + +```tf +module "elastio_asset_account" { + source = "terraform.cloudsmith.io/public/elastio-asset-account-stack-set/aws" + version = "0.33.0" + + // Provide input parameters +} +``` diff --git a/asset-account/terraform/stack-set/examples/self-managed/admin.tf b/asset-account/terraform/stack-set/examples/self-managed/admin.tf index c9c821e..934a007 100644 --- a/asset-account/terraform/stack-set/examples/self-managed/admin.tf +++ b/asset-account/terraform/stack-set/examples/self-managed/admin.tf @@ -1,6 +1,10 @@ -module "elastio_asset_accounts" { - # Use the link from the real terraform registry here. Relative path is used for testing purposes. - source = "../../" +module "elastio_asset_account" { + source = "terraform.cloudsmith.io/public/elastio-asset-account-stack-set/aws" + version = "0.33.0" + + # For testing purposes + # source = "../../" + providers = { aws = aws.admin } diff --git a/asset-account/terraform/stack-set/examples/service-managed/main.tf b/asset-account/terraform/stack-set/examples/service-managed/main.tf index 9d85a5e..dc7d8f2 100644 --- a/asset-account/terraform/stack-set/examples/service-managed/main.tf +++ b/asset-account/terraform/stack-set/examples/service-managed/main.tf @@ -1,6 +1,9 @@ -module "elastio_asset_accounts" { - # Use the link from the real terraform registry here. Relative path is used for testing purposes. - source = "../../" +module "elastio_asset_account" { + source = "terraform.cloudsmith.io/public/elastio-asset-account-stack-set/aws" + version = "0.33.0" + + # For testing purposes + # source = "../../" template_url = var.template_url From 0ea31866e058a373a247943ef878287aefc7a2ea Mon Sep 17 00:00:00 2001 From: Veetaha Date: Fri, 21 Mar 2025 11:12:01 +0000 Subject: [PATCH 2/2] Use the local path anyway --- .../terraform/stack-set/examples/self-managed/admin.tf | 6 +----- .../terraform/stack-set/examples/service-managed/main.tf | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/asset-account/terraform/stack-set/examples/self-managed/admin.tf b/asset-account/terraform/stack-set/examples/self-managed/admin.tf index 934a007..fde1c27 100644 --- a/asset-account/terraform/stack-set/examples/self-managed/admin.tf +++ b/asset-account/terraform/stack-set/examples/self-managed/admin.tf @@ -1,9 +1,5 @@ module "elastio_asset_account" { - source = "terraform.cloudsmith.io/public/elastio-asset-account-stack-set/aws" - version = "0.33.0" - - # For testing purposes - # source = "../../" + source = "../../" providers = { aws = aws.admin diff --git a/asset-account/terraform/stack-set/examples/service-managed/main.tf b/asset-account/terraform/stack-set/examples/service-managed/main.tf index dc7d8f2..102149f 100644 --- a/asset-account/terraform/stack-set/examples/service-managed/main.tf +++ b/asset-account/terraform/stack-set/examples/service-managed/main.tf @@ -1,9 +1,5 @@ module "elastio_asset_account" { - source = "terraform.cloudsmith.io/public/elastio-asset-account-stack-set/aws" - version = "0.33.0" - - # For testing purposes - # source = "../../" + source = "../../" template_url = var.template_url