Secure architectures · 13 min
Encryption in transit and secrets with ACM and Secrets Manager
In this lesson you will learn what AWS Certificate Manager does, which Region each certificate goes in and which ones renew on their own, how Secrets Manager rotates a password and when it makes sense to store a value in Parameter Store.
Encrypting data means turning it into text that nobody can read without the right key. Besides stored data, the security domain of the exam covers two other topics. The first is data that travels over the network, which task 1.3 of the exam guide calls "encrypting data in transit" and for which it gives AWS Certificate Manager as an example. For example, when a customer of an online store types their card number on their phone, that data travels over the internet to the store, and if it isn't encrypted, anyone on the same Wi-Fi network could read it.
The second topic is the passwords an application uses to talk to its database, which task 1.2 calls "application configuration and credentials security". For example, the store's site program needs a password to read the orders, and that password has to be stored somewhere nobody else can see it.
AWS Certificate Manager
In AWS, encryption in transit is done with TLS, which is the standard way to encrypt the conversation between a browser and a site; HTTPS is a web page served with TLS, and SSL is the name of the earlier version. TLS needs a certificate, which is a file that proves the site is who it says it is, signed by a certificate authority that browsers trust. For example, the padlock you see next to the store's address in the browser appears because the site presented a valid certificate for its domain.
AWS Certificate Manager (ACM) is the service that creates, stores and renews public and private SSL/TLS certificates. A public certificate is for a site anyone on the internet visits, and a private one is for the company's internal systems. The certificates you use with its integrated services, such as Elastic Load Balancing, Amazon CloudFront or API Gateway, have no additional charge, so you pay only for the resources that use them.
Renewal is the other ACM task the exam asks about. A certificate expires after a while and has to be renewed, because an expired certificate makes the browser show a warning and customers leave. ACM renews the certificates it issued on its own, as long as you validated the domain through DNS, that is, you proved the domain is yours with a record in its DNS, and the certificate is in use. On the other hand, a certificate you imported from another authority has no managed renewal, so you renew it yourself and import it again. For example, if the store bought its certificate from another company and imported it, someone has to remember to renew it before it expires; if it requested it in ACM with DNS validation, ACM renews it on its own.
Which Region does the certificate go in?
ACM certificates are regional resources and are not copied between Regions. To use one with a load balancer, you request or import it in the load balancer's Region, so if the ALB is in sa-east-1, the certificate goes in sa-east-1.
CloudFront is the exception to that rule. Amazon CloudFront is the service that delivers your site from AWS locations spread around the world, close to each user, and the origin is the server where the original version of the site lives. Its certificate is requested or imported in US East (N. Virginia), us-east-1, no matter where your users or your origin are, and CloudFront distributes it to its locations. That is why, even if your users are in Brazil and your server is in sa-east-1, the distribution's certificate has to be in us-east-1, and if you request it in another Region, CloudFront doesn't see it.

A request that goes through CloudFront and an ALB travels three legs: from the browser to CloudFront, from CloudFront to the ALB and from the ALB to the instances. The first two use the CloudFront certificate, in us-east-1, and the ALB's (Application Load Balancer, the load balancer for websites), in sa-east-1. For example, a store customer in São Paulo opens the site and their encrypted connection first reaches CloudFront with the us-east-1 certificate; then CloudFront talks to the store's ALB, in sa-east-1, with that Region's certificate.
The third leg depends on the load balancer. A listener is the part of the load balancer that listens for incoming connections, and a target group is the group of servers the load balancer passes requests to. An ALB with an HTTPS listener terminates the TLS connection, that is, it decrypts the requests before sending them to the instances, which are the virtual servers of Amazon EC2, so if the requirement calls for traffic to stay encrypted all the way to the instance, the ALB encrypts again toward an HTTPS target group. For that leg, the load balancer accepts self-signed certificates on the instances, which are certificates the server signs itself without a certificate authority. For example, if one of the store's rules requires card data to stay encrypted all the way to the server, the ALB encrypts each request again before passing it to the instances, and each instance can use its own self-signed certificate.
Which Region do you request the certificate in?
0 of 4Tap the Region where the ACM certificate goes in each case.
CloudFront distribution for users in Brazil with an origin in sa-east-1
Application Load Balancer in sa-east-1
Application Load Balancer in us-east-2
The same domain on an ALB in us-east-2 and another in sa-east-1
AWS Secrets Manager
A database password written in the code or in a configuration file is a long-term credential, with the same problems as an IAM access key: it doesn't change on its own, and anyone who sees the code can copy it. AWS Secrets Manager stores database credentials, API keys, OAuth tokens (temporary permissions one system gives another) and other secrets, encrypted with KMS, the AWS service that keeps the encryption keys. According to the examples on its pricing page, it costs 0.40 USD per secret per month and 0.05 USD per 10,000 API calls.
The application requests the secret with an API call when it needs it, so the value can change without you redeploying anything, that is, without installing the program on its servers again. For example, the store's site asks Secrets Manager for the database password every time it connects, instead of having it written down. That change of value is called rotation, and Secrets Manager does it with a Lambda function in four steps.

