Skip to main content

Resources the Runtime Terraform Module creates

Overview​

This page lists the AWS resources the aws-ecs-runtime module creates in your account. Use it to review a plan, to scope IAM permissions for the pipeline that applies the module, or to find a resource in the AWS console.

With the default settings the module creates 30 resources. It creates 2 more when you deploy on managed instances. The module deploys onto an existing ECS cluster. It does not create the cluster, its instances, or its capacity providers.

In the names below, <cluster> is the value of ecs_cluster_name. A name that ends in * is a prefix that AWS completes with a random suffix.

For a diagram of how these resources connect, see How the components connect.

Resources by component​

Upwind credentials​

ResourceNameNotes
aws_secretsmanager_secret.thisupwind-sensor-*Holds your client ID and client secret.
aws_secretsmanager_secret_version.thisThe client ID and client secret values.
aws_secretsmanager_secret.upwind_registry_credentialsupwind-registry-*Holds the registry token the Lambda writes.

Registry credential rotation​

ResourceNameNotes
archive_file.lambdaPackages the Lambda code that ships with the module.
aws_lambda_function.registry_credentials_loaderUWRegCred-<cluster>Python 3.12, 30 second timeout.
aws_lambda_invocation.generate_registry_credentialsRuns the Lambda once during apply.
aws_lambda_permission.allow_eventbridgeLets EventBridge invoke the Lambda.
aws_cloudwatch_event_rule.regenerate_registry_credentialsregen-registry-creds-*rate(1 hour).
aws_cloudwatch_event_target.regenerate_registry_credentials_targetTargets the Lambda.

Cluster manager​

ResourceNameNotes
aws_ecs_task_definition.cluster_manager<cluster>-upwind-cluster-managerawsvpc network mode.
aws_ecs_service.cluster_managerupwind-cluster-managerOne replica by default.
aws_security_group.cluster_manager_trafficcluster-manager-traffic-*
aws_vpc_security_group_ingress_rule.cluster_manager_allow_grpc_ipv4TCP 8082, gRPC.
aws_vpc_security_group_ingress_rule.cluster_manager_allow_tls_grpc_ipv4TCP 8444, TLS gRPC.
aws_vpc_security_group_egress_rule.cluster_manager_allow_traffic_ipv4All outbound traffic.
aws_service_discovery_private_dns_namespace.thisupwind-<cluster>.privateNot created when you pass an existing namespace.
aws_service_discovery_service.thisupwind-cluster-manager

Sensor and scanner​

The sensor and the scanner each get the same set of resources.

ResourceNameNotes
aws_ecs_task_definition.sensor, aws_ecs_task_definition.scanner<cluster>-upwind-sensor, <cluster>-upwind-scannerhost network mode.
aws_ecs_service.sensor, aws_ecs_service.scannerupwind-sensor, upwind-scannerDaemon services on your EC2 container instances. They skip managed instances.
aws_cloudformation_stack.sensor_daemon, aws_cloudformation_stack.scanner_daemon<cluster>-upwind-sensor-daemon, <cluster>-upwind-scanner-daemonManaged instances only. Each stack holds an AWS::ECS::DaemonTaskDefinition and an AWS::ECS::Daemon.

IAM​

These come from the module's nested iam module. To use roles you create yourself, see Pre-created IAM roles.

ResourceNameNotes
aws_iam_role.task_executionupwind-task-execution-*Used by all Upwind tasks to pull images and read the secrets.
aws_iam_role_policy_attachment.task_executionAmazonECSTaskExecutionRolePolicy.
aws_iam_role_policy.task_execution_credentialssensorCredentialsReads the two Upwind secrets.
aws_iam_role.cluster_manager_taskupwind-cluster-manager-task-*Task role for the cluster manager.
aws_iam_role_policy.describe_tasksdescribeTasksLets the cluster manager describe ECS tasks.
aws_iam_role.lambdaupwind-credentials-loader-*Role for the registry credentials Lambda.
aws_iam_role_policy.manage_registry_credentialsregistryCredentialsReads the client credentials and writes the registry token.
aws_iam_role_policy_attachment.lambda_executionAWSLambdaBasicExecutionRole.

Logging​

ResourceNameNotes
aws_cloudwatch_log_group.logs/aws/ecs/upwind/<cluster>One day retention by default.

Change what the module creates​

SettingEffect
credentials.secret_arnUses your existing client credentials secret. The module does not create the secret or its version. See Credentials and secrets.
credentials.registry_secret_arn or credentials.registry_auth_enabled = falseNo registry secret, Lambda, EventBridge rule, or Lambda IAM role.
iam_rolesUses your pre-created roles. The module creates no IAM resources.
cluster_manager.create = falseNo cluster manager service, task definition, security group, Cloud Map resources, or cluster manager task role.
sensor.enabled = false, scanner.enabled = falseSkips that component's task definition, daemon service, and managed daemon stack.
logging.log_configuration or logging.cloudwatch_log_group.enabled = falseNo log group. See Logging.
managed_instances_capacity_provider_namesAdds the managed daemon stacks for the sensor and scanner.
cluster_manager.service_discovery.use_internal_lb = truePuts the cluster manager behind an internal Network Load Balancer instead of Cloud Map. Adds the load balancer, plus a target group and a listener for each of 8082 and 8444. Removes the Cloud Map namespace and service. Net 3 more resources.
cluster_manager.privatelinkRequires the internal load balancer. Adds a VPC endpoint service in front of it, so 1 more resource. See PrivateLink.