Skip to content
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

MES-146 Update agent template for CaaS migration #10

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
locals {
# Wrapper metadata
mcd_wrapper_version = "0.1.4"
mcd_wrapper_version = "0.1.5"
mcd_agent_platform = "AWS"
mcd_agent_service_name = "REMOTE_AGENT"
mcd_agent_deployment_type = "TERRAFORM"

# Deployment properties
account_id = data.aws_caller_identity.current.account_id
partition_id = data.aws_partition.current.id
connect_to_vpc = length(var.private_subnets) >= 2 ? true : false
account_id = data.aws_caller_identity.current.account_id
partition_id = data.aws_partition.current.id
connect_to_vpc = length(var.private_subnets) >= 2 ? true : false
skip_cloud_account_policy = contains(["590183797493"], var.cloud_account_id)
invocation_role_source_arns = local.skip_cloud_account_policy ? ["arn:aws:iam::590183797493:root"] : ["arn:aws:iam::${var.cloud_account_id}:root", "arn:aws:iam::590183797493:root"]

# Data store properties
mcd_agent_store_name = "mcd-agent-store-${random_id.mcd_agent_id.hex}"
Expand Down Expand Up @@ -432,7 +434,7 @@ resource "aws_iam_role" "mcd_agent_service_invocation_role" {
{
"Effect" : "Allow",
"Principal" : {
"AWS" : "arn:aws:iam::${var.cloud_account_id}:root"
"AWS" : local.invocation_role_source_arns
},
"Action" : "sts:AssumeRole",
"Condition" : {
Expand Down
7 changes: 4 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ variable "image" {

variable "cloud_account_id" {
description = <<EOF
Select the Monte Carlo account your collection service is hosted in.

This can be found in the 'settings/integrations/collectors' tab on the UI or via the 'montecarlo collectors list' command on the CLI
The service that invokes the agent is being migrated to the AWS Account with ID: 590183797493.
For accounts created after April 24th, 2024 select 590183797493, for previously created
accounts select the Monte Carlo account your collection service is hosted in.
This can be found in the 'settings/integrations/collectors' tab on the UI or via the 'montecarlo collectors list' command on the CLI.
EOF
type = string
default = "190812797848"
Expand Down