How it works
- You create the Deployz connector in your AWS account from a standard AWS CloudFormation template, with a Quick Create link.
- Every minute, the connector calls Deployz over HTTPS and collects commands, such as install, update, or remove.
- The connector applies each command with roles in your account and reports the result to Deployz.
The connector starts every connection. Each role is capped, and your data stays in your account.
What the connector stack creates
The connector stack, nameddeployz-bootstrap- followed by an identifier, creates:
- The connector function (AWS Lambda), an Amazon EventBridge rule that runs it every minute, and the permission that lets the rule start the function
- The connector role, with a permissions boundary and two provisioner policies
- A CloudFormation execution role for your application stack
- A permissions boundary for the IAM roles in your application stack
- An AWS Secrets Manager secret that holds the connector’s Deployz credential
- Setup functions that create the installation ID and set the connector logs’ one-week retention
AWSLambdaBasicExecutionRole, which lets it write logs. In addition, one role can start the installation ID function, and one can set or remove the retention period of log groups in the account. They have no other permissions.
When the stack is created, the setup functions also create the CloudWatch Logs log groups for the connector and the setup functions. These log groups aren’t part of the stack. At run time, the connector writes AWS Systems Manager parameters under /deployz/<installation ID>/ to track unfinished commands.
The installation ID is created inside your account when the stack is created. It isn’t part of the Quick Create link. The one exception is a link to reconnect a removed deployment, so that Deployz can delete the data the removal kept. That link passes the removed deployment’s installation ID in the ExistingInstallationId parameter. The new connector then has the same tag-scoped permissions as the old one, and no others. The installation ID isn’t a secret.
IAM roles and permissions
The connector holds broad permissions so it can install, update, and remove the application without manual setup. Both roles below receive all their permissions when you create the connector stack, not after the connector first connects. Deployz chooses the commands and the application template that the connector applies. Most changes these roles can make are limited to this deployment, its installation scope:- By tag, where AWS supports tag conditions. The resource must carry the
deployz:installationtag with this deployment’s installation ID. Creating a resource requires the request to carry that tag, and changing or deleting a resource requires the resource to carry it. - By name, where AWS doesn’t support tag conditions. The resource’s name must start with this deployment’s application stack name:
deployz-app-followed by the first part of the installation ID, for exampledeployz-app-1a2b3c4d-.
Connector role
The connector function runs with this role. Only AWS Lambda can assume it.- Permissions boundary. A permissions boundary caps the role. The role can never exceed it.
- Installation-scoped permissions. Changes are limited to this deployment’s resources, by tag or by name, as described above.
- Read-only access to its own stack. The role can read the status of its own connector stack (
cloudformation:DescribeStacks, limited to that stack). It can’t change the stack. Deployz uses the status to show and verify a connector update. While the stack is updating, the connector starts no new operations. - Scoped secrets access. The role can read and update the connector’s own credential secret. It can read, update, and delete the application’s secrets that are tagged for this deployment. It deletes them only when your software provider deletes the retained data. It can list the secrets in the account and read their descriptions and tags, but not their values.
- No log reads. The role can write logs. It can’t read log events (
logs:GetLogEventsandlogs:FilterLogEventsaren’t granted). - No network, database, or IAM role creation. The connector role has no permission to create the network, the database, or IAM roles. It asks CloudFormation to apply the application template with the execution role below. The role can create only a few resources itself, each with this deployment’s tag: HTTPS certificates, the HTTPS listener on this deployment’s load balancer, task-definition revisions, and cache clusters.
CloudFormation execution role
CloudFormation uses this role to build your application stack.- Only CloudFormation can assume it, and only on behalf of your account.
- Its changes are limited to this deployment’s resources, by tag or by name, as described above.
- It can create IAM roles for your application only under the
/deployz/path, with names that start with this deployment’s application stack name, and only when each role carries the application role boundary below. The same conditions apply when it adds or attaches a policy to a role. - The only managed policy it can attach is
AmazonECSTaskExecutionRolePolicy. - It has no permissions boundary of its own, because a boundary on this role wouldn’t carry over to the roles it creates. The application role boundary limits those roles instead.
Application role boundary
Every IAM role in your application stack must carry this boundary. It sets the most any of those roles can do, even if a policy grants more:- Pull container images from Amazon ECR. This isn’t limited to one repository. The application’s releases are stored in a Deployz registry, which allows your account to pull them.
- Write logs to this deployment’s log groups
- Read the secrets tagged for this deployment
- Use this deployment’s S3 buckets and SQS queues
- Run tasks from the application’s own task definitions (names starting with
DeployzApp), only in this deployment’s Amazon ECS cluster - Pass this deployment’s roles under
/deployz/to Amazon ECS tasks
A connector stack keeps the permissions it was created with until you update it. A connector stack created before Deployz added this boundary doesn’t have it. A connector stack created before Deployz added the installation scope keeps its earlier, wider permissions, where some actions reach any Deployz application in the same AWS account and Region, not only this deployment. Updating the connector stack applies the current permissions. Your install page shows when an update is available. See Update the connector stack. An application that’s already installed keeps the roles it was created with and keeps working. Ask your software provider if you’re not sure which applies to your deployment.
Resources limited by name
These resources don’t support tag conditions, so their actions are limited by name to this deployment:- Amazon S3 buckets. CloudFormation and the connector can change or delete only buckets whose names start with this deployment’s application stack name. Before the connector deletes a bucket, it also checks the bucket’s
deployz:installationtag. - Log groups. CloudFormation can set retention on, and delete, only this deployment’s log groups.
- Queues and schedules (Preview). CloudFormation can manage only this deployment’s queues and schedules.
- One-off tasks, such as database migrations. The connector can run and stop them only in this deployment’s Amazon ECS cluster.
- Passing roles (
iam:PassRole). The connector and CloudFormation can pass only this deployment’s roles, and only to the services that run your application: Amazon ECS, and Amazon EventBridge Scheduler for scheduled jobs. The connector can pass to CloudFormation only the execution role from its own stack. - The connector’s progress records. The connector can read, write, and delete only the Systems Manager parameters under
/deployz/<installation ID>/.
Exceptions to installation scoping
These actions aren’t fully limited to this deployment, in most cases because AWS doesn’t support the conditions for them. Each is controlled another way:- Read-only actions. Describe, list, and get calls aren’t limited to this deployment, except reading the connector’s own stack, which is limited to that stack. For example, the connector can list the account’s S3 buckets and secrets, and read the tags of buckets, secrets, databases, caches, and certificates. It uses them to observe the application, and to find this deployment’s leftover resources, including any certificates that weren’t deleted at removal, when your software provider deletes retained data. They don’t change anything, and they don’t return secret values.
- Removing old task-definition revisions (
ecs:DeregisterTaskDefinition). Amazon ECS doesn’t support resource limits on this action. The connector removes only revisions of this application’s own task definitions: old revisions after a successful update, and the remaining revisions when your software provider deletes retained data. A removed revision doesn’t stop a task that uses it. - Tagging Amazon ECS resources (
ecs:TagResource). The permission requires the request to carry this deployment’s tag, but doesn’t check whether the resource already carries another deployment’s tag. The connector uses it only to tag the task-definition revisions it registers. - Generating a random password (
secretsmanager:GetRandomPassword). A random password isn’t an AWS resource. Only CloudFormation can use the role that holds this action. - Writing logs (
logs:CreateLogGroup,logs:CreateLogStream, andlogs:PutLogEvents). AWS Lambda uses these actions to write the connector’s activity log. The permission isn’t limited to the connector’s log group. It can create log groups and add log entries, but it can’t read, change, or delete logs. - Creating service-linked roles (
iam:CreateServiceLinkedRole). This is limited to the AWS services the application uses: Amazon ECS, Elastic Load Balancing, Amazon RDS, and Amazon ElastiCache. - Cache parameter groups and cache nodes. Creating, changing, or deleting the cache also uses the default parameter group and the cache nodes. The cache itself must carry this deployment’s tag.
No inbound access
The connector’s only connection to Deployz is outbound HTTPS, which the connector starts. No inbound connection to your account is required, and Deployz has no path into your account. The connector also calls AWS APIs in your account, and sends a request to the application’s address to check that it responds. Inside the application’s network, the internet-facing load balancer is the only component that accepts traffic from the internet, on ports 80 and 443.Application traffic
How your users’ traffic reaches the load balancer depends on the address they use:- The default
deployz.devaddress. Traffic passes through the Deployz Cloudflare network. HTTPS ends at Cloudflare. Cloudflare then sends the traffic over a new HTTPS connection to the load balancer in your AWS account. - A custom domain. Traffic goes directly to the load balancer in your AWS account. It doesn’t pass through Deployz.
Enrollment
The Quick Create link carries a single-use enrollment code. It ties the connector to your deployment. Deployz spends the code when the connector first connects and refuses any later attempt to use the same code with a different connector. If you select Retry connection on the install page, Deployz issues a new code.Connector credential
The connector signs in to Deployz with a token stored in a Secrets Manager secret in your account. The token is either generated by CloudFormation in your account, or created by Deployz and passed in the Quick Create link as a hidden (NoEcho) parameter.
Data Deployz receives
The connector sends Deployz operational information about the deployment:- Installation ID, AWS account ID, and AWS Region
- Connector version, and the release and container image version that runs
- Deployment state, infrastructure status, health state, and timestamps
- The status of the connector stack in your AWS account, such as updating or rolled back
- Resource identifiers
- AWS error messages: stack events, stopped-task reasons, and exit codes
- Health-check status code and response time (not the response body)
Data Deployz never receives
These stay in your AWS account:- Your application runtime and its in-memory data
- Your database data
- Your cache contents
- Your S3 data
- Your application’s CloudWatch logs
deployz.dev address passes through the Deployz Cloudflare network, so it doesn’t stay inside your AWS account. Traffic to a custom domain does. See Application traffic. Deployz doesn’t ask for or store your AWS credentials.
Secrets you enter
If the install page asks you for secret values:- They’re sent to Deployz over HTTPS and stored encrypted until your AWS account connects.
- Deployz then delivers them to AWS Secrets Manager in your account and deletes the active copy.
- If your account doesn’t connect within 24 hours, the secret is deleted and must be entered again.
- Encrypted backup copies may remain for up to 7 days.
- Deployz doesn’t display secret values or write them to application logs.
Logs
Application logs are written to CloudWatch Logs in your account and kept for seven days. The connector’s own log is kept for one week.Revoke access
You can revoke Deployz access at any time by deleting the Deployz connector stack in your AWS account. Who: you, in your AWS console.- In the CloudFormation console, in the application’s Region, select the connector stack (its name starts with
deployz-bootstrap-). - Delete the stack. This deletes the connector function, its schedule, and its roles.
- The CloudWatch Logs log groups of the connector and its setup functions. Their entries expire after one week.
- Systems Manager parameters under
/deployz/<installation ID>/, if a command was still unfinished - Any application resources that are still in your account
