Cloud concept · Updated

Externalized Configuration - Externalized Configuration separates environment-specific settings and operational controls from application code so the same application artifact can run in different environments.

In short

Applications obtain settings from deployment inputs, environment variables, configuration files, or configuration services instead of hard-coding them into business logic. This enables artifact reuse across environments and independent configuration changes, but requires validation, access control, and explicit rules for when applications load updated values.

Cloud Concepts Hub →

6 key aspects of Externalized Configuration

Externalized configuration combines reusable artifacts with environment-specific settings, explicit refresh semantics, validation, secure access, and controlled change management.

01
Separation of code and environment settings

Keep environment-dependent values outside business logic and reusable build artifacts. Define a clear configuration contract so each environment supplies the same required settings with appropriate values.

02
Build once, configure per environment

Promote the same tested artifact through environments while supplying different configuration references or deployment inputs. Avoid rebuilding application binaries merely to change an endpoint or operational setting.

03
Explicit loading and refresh behavior

Choose whether settings are loaded at startup, per request, or through a periodically refreshed cache. External storage alone does not make a setting update automatically inside a running application.

04
Validation and compatibility

Validate configuration types, required fields, and application-specific constraints before activation. Keep configuration compatible with all application versions that may run during a deployment.

05
Controlled configuration rollout

Version configuration changes, limit their initial exposure, and monitor application health. Provide a rollback path because configuration changes can cause outages even when application code remains unchanged.

06
Security and failure handling

Restrict configuration access by workload and environment, and store credentials in an appropriate secrets system. Define safe behavior for unavailable configuration, stale cached values, and missing required settings.

Cloud services for Externalized Configuration

A delivery pipeline can promote one application artifact while selecting environment-specific configuration references. Parameter Store supplies named settings, Secrets Manager supplies credentials, and AppConfig manages validated configuration rollouts. Lambda consumes these values through environment configuration or runtime retrieval. API Gateway REST API stage variables can provide request-stage context or select an integration target, but do not automatically update Lambda environment variables. Together, these services separate application releases from configuration delivery; engineers must still implement refresh behavior, least-privilege access, compatible configuration contracts, and recovery when retrieval fails.

AWS AppConfigAWS AppConfig

Manages application configuration through applications, environments, configuration profiles, validators, and deployment strategies. Applications retrieve configuration through its data APIs or the AWS AppConfig Agent, while configured CloudWatch alarms can support automatic rollback during deployment.

Amazon API GatewayAmazon API Gateway

REST API stage variables provide stage-specific values that can parameterize integrations or reach a Lambda function through its request event. They can support different backend selections across stages without hard-coding those selections in application logic, but should not hold secrets.

AWS LambdaAWS Lambda

Provides environment variables as function configuration and can retrieve external settings through SDKs or extensions. A function handling an API Gateway REST API proxy request can read stage variables from the event, independently of its configured environment variables.

AWS Secrets ManagerAWS Secrets Manager

Stores sensitive configuration such as database credentials and API keys with access controls and support for rotation. Applications should retrieve and cache secrets appropriately rather than embedding them in artifacts, and must account for credential changes.

Externalized Configuration exam questions

Real practice exam questions on Externalized Configuration, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C02

A team uses an Amazon API Gateway REST API with Lambda proxy integration. The API has test and production stages. A Lambda function named Orders has aliases named candidate and live, each pointing to a published version. Both stages have an existing stage variable named releaseAlias: its value is candidate for test and live for production.

The team wants to deploy the same API configuration to both stages and have each stage invoke its designated Lambda alias. After testing a release, the CI/CD pipeline must promote that version to production without modifying the function code or redeploying the API. API Gateway does not yet have permission to invoke the function.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Use Orders:${stageVariables.releaseAlias} as the Lambda target within the integration URI. Grant API Gateway permission to invoke each alias-qualified function ARN. Promote releases by updating the live alias to reference the tested version.

API Gateway REST API stage variables can parameterize the Lambda alias in an integration URI. Each stage therefore invokes its configured alias using the same API configuration. Alias-qualified invocation permissions authorize those calls. Updating the live alias changes the production version without changing function code or redeploying the API.

SAP-C03

A company uses AWS CloudFormation to deploy AWS Batch job definitions for Fargate jobs in separate development and production accounts. The pipeline must promote the same tested container image digest to both accounts. Each account already has an AWS Systems Manager Parameter Store String parameter containing a vendor API endpoint and a SecureString parameter containing the vendor API token.

Operators must be able to update either parameter independently of application and infrastructure deployments. Each newly launched job must receive the current parameter values without rebuilding the image, updating the stack, or registering another job definition revision. Running jobs do not need to receive changes. Plaintext tokens must not pass through the deployment pipeline or appear in CloudFormation templates or job definition environment properties. The container already validates its endpoint and token environment variables before processing work.

Neither the job role nor the task execution role currently has permission to retrieve the parameters. Which solution meets these requirements?

Show answerCORRECT ANSWER

Pass the environment-specific parameter ARNs into the CloudFormation template. Map both parameters to the expected environment variable names through the job definition's secrets properties. Grant the task execution role the required parameter retrieval and decryption permissions, scoped to these parameters and their encryption key as applicable.

AWS Batch can inject Parameter Store values into container environment variables through the job definition's secrets properties, including both String and SecureString parameters. Values are retrieved when each job's container starts, so newly launched jobs receive current values without an infrastructure update. The task execution role supplies the retrieval permissions. CloudFormation and the job definition contain references rather than plaintext values, and the same image can be promoted across accounts.

SAA-C03

A company deploys a containerized application to development, staging, and production on Amazon ECS. The pipeline must promote the exact same tested container image digest through all three environments. Each environment uses different downstream service URLs and request timeout values. Operations engineers must be able to change these settings for running tasks within 5 minutes without deploying new tasks. Security policy requires each environment's tasks to be unable to read configuration values belonging to another environment.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Store settings in separate AWS Systems Manager Parameter Store paths for each environment. Give each environment's task role read access only to its own parameters. Pass the environment's parameter path to the container, and have the application retrieve and validate the settings at startup and every minute.

This separates environment-specific settings from the container image, preserving the tested image digest. Periodic retrieval lets running tasks apply changes within 5 minutes without replacement. Environment-specific task-role permissions prevent cross-environment configuration access, and validation helps prevent invalid settings from being applied.

Practice Externalized Configuration in a full exam

Questions on Externalized Configuration in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Externalized Configuration

3 min read

Externalized configuration separates what an application does from the settings that determine where and how it runs. Database endpoints, downstream service URLs, timeout values, and feature settings belong outside business logic when they vary between environments or operational conditions. The application still defines the configuration contract: expected names, types, constraints, and behavior when a value is missing. Externalization does not mean accepting arbitrary settings without validation.

A typical delivery pipeline builds and tests an application artifact once, then promotes that same artifact through development, staging, and production. Each environment supplies its own configuration through deployment parameters, environment variables, mounted files, or a remote configuration service. For example, the same container image can use a staging database endpoint during integration testing and a production endpoint after approval. Rebuilding the image solely to replace an endpoint weakens artifact consistency because production no longer receives exactly the artifact that was tested.

Environment preparation should establish configuration names, schemas, access policies, and references before deployment. A pipeline can select an environment-specific configuration profile without embedding its values into application source code. Configuration definitions may still be version-controlled and reviewed alongside code; the important distinction is that environment-specific values are not inseparably compiled into the executable. Sensitive values should use a secrets-management mechanism rather than an ordinary configuration file committed to a repository.

Runtime configuration also supports dynamic deployments. With an Amazon API Gateway REST API, stage variables can hold stage-specific settings such as a backend identifier or a Lambda alias name used in an integration URI. For a Lambda proxy integration, stage variables can be passed in the request event and read by the function. They do not automatically become Lambda environment variables. If a stage variable selects a Lambda target, the required invocation permissions must cover that target. Stage variables are not a suitable store for credentials.

AWS AppConfig illustrates managed configuration delivery. Teams can prepare separate environment configurations, validate them with supported validators, and deploy changes gradually using a deployment strategy. Configured Amazon CloudWatch alarms can trigger rollback when a deployment causes problems. Applications must retrieve the deployed configuration, commonly through the AWS AppConfig Agent, and apply it correctly; deploying a new configuration does not automatically change arbitrary variables inside a running process.

The loading model determines operational behavior. Environment variables are normally read at process initialization, and changing their deployment settings generally requires restarting or replacing application instances. Remote configuration can support periodic refresh without a code deployment, but adds retrieval latency, service dependencies, and potentially stale caches. Define refresh intervals, last-known-good behavior, and which missing settings must prevent startup. Never silently substitute an unsafe production default for a required security setting.

Externalized configuration is not automatically dynamic, secure, or low risk. A configuration change can redirect production traffic or disable an important control, so it needs authorization, auditing, testing, and rollback just like code. Record the application version and configuration revision together when diagnosing incidents. During gradual rollout, ensure old and new application versions can safely interpret the configuration they may receive.

Learn Externalized Configuration in lessons

2 short lessons on Externalized Configuration in 2 certification courses.

Open the lessons