Skip to content

Terraform for mock AMAPI for loading testing#48919

Open
ksykulev wants to merge 2 commits into
26225-android-load-testingfrom
android-load-testing-terraform
Open

Terraform for mock AMAPI for loading testing#48919
ksykulev wants to merge 2 commits into
26225-android-load-testingfrom
android-load-testing-terraform

Conversation

@ksykulev

@ksykulev ksykulev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Related issue: Resolves #26225

Testing

  • QA'd all new/changed functionality manually

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Terraform infrastructure to support Android MDM load testing by deploying an internal Android AMAPI mock service and wiring loadtest Fleet to use it as a proxy endpoint (optionally forwarding real-device traffic to Google via a Secrets Manager credential).

Changes:

  • Add a shared Secrets Manager secret for Android Google service account credentials and expose it via remote state output.
  • Set FLEET_DEV_ANDROID_PROXY_ENDPOINT in loadtest infra to point at the internal ALB.
  • Introduce a new android_amapi_mock Terraform stack + Dockerfile to build/push/run cmd/android-amapi-mock behind the internal ALB with /v1/* and /mock/* routing.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
infrastructure/loadtesting/terraform/shared/output.tf Exports the Android Google credentials secret via shared remote state.
infrastructure/loadtesting/terraform/shared/enroll.tf Adds a Secrets Manager secret resource intended for Android Google credentials.
infrastructure/loadtesting/terraform/infra/locals.tf Sets FLEET_DEV_ANDROID_PROXY_ENDPOINT for the loadtest Fleet deployment.
infrastructure/loadtesting/terraform/docker/android-amapi-mock.Dockerfile Builds android-amapi-mock from the Fleet repo for ECS deployment.
infrastructure/loadtesting/terraform/android_amapi_mock/variables.tf Adds module inputs for git tag and forwarding toggle.
infrastructure/loadtesting/terraform/android_amapi_mock/outputs.tf Outputs the internal URL to reach the mock via the internal ALB.
infrastructure/loadtesting/terraform/android_amapi_mock/main.tf Provisions ECR image build/push, IAM policy for secrets, ECS service, and ALB routing rules for the mock.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infrastructure/loadtesting/terraform/shared/enroll.tf Outdated
FLEET_MDM_SSO_RATE_LIMIT_PER_MINUTE = "500"
FLEET_SERVER_GZIP_RESPONSES = "true"

FLEET_DEV_ANDROID_PROXY_ENDPOINT = "http://${resource.aws_lb.internal.dns_name}/"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Android MDM isn't configured in the DB, Fleet never makes AMAPI calls.
If Android MDM IS configured but the mock isn't deployed, the ALB returns a 404 or routes to Fleet which returns a 404 on /v1/*. Fleet's profile reconciliation cron retries every 30 seconds, no crash

Comment thread infrastructure/loadtesting/terraform/android_amapi_mock/main.tf Outdated
Comment thread infrastructure/loadtesting/terraform/android_amapi_mock/main.tf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants