Table: aws_codeartifact_repository - Query AWS CodeArtifact Repository using SQL
The AWS CodeArtifact Repository is a fully managed software artifact repository service that makes it easier for organizations to securely store, publish, and share packages used in their software development process. AWS CodeArtifact eliminates the need for you to set up, operate, and scale the infrastructure for your artifact repositories, allowing you to focus on your software development. It works with commonly used package managers and build tools, and it integrates with CI/CD pipelines to seamlessly publish packages.
Table Usage Guide
The aws_codeartifact_repository
table in Steampipe provides you with information about repositories within AWS CodeArtifact. This table allows you, as a DevOps engineer, to query repository specific details, including the repository's domain owner, domain name, repository name, administrator account, and associated metadata. You can utilize this table to gather insights on repositories, such as their ownership, associated domains, and more. The schema outlines the various attributes of the CodeArtifact repository for you, including the ARN, repository description, domain owner, domain name, and associated tags.
Examples
Basic info
Explore which AWS CodeArtifact repositories are owned by different domain owners and identify instances where specific tags and upstreams are used. This can help in gaining insights into the organization and management of your AWS resources.
select arn, domain_name, domain_owner, upstreams, tagsfrom aws_codeartifact_repository;
select arn, domain_name, domain_owner, upstreams, tagsfrom aws_codeartifact_repository;
List repositories with endpoints
Identify instances where repositories have specified endpoints. This could be useful in managing and organizing your AWS CodeArtifact repositories, by focusing on those repositories that have assigned endpoints.
select arn, domain_name, domain_owner, tags, repository_endpointfrom aws_codeartifact_repositorywhere repository_endpoint is not null;
select arn, domain_name, domain_owner, tags, repository_endpointfrom aws_codeartifact_repositorywhere repository_endpoint is not null;
List repository policy statements that grant external access
This example is used to identify any repository policy statements in the AWS CodeArtifact service that may be granting access to external entities. This is useful for auditing security and ensuring that no unauthorized access is being permitted.
select arn, p as principal, a as action, s ->> 'Effect' as effectfrom aws_codeartifact_repository, jsonb_array_elements(policy_std -> 'Statement') as s, jsonb_array_elements_text(s -> 'Principal' -> 'AWS') as p, string_to_array(p, ':') as pa, jsonb_array_elements_text(s -> 'Action') as awhere s ->> 'Effect' = 'Allow' and ( pa [ 5 ] != account_id or p = '*' );
Error: The corresponding SQLite query is unavailable.
Get upstream package details associated with each repository
Analyze the settings to understand the association between each repository and its corresponding upstream package details in the AWS CodeArtifact service. This can aid in managing dependencies and ensuring the correct version of a package is being used.
select arn, domain_name, domain_owner, u ->> 'RepositoryName' as upstream_repo_namefrom aws_codeartifact_repository, jsonb_array_elements(upstreams) u;
select arn, domain_name, domain_owner, json_extract(u.value, '$.RepositoryName') as upstream_repo_namefrom aws_codeartifact_repository, json_each(upstreams) u;
Schema for aws_codeartifact_repository
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
administrator_account | text | The Amazon Web Services account ID that manages the repository. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The Amazon Resource Name (ARN) specifying the repository. | |
description | text | The description of the repository. | |
domain_name | text | = | The name of the domain that contains the repository. |
domain_owner | text | = | The 12-digit account number of the Amazon Web Services account that owns the repository. It does not include dashes or spaces. |
external_connections | jsonb | An array of external connections associated with the repository. | |
name | text | = | The name of the repository. |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
policy | jsonb | An CodeArtifact resource policy that contains a resource ARN, document details, and a revision. | |
policy_std | jsonb | Contains the contents of the resource-based policy in a canonical form for easier searching. | |
region | text | The AWS Region in which the resource is located. | |
repository_endpoint | jsonb | A string that specifies the URL of the returned endpoint. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags assigned to the resource. | |
title | text | Title of the resource. | |
upstreams | jsonb | A list of upstream repositories to associate with the repository. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_codeartifact_repository