-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TME-2307: add support for existing trail with x-account resources #46
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
939840e
add support for existing trail with x-account resources.
sarjumulmi 999344f
update readme
sarjumulmi 16d1f08
remove extra EOL
sarjumulmi bebc0cb
fix variable assignment
sarjumulmi 94a97a4
add temp provider file to squash tf validate error
sarjumulmi a665b92
fix description in tfvars
sarjumulmi ce4e8cc
fix typo in temp provider file
sarjumulmi 03fc78a
update readme for case when topic is not in log bucket account
sarjumulmi 52ba180
fix local validation & add prefix in examples
sarjumulmi 0dc35fe
use cat to create temp provider file in circle config
sarjumulmi d43d635
fix nits
sarjumulmi eaa5178
fix cat
sarjumulmi c49ebb3
fix readme
sarjumulmi 22c4ab9
add comment to circle config
sarjumulmi 372aeda
set null default for vars
sarjumulmi 1a33527
update version in readme
sarjumulmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