-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TME-2307: add support for existing trail with x-account resources (#46)
- Loading branch information
1 parent
47b5dc2
commit d3270e1
Showing
19 changed files
with
326 additions
and
67 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
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
File renamed without changes.
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,75 @@ | ||
variable "region" { | ||
type = string | ||
} | ||
|
||
variable "expel_customer_organization_guid" { | ||
description = "Use your organization GUID assigned to you by Expel. You can find it in your browser URL after navigating to Settings > My Organization in Workbench" | ||
type = string | ||
} | ||
|
||
variable "existing_cloudtrail_bucket_name" { | ||
description = "Use your AWS CloudTrail S3 Bucket name" | ||
type = string | ||
} | ||
|
||
variable "aws_management_account_id" { | ||
description = "Use your AWS management account id" | ||
type = string | ||
} | ||
|
||
variable "existing_cloudtrail_log_bucket_account_id" { | ||
description = "Use your AWS cloudtrail log bucket account id" | ||
type = string | ||
} | ||
|
||
variable "existing_cloudtrail_kms_key_arn" { | ||
description = "Use your AWS KMS Key ARN that is used for your CloudTrail infrastructure" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "existing_sns_topic_arn" { | ||
description = "Use your AWS CloudTrail SNS Topic ARN" | ||
type = string | ||
default = null | ||
} | ||
|
||
provider "aws" { | ||
region = "us-east-1" | ||
profile = "default" | ||
} | ||
|
||
provider "aws" { | ||
region = "us-east-1" | ||
alias = "log_bucket" | ||
assume_role { | ||
role_arn = "Replace role arn here or create a provider for log bucket account by other means" | ||
} | ||
} | ||
|
||
module "expel_aws_cloudtrail_integration_x_account" { | ||
source = "../../../" | ||
|
||
providers = { | ||
aws.log_bucket = aws.log_bucket //setting the log_bucket alias to the log bucket aws provider for existing cloudtrail with resources in different accounts | ||
} | ||
|
||
is_existing_cloudtrail_cross_account = true | ||
expel_customer_organization_guid = var.expel_customer_organization_guid | ||
aws_management_account_id = var.aws_management_account_id | ||
existing_cloudtrail_log_bucket_account_id = var.existing_cloudtrail_log_bucket_account_id | ||
existing_cloudtrail_bucket_name = var.existing_cloudtrail_bucket_name | ||
existing_cloudtrail_kms_key_arn = var.existing_cloudtrail_kms_key_arn | ||
existing_sns_topic_arn = var.existing_sns_topic_arn | ||
|
||
prefix = "expel-aws-cloudtrail" | ||
|
||
tags = { | ||
"is_external" = "true", | ||
"x-account" = "true" | ||
} | ||
} | ||
|
||
output "expel_aws_cloudtrail_integration_x_account" { | ||
value = module.expel_aws_cloudtrail_integration_x_account | ||
} |
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,7 @@ | ||
region = "Replace with the AWS region in which you want the notification queue for CloudTrail to be set up" | ||
expel_customer_organization_guid = "Replace with your organization GUID assigned to you by Expel. You can find it in your browser URL after navigating to Settings > My Organization in Workbench" | ||
existing_cloudtrail_bucket_name = "Replace with your AWS S3 Bucket name" | ||
aws_mgmt_account_id = "Replace with your AWS Management account id" | ||
existing_cloudtrail_log_bucket_account_id = "Replace with your AWS Cloudtrail log bucket account id" | ||
existing_cloudtrail_kms_key_arn = "Replace with the KMS Key ARN used for your CloudTrail S3 Bucket" | ||
existing_sns_topic_arn = "Replace with your AWS SNS Topic ARN" |
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,21 @@ | ||
# Existing | ||
|
||
This configuration creates AWS resources that are necessary to integrate Expel Workbench with an existing AWS CloudTrail instance. | ||
|
||
## Usage | ||
|
||
To run this example you need to execute: | ||
|
||
```bash | ||
terraform init | ||
terraform apply -var-file="terraform.tfvars" | ||
``` | ||
|
||
Note that this example may create resources which can cost money, run `terraform destroy` when you don't need these resources. | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| terraform | = 1.1.3 | | ||
| aws | = 4.0 | |
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
File renamed without changes.
Oops, something went wrong.