Documentation forSolarWinds Observability

AWS CodeStar Integration

If you use AWS CodeStar to quickly develop, build, and deploy applications on AWS, you can send build and deployment events to SolarWinds Observability and associate events with an entity. Events from AWS CodeStar are included in SolarWinds Observability time-based charts, such as the Health Status widget. With this integration, you can correlate deployment events with the health status of an entity.

  1. Create an ingestion API token and copy the token for use in a CodeBuild pipeline action. See API Tokens.

  2. Create a pipeline in CodeBuild. See Edit a pipeline in CodePipeline in AWS Documentation.

  3. Add an AWS Lambda action to call the SolarWinds Observability Events REST API. When adding the action, do the following actions:

    • Add the swo-codestar-in-BuildArtifact input artifact.

    • Enter codestar-SWO-integration as a Function name.

    • Enter #{ApplicationSource.CommitId} in the User parameters field.

    See Adding Lambda actions.

  4. Create the following Lambda function to make an HTTP request to the SolarWinds Observability API, customizing for the AWS region (if needed) and for the following updates to the options object:

    1. hostname: '',

      Replace xx-yy with the data center your organization's data is hosted in, see Find the data center and endpoints for your organization.

    2. 'X-Otel-Resource-Attr': '<EntityTypeTagName>=<EntityIdentifier>',

      Replace <EntityTypeTagName> with the tag name for your entity type and <EntityIdentifier> with ID of the entity you want to associate with the CodeStar project.

      • The entity type tag name follows the format sw.entity.<type>.id. See Determine the entity type tag name for your entity type for a full list.

      • The entity ID follows the format e-XXXXXXXXXXXXXXXXXXX and can be found by looking at the URL in your browser when looking at your entity in the Entity Explorer. For example, the entity ID for the entity showing in the Entity Explorer for the following URL is e-1234512345123451234:

    const https = require('https');
    const AWS = require('aws-sdk');
    AWS.config.update({ region: 'us-east-1' });
    const codepipeline = new AWS.CodePipeline();
    const functionName = process.env.AWS_LAMBDA_FUNCTION_NAME;
    const encrypted = process.env['TOKEN'];
    let decrypted;
    exports.handler = async (event, context) => {
        const commitId = 'abcdefg';
        if (!decrypted) {
            // Decrypt code should run once and variables stored outside of the
            // function handler so that these are decrypted once per container
            const kms = new AWS.KMS();
            try {
                const req = {
                    CiphertextBlob: Buffer.from(encrypted, 'base64'),
                    EncryptionContext: { LambdaFunctionName: functionName },
                const data = await kms.decrypt(req).promise();
                decrypted = data.Plaintext.toString('ascii');
            } catch (err) {
                console.log('Decrypt error:', err);
                throw err;
        const options = {
            hostname: '',
            port: 443,
            path: '/v1/changeevents',
            method: 'POST',
            headers: {
                Authorization: `Bearer ${decrypted}`,
                'X-Otel-Resource-Attr': '<EntityTypeTagName>=<EntityIdentifier>',
                'Content-Type': 'application/json'
        const data = {
            name: 'codestar',
            title: 'test',
            description: `commitId ${commitId} deployed`
        const response = await new Promise((resolve, rej) => {
            const req = https.request(options, (res) => {
                let body = '';
                console.log('Status:', res.statusCode);
                console.log('Headers:', JSON.stringify(res.headers));
                res.on('data', (chunk) => body += chunk);
                res.on('end', () => {
                    console.log('Successfully processed HTTPS response');
                    // If we know it's JSON, parse it
                    if (res.headers['content-type'] === 'application/json') {
                        body = JSON.parse(body);
            req.on('error', rej);
        const jobId = event["CodePipeline.job"].id;
        const params = {  
            jobId: jobId  
        await codepipeline.putJobSuccessResult(params).promise();  
        return response;
  5. Add an encrypted environment variable, with TOKEN as the key and the API token as the value.

When you use the AWS CodeStar console to make a code change, commit it to the repository, and complete a build, the build event is sent to SolarWinds Observability and associated with your entity.

Determine the entity type tag name for your entity type

Use the following table to find the entity type tag name for the entity or monitored element that you want to associate with your CodeStar project.

Entity type Entity type tag name
Apache Web Server
AWS API Gateway
AWS ApplicationELB
AWS Aurora Cluster
AWS Aurora Instance
AWS Auto Scaling Group
AWS CloudFront
AWS Elastic Beanstalk
AWS Lambda
AWS NAT Gateway
AWS Transit Gateway
Azure App Service
Azure Blob Storage
Azure Content Delivery Networks (CDN)
Azure Cosmos DB
Azure Event Hubs
Azure Files
Azure FrontDoor
Azure Functions
Azure Key Vaults
Azure Service Bus
Azure SQL Database
Azure Virtual Machines (VM)
Azure VM Scale Sets
database instance
K8s cluster
K8s DaemonSet
K8s Deployment
K8s Namespace
K8s Node
K8s Pod
K8s StatefulSet
network device
network device interface
network device volume