First, create_secret generates the new version of the secret, and then set_secret changes it in the database. Next, test_secret checks that the new version works, and finally finish_secret marks it as the current version. For Amazon RDS, the managed database service, there is also managed rotation, where RDS stores the master password, which is the database's main password, in Secrets Manager and rotates it without you writing any function. For example, if the store's orders database is in RDS, turning on that option is enough for the password to change on its own.
The rotation function has to reach the Secrets Manager endpoint, and that matters if it lives in a private subnet, which is a part of your network with no direct way out to the internet. For that case, AWS recommends a Secrets Manager VPC endpoint, a private entrance to the service inside your network, which keeps that traffic from going out to the internet. For example, if the store's database is in a private subnet and so is the rotation function, the VPC endpoint lets the function talk to Secrets Manager without leaving the store's network.
Secrets Manager or Parameter Store?
AWS Systems Manager Parameter Store also stores values, such as the configuration a program reads, and its SecureString type encrypts them with KMS. For example, the store can keep there the ID of the AMI, which is the image its servers are created from, or the address of its payment service. Its parameters come in two tiers:
- Standard parameters, which have no additional charge and allow up to 10,000 per account and Region, of up to 4 KB each.
- Advanced parameters, which are charged, go up to 100,000 and can be up to 8 KB.
What Parameter Store doesn't have is the automatic rotation of Secrets Manager. That is why, when a requirement calls for changing a password without manual intervention, the answer is Secrets Manager, and when it only calls for storing configuration at the lowest cost, the answer is a standard parameter. For example, the store keeps its database password in Secrets Manager, because it has to change on its own, and the name of its photo bucket in a standard parameter, because it doesn't change and isn't secret.
Where do you store it?
An application on Lambda connects to an Amazon RDS database. Security requires the password to change every 30 days without manual intervention and without redeploying the function. What do you use?
Each type of sensitive data has its service: passwords that rotate go in Secrets Manager, configuration without rotation goes in Parameter Store, certificates go in ACM and the keys that encrypt stored data go in KMS. For example, at the store the database password goes in Secrets Manager, its domain's certificate in ACM and the key that encrypts its backups in KMS.
Match each piece of data with where it goes
0 of 4 pairsTap the data and then the service that fits.
0 of 4 pairs.
In a new experience account
In a new experience account, which is the one you open with Google, GitHub, Apple, Amazon or email, ACM, Secrets Manager and Systems Manager are included in the free plan, although ACM doesn't offer exportable public certificates, which are the ones you can download to use outside AWS. The console has no Region selector and your project lives in us-east-2, and replicating secrets to other Regions isn't available, because there is no cross-Region feature. For example, in that account you can store a test database's password in Secrets Manager and read it from a Lambda function.
How does it show up on the exam?
Questions on this topic usually ask where a certificate goes or how a credential is rotated, and these phrases in the question point to the answer:
| If the question says | The answer |
|---|---|
| "Automatic certificate renewal" | A certificate issued by ACM with DNS validation, because an imported one doesn't renew on its own |
| "Certificate for CloudFront" | us-east-1 |
| "Rotate database credentials automatically" | Secrets Manager |
| "Store configuration" or "the cheapest", with no rotation | Parameter Store |
For example, if the question says the store uses CloudFront and its certificate doesn't appear in the distribution's list, the answer is that the certificate was requested in another Region and not in us-east-1.
Review question
A company serves its site with CloudFront in front of an ALB in sa-east-1. It requested an ACM certificate in sa-east-1 and associated it with the ALB without any problem, but when it configures its custom domain in CloudFront the certificate doesn't appear in the list. What does it do?
Next
- AWS Security, identity, and compliance, in the AWS whitepapers, especially the entries for AWS Certificate Manager, AWS Secrets Manager and AWS Key Management Service.
- The Solutions Architect practice exams at /examenes.