The Simplest Way to Make AWS CDK and Solarwinds Work Like They Should

Published
Length
4 min read

Luis Felipe Dias

All posts

Teams use aws cdk and solarwinds to build cloud apps and watch their health. AWS CDK sets up cloud parts in code, and Solarwinds tracks how they run. When you pair both tools, every new cloud server gets watched right away. You do not need to set up alerts by hand after each code push. Instead, your code builds the server and sets up the log rules together. How aws cdk and solarwinds share data and roles AWS CDK turns your code into cloud formation templates that build cloud parts. During th

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use aws cdk and solarwinds to build cloud apps and watch their health. AWS CDK sets up cloud parts in code, and Solarwinds tracks how they run.

When you pair both tools, every new cloud server gets watched right away. You do not need to set up alerts by hand after each code push. Instead, your code builds the server and sets up the log rules together.

How aws cdk and solarwinds share data and roles

AWS CDK turns your code into cloud formation templates that build cloud parts. During this step, it can also create an identity role for your watching tool. Solarwinds uses this cloud role to read metrics, logs, and status data. This link lets both systems talk without human work during a code push.

Data flows between the two tools in two main ways. First, Solarwinds can poll the cloud account on a set timer. It checks a read-only role and pulls metric streams from the cloud API. Second, your cloud stack can push logs and events out to a web link. AWS CDK sets up these log streams and points them to the right place.

To make this work well, your code needs access to a secret API token. You should store this token in a native cloud secret store before you run builds. When AWS CDK runs, it reads the reference to that secret store. The cloud stack then uses that key to send logs out to Solarwinds.

Common failure modes and how to scope roles

Many teams fail by using a single shared service user with full admin rights. They generate long-lived static keys and paste them right into the monitoring tool. If that key leaks, an attacker gets full control over the whole cloud account. Shared accounts also make it hard to see who ran which query.

Broad tokens in code are another big risk for software teams. Developers sometimes put API keys directly into the source code to save time. Then anyone who can read the code repo can also steal the key. Unlogged queries also cause problems when too many requests hit the cloud API at once.

AWS CDK Security Constructs + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix these issues by scoping every role down to the bare minimum. Give the Solarwinds role permission to read metrics and list tags, and nothing else. Never give a monitoring role the power to change or delete cloud servers. Use cross-account role trust with an external ID instead of static access keys.

Network paths between your cloud servers and the monitoring collector also need tight rules. If you run a local collector inside your cloud network, lock down its security groups. Allow outbound traffic only on the exact port that the monitoring endpoint needs. Block all inbound traffic from the public web to that collector machine.

Keeping tags and alert rules in sync

Fast teams create and destroy cloud stacks many times a week. If your monitoring tool does not know about these changes, you get false alerts. You might get paged at night for a test server that no longer exists. Or worse, a real production database might launch without any disk space checks.

The best way to prevent alert drift is to use strict cloud tags. Set up your AWS CDK code to apply standard tags to every single item. Include tags for the app name, the team owner, and the run stage. Solarwinds can read these tags and group your servers into the right buckets.

When a server has a production tag, the tool applies strict alert rules. When a server has a test tag, the tool mutes alerts outside work hours. When AWS CDK deletes a stack, the cloud items go away cleanly. This tag-driven setup keeps your dashboards clean and stops alert noise for your team.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How should Solarwinds log in to an AWS account built with CDK?

Use an AWS identity role with a cross-account trust policy and an external ID. Define this read-only role inside your CDK code so every account has the exact same setup.

Where should we store the Solarwinds API key for our CDK stacks?

Store the API key in a managed cloud secret store outside of your git repo. Have your CDK stack reference the secret name at run time instead of hardcoding the text.

How do we stop false alerts when CDK deletes a test stack?

Use resource tags in your CDK code to mark stacks as test or temporary. Set your Solarwinds rules to ignore missing host alerts for any item with that test tag.

The query runs. The emails stay hidden.