Easy ReviewDOP-C02
SDLC Automation32

CodeArtifact

Store software packages and control dependency sources, build authentication, access, and version availability.

Este conteúdo de estudo ainda não foi traduzido, então aparece em inglês. Ajude a traduzir

CodeArtifact stores packages in repositories grouped into domains. These sections explain dependency lookup, origin restrictions, token authentication, cross-account permissions, and version changes that can trigger application pipelines.

Domains and repositories

CodeArtifact stores software packages, bundles of software and the metadataInformation describing a package or version that tools use to find and install it. needed to install them. Repositories provide the package-manager endpointsThe address a package tool connects to for publishing or downloading packages.; their domainThe storage, encryption, and policy boundary that groups CodeArtifact repositories. provides shared assetAn individual file associated with a package version. storage, encryption, and policy controls.

How it works

  1. Create a domain and choose its encryption key in AWS KMS, the service that manages encryption keys. CodeArtifact requires a symmetric keyAn encryption key that uses the same key for encryption and decryption., which uses the same key for encryption and decryption.
  2. Create repositories in the domain. A repositoryA collection of package versions exposed through endpoints for package tools. can hold several supported packageA bundle of software and metadata needed to install it and resolve dependencies. formats, with a name unique in that domain.
  3. Publish or download package versions through repository endpoints, the addresses package tools connect to. An asset is an individual file belonging to a version.
  4. When repositories in the domain share a package version, CodeArtifact updates metadata references. It stores the underlying asset once in the domain.
  5. Apply domain policies to control access across repositories and who can configure public package connections.

Exam cues

  • If the question says share dependencies across repositories without duplicate asset storage, think one domain, because the domain deduplicates assets.
  • If the question says move a repository into a different domain, think fixed membership, because the repository domain cannot be changed after creation.
  • If the question says one repository must serve different package formats, think a mixed-format repository, because supported types can coexist.

Remember

  • One encryption key protects the assets and metadata of a domain.
  • Domain encryption supports symmetric keys only.
  • Repository names are unique within a domain and cannot be changed after creation.

Trap: A connection that imports public packages does not publish your private packages to the public registryAn external package source from which a repository can import dependencies..

Da documentação da AWS (13)
  • A package is software and metadata used to resolve dependencies and install it.
  • A CodeArtifact domain groups repositories and stores their package assets and metadata.
  • A repository contains package versions and exposes endpoints for publishing and downloading them with package tools.
  • A CodeArtifact repository can contain packages of different supported formats.
  • An asset, an individual package file, is stored once per domain even when available through multiple repositories.
  • All assets and metadata in a domain are encrypted with one AWS KMS key.
  • CodeArtifact supports symmetric KMS keys and does not support asymmetric KMS keys for domain encryption.
  • Repository names must be unique within a domain.
  • After creation, a repository cannot change its name, associated AWS account, or domain.
  • Pulling a package from an upstream or copying package versions between repositories in a domain updates metadata without copying assets.
  • A domain policy can control access across repositories and permissions to configure connections to public repositories.
  • CodeArtifact imports packages from public repositories but does not publish private repository packages back to public repositories.
  • Symmetric encryption uses the same key to encrypt and decrypt data.

Upstream repositories

UpstreamA CodeArtifact repository searched for packages missing from a connected downstream repository. repositories let a package managerA tool that installs packages and resolves the dependencies they require. fetch dependencies from several CodeArtifact repositories through one endpointThe address a package tool connects to for publishing or downloading packages.. An external connectionA link that lets a CodeArtifact repository import packages from a public registry. adds a public packageA bundle of software and metadata needed to install it and resolve dependencies. registry to that lookup path.

How it works

  1. Point the package manager, a tool that installs software packages and their dependencies, at the downstream repositoryThe repository through which a client requests packages from its upstream sources. endpoint.
  2. CodeArtifact returns a version held locally. For a missing version, it searches upstream repositories in configured priority order and stops at the first match.
  3. If an upstream owns an external connection, it can import a missing version from the public registryAn external package source from which a repository can import dependencies. when origin controls permit it.
  4. The requesting downstream retains a reference to the fetched version. A public importAdding a package version from a public source to a CodeArtifact repository. is also retained by the repositoryA collection of package versions exposed through endpoints for package tools. with the external connection. Intermediate repositories are not populated by that request.
  5. The retained downstream version survives upstream deletion, disconnection, or edits. If no version is found, the request returns HTTP 404, meaning not found.
Relationship Source Per-repository limit
Direct upstream CodeArtifact repository 10
External connection Public registry 1
Transitive lookup Repositories reached through upstreams 25 searched

Exam cues

  • If the question says expose several dependencyA software package that another package requires to work. sources through one URL, think upstream repositories, because the client uses one downstream endpoint.
  • If the question says deleting an upstream broke a retained version, think independent downstream retention, because the retained reference survives that deletion.
  • If the question says connect several public registries, think separate store repositories used as upstreams, because each repository has only one external connection.

Remember

  • Upstream association needs codeartifact:AssociateWithDownstreamRepository on the upstream.
  • The console adds the relevant -store repository as an upstream for public connections.
  • Origin controls can block public ingestion or internal upstream retention.

Trap: A lookup through an intermediate repository does not automatically retain the fetched version there. Retention occurs in the requesting downstream and, for public imports, the external-connection repository.

Resolve a dependency through upstream repositories
request1search2fetch3Build clientiTeam repositoryiUpstream repoexternal connectioniPublic registryi
  1. The package manager requests a version from its configured CodeArtifact repository.

  2. If it is absent locally, CodeArtifact searches upstreams in configured priority order.

  3. A repository with an external connection can import a missing public version if origin controls allow it; that repository and the requesting downstream retain it.

Detalhes das caixas (4)
Build client

A package manager requests a version from one CodeArtifact repository endpoint.

Team repository

A missing version is searched for in upstream priority order. The requested downstream repository retains a reference to the returned version.

Upstream repo

The repository with the external connection retains imported public versions. A request through a longer chain does not retain the version in intermediate repositories.

Public registry

The external connection imports packages from a public registry. A repository can have one external connection.

Da documentação da AWS (14)
  • Upstream relationships let a client access packages in multiple CodeArtifact repositories through one repository endpoint.
  • A CodeArtifact repository can have at most 10 direct upstream repositories.
  • A CodeArtifact repository can have one external connection to a public repository.
  • CodeArtifact can search at most 25 repositories when resolving a package version through upstream relationships.
  • A requested version already in the repository is returned locally; otherwise CodeArtifact searches its upstream repositories.
  • Upstream priority follows the configured order, and searching stops when the requested version is found.
  • If the requested version is absent from the repository and its upstreams, the client receives HTTP 404 Not Found.
  • A version fetched through upstreams is retained by reference in the requesting downstream repository.
  • Deleting, disconnecting, or modifying the upstream version or repository does not alter the retained downstream version.
  • A downstream request does not retain its fetched version in intermediate repositories in the upstream chain.
  • A version imported from a public registry is also retained in the repository that owns the external connection.
  • Associating an upstream repository requires codeartifact:AssociateWithDownstreamRepository permission on that upstream.
  • The console uses an appropriate -store repository with an external connection and adds that store as an upstream of the selected repository.
  • The Upstream origin control can block retention from internal upstreams and ingestion from public sources.

Authentication tokens

CodeArtifact authorization tokensA temporary value used by package tools to authenticate CodeArtifact requests. let package managersA tool that installs packages and resolves the dependencies they require. authenticate to repositories. AWS credentials obtain the token; the packageA bundle of software and metadata needed to install it and resolve dependencies. tool then uses that token to publish or download packages.

How it works

  1. Give the build IAM role, an identity with assigned permissions, codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken. The STS permission must be granted to the caller, not through a domainThe storage, encryption, and policy boundary that groups CodeArtifact repositories. resource policyA policy attached to a domain or repository specifying who may perform actions on it..
  2. Use aws codeartifact login for a supported tool. It requests a token and sets the repositoryA collection of package versions exposed through endpoints for package tools. endpointThe address a package tool connects to for publishing or downloading packages. and authentication settings. For other tools, obtain a token with get-authorization-token and configure the tool manually.
  3. Allow codeartifact:GetRepositoryEndpoint to discover the endpoint and codeartifact:ReadFromRepository to download packages. Publishing requires additional permissions for the package format.
  4. Choose token duration. When assuming a role, use --duration-seconds 0 if the token must expire with the remaining session. An assumed-role sessionThe temporary period during which credentials for an assumed IAM role remain valid. is the temporary period in which the role’s credentials are valid.
  5. Fetch another token when it expires. For manual configuration, pass it through an environment variableA value supplied to a process that build tools can read for configuration., a value supplied to a process, to avoid storing it in a file.
Operation Required permissions
Request token codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken
Discover endpoint codeartifact:GetRepositoryEndpoint
Download packages codeartifact:ReadFromRepository
Publish package codeartifact:PublishPackageVersion; Maven adds codeartifact:PutPackageMetadata, NuGet adds codeartifact:ReadFromRepository

Exam cues

  • If the question says valid AWS credentials but an unauthorized package request, think token and package-manager configuration, because the tool authenticates with a CodeArtifact token.
  • If the question says a token must expire with its role session, think --duration-seconds 0, because normal token duration is independent of that session.
  • If the question says Maven publishing fails despite PublishPackageVersion, think PutPackageMetadata, because Maven requires both permissions.

Remember

  • Default duration: 12 hours. Nonzero range: 900 to 43200 seconds, or 15 minutes to 12 hours.
  • Root users cannot call GetAuthorizationToken.
  • A domain policy cannot grant sts:GetServiceBearerToken.

Trap: A short role session does not automatically shorten a CodeArtifact token. Select the zero-duration option while assuming the role.

Obtain a token before package requests
request1configure2Build roleAWS credentialsiAuthorization tokenCodeArtifactiPackage managerToken and endpointi
  1. The caller obtains a CodeArtifact authorization token with AWS credentials.

  2. Configure the package manager with the token and repository endpoint.

Detalhes das caixas (3)
Build role

The caller needs CodeArtifact token permission and sts:GetServiceBearerToken in its identity permissions.

Authorization token

The login command retrieves the token and configures a supported package manager.

Package manager

The tool uses the token and repository endpoint to publish or download packages.

Da documentação da AWS (14)
  • Package managers use a CodeArtifact authorization token obtained with AWS credentials to publish or consume packages.
  • The CodeArtifact login command obtains a token and configures a supported package manager with the token and repository endpoint.
  • The get-authorization-token command obtains a token for configuring tools manually.
  • CodeArtifact authorization tokens last 12 hours by default.
  • A nonzero token duration must be 900 to 43200 seconds, equivalent to 15 minutes to 12 hours.
  • A CodeArtifact token normally has a lifetime independent of the assumed-role session that created it.
  • When assuming a role, duration-seconds 0 makes the token expire with the remaining role session.
  • GetAuthorizationToken requires codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken.
  • sts:GetServiceBearerToken must be allowed for the IAM caller; putting it in a domain resource policy has no effect.
  • An AWS account root user cannot call GetAuthorizationToken.
  • Fetching the repository endpoint requires codeartifact:GetRepositoryEndpoint, and downloading packages requires codeartifact:ReadFromRepository.
  • Publishing needs codeartifact:PublishPackageVersion on the package; Maven also needs codeartifact:PutPackageMetadata, and NuGet also needs codeartifact:ReadFromRepository.
  • After a CodeArtifact authorization token expires, the client must fetch another token.
  • AWS recommends passing authorization tokens through environment variables rather than storing them in files that could be exposed or committed.

Package version lifecycle

A CodeArtifact packageA bundle of software and metadata needed to install it and resolve dependencies. version has a status that controls discovery and download access. Use status changes to withdraw a version temporarily; disposal permanently removes its assetsAn individual file associated with a package version..

How it works

  1. Publishing finalizes a version as Published. Generic and Maven packages can first be Unfinished while uploaded assets have not yet been finalized.
  2. Use Unlisted to remove the version from package-manager version lists while preserving downloads. An npm lockfileA file recording resolved dependency versions so later installs can request those versions., which records the chosen dependencyA software package that another package requires to work. versions, can still reference and install it.
  3. Use Archived to block downloads. An uncached build that needs that version fails. Restore availability by changing the status to Published or Unlisted.
  4. Use dispose-package-versions for irreversible deletion of the assets. The version cannot return to a downloadable status.
  5. For dependent application rebuilds, match package-version events in EventBridge and target CodePipeline. Filter the domainThe storage, encryption, and policy boundary that groups CodeArtifact repositories. and repositoryA collection of package versions exposed through endpoints for package tools., and grant the target role permission to start the pipeline.
Status Package-manager discovery and downloads
Published Listed and downloadable
Unfinished Uploaded but not finalized; available for generic and Maven publishing workflows
Unlisted Not listed, but downloadable by an existing reference
Archived Not listed and not downloadable; status can be restored
Disposed Assets permanently deleted; cannot restore status

Exam cues

  • If the question says hide a version from resolution while preserving pinned npm installs, think Unlisted, because a lockfile can still download it.
  • If the question says stop downloads but keep a reversible withdrawal, think Archived, because its status can return to Published or Unlisted.
  • If the question says rebuild dependent applications when packages change, think EventBridge to CodePipeline, because CodeArtifact emits package-version state-change events.

Remember

  • update-package-versions-status targets Published, Unlisted, or Archived. A published version cannot return to Unfinished.
  • Event source: aws.codeartifact. Detail type: CodeArtifact Package Version State Change.
  • Events include creation, modification, and deletion, as well as upstreamA CodeArtifact repository searched for packages missing from a connected downstream repository. retention and public ingestionAdding a package version from a public source to a CodeArtifact repository..

Trap: Unlisted still permits downloads. Archived blocks them; Disposed deletes the assets permanently.

Trap: Publishing different content under an existing asset name requires deleting the package version first. A status change does not overwrite the asset.

Package event starts a dependent pipeline
event1start2Package changeCodeArtifactiEvent ruleEventBridgeiDependent pipelineCodePipelinei
  1. CodeArtifact emits the event and EventBridge matches the configured rule.

  2. EventBridge starts the target CodePipeline using its permitted target role.

Detalhes das caixas (3)
Package change

Creation, modification, or deletion emits a package-version state-change event.

Event rule

Match aws.codeartifact and the package-version detail type; filter the domain and repository.

Dependent pipeline

The EventBridge target role permits starting the pipeline that rebuilds the dependent application.

Da documentação da AWS (16)
  • A package version status controls whether clients can discover or download the version.
  • Published versions appear in package-manager version lists and their assets are downloadable.
  • Unfinished indicates uploaded assets not yet finalized; generic and Maven packages can have this status.
  • Unlisted versions are omitted from package-manager version lists but their assets remain downloadable.
  • An Unlisted npm version referenced by package-lock.json can still be downloaded and installed with npm ci.
  • Archived versions are neither listed to package managers nor downloadable; uncached builds depending on them fail.
  • An Archived version can return to Published or Unlisted using UpdatePackageVersionsStatus.
  • Disposing permanently deletes a version's assets, so it cannot return to Archived, Unlisted, or Published.
  • update-package-versions-status sets Published, Unlisted, or Archived; dispose-package-versions performs irreversible disposal.
  • Once published, a package version cannot return to Unfinished.
  • An existing package asset cannot be republished with different content unless its package version is deleted first.
  • CodeArtifact emits package-version events for creation, modification, and deletion, including downstream retention and external imports.
  • Package-version EventBridge events use source aws.codeartifact and detail-type CodeArtifact Package Version State Change.
  • An EventBridge rule can match CodeArtifact package events and start CodePipeline to run a dependent application pipeline.
  • The EventBridge rule can filter CodeArtifact events by domainName, domainOwner, and repositoryName.
  • The EventBridge pipeline target requires an IAM role granting permission to start the target pipeline.

Package origin controls

PackageA bundle of software and metadata needed to install it and resolve dependencies. origin controls decide how new versions can enter a CodeArtifact repositoryA collection of package versions exposed through endpoints for package tools.. They reduce dependency substitutionConsumption of a public package in place of an intended internal package with the same name. risk, where a public package with an internal package’s name is consumed in its place.

How it works

  1. Set the package publish control to ALLOW or BLOCK for direct publishing by package tools.
  2. Set upstream to ALLOW or BLOCK for both retaining versions from internal upstreamsA CodeArtifact repository searched for packages missing from a connected downstream repository. and importing public versions.
  3. Check the associated package groupA set of packages matched by format, namespace, and name patterns for shared configuration., a set of packages matched by format, namespaceA prefix that organizes related package names, such as an npm scope or Maven group ID. (a prefix grouping related package names), and name patterns. Its restrictions can separately control direct publishing, public importsAdding a package version from a public source to a CodeArtifact repository., and internal upstreams.
  4. Evaluate both layers. A BLOCK at either layer defeats an ALLOW at the other.
Package-group restriction Entry path
PUBLISH Direct publishing
EXTERNAL_UPSTREAM Public registryAn external package source from which a repository can import dependencies. import
INTERNAL_UPSTREAM Internal upstream retention

Each group restriction supports ALLOW, BLOCK, ALLOW_SPECIFIC_REPOSITORIES, or INHERIT. The last option takes its setting from a parent group.

Exam cues

  • If the question says a public package collides with an internal name, think Publish allow and Upstream block, because the package must remain locally published without importing a same-name version.
  • If the question says package-level Allow still rejects a publish, think package-group restrictions, because a group Block takes precedence.
  • If the question says keep internal upstreams but reject public packages, think separate group restrictions, because package-level Upstream covers both paths.

Remember

  • When every group restriction allows entry, first direct publication defaults to Publish allow / Upstream block; first public import defaults to Publish block / Upstream allow.
  • A group with a Block or allow-specific-repositories restriction gives the package Allow / Allow defaults, leaving group restrictions effective.
  • Older packages from before around May 2022 can retain Allow / Allow. New defaults began enforcement in July 2022.

Trap: First-arrival defaults are conditional. Inspect both package and package-group controls before assuming a package is protected.

Da documentação da AWS (13)
  • Package origin controls limit how versions enter a repository to reduce dependency substitution risk.
  • Dependency substitution can occur when a same-name public package is consumed in place of an internal package.
  • The package publish control uses ALLOW or BLOCK to permit or reject direct publishing.
  • The package upstream control uses ALLOW or BLOCK for both internal upstream retention and public package ingestion.
  • When all associated package-group restrictions allow entry, a first directly published version defaults to Publish ALLOW and Upstream BLOCK.
  • When all associated package-group restrictions allow entry, a first public import defaults to Publish BLOCK and Upstream ALLOW.
  • When an associated package group has a BLOCK or ALLOW_SPECIFIC_REPOSITORIES restriction, package defaults are Publish ALLOW and Upstream ALLOW.
  • A BLOCK in package or package-group origin controls overrides an ALLOW in the other.
  • Package groups match package format, namespace, and name patterns to apply controls across multiple packages.
  • Package groups distinguish direct PUBLISH, public EXTERNAL_UPSTREAM, and internal INTERNAL_UPSTREAM entry.
  • Package-group restrictions support ALLOW, BLOCK, ALLOW_SPECIFIC_REPOSITORIES, and INHERIT from a parent group.
  • Packages existing before around May 2022 can have both package origin controls set to ALLOW and need manual changes; new defaults were enforced when origin controls launched in July 2022.
  • A package namespace groups related package names, such as an npm scope or Maven group ID.

Cross-account access

CodeArtifact resource policies let another account use a domainThe storage, encryption, and policy boundary that groups CodeArtifact repositories. or repositoryA collection of package versions exposed through endpoints for package tools.. A resource policyA policy attached to a domain or repository specifying who may perform actions on it. states which principalsThe user, role, or other actor making a request., meaning users or roles making requests, may act on that resource; the caller’s identity policyA policy attached to a caller identity that grants its permitted actions. grants its own permissions.

How it works

  1. Identify the domain owner with --domain-owner. The same domain name can exist under another account.
  2. Grant the external caller codeartifact:GetAuthorizationToken on the domain. Its identity permissions must also allow sts:GetServiceBearerToken.
  3. Allow endpointThe address a package tool connects to for publishing or downloading packages. discovery with codeartifact:GetRepositoryEndpoint and downloads with codeartifact:ReadFromRepository. A domain policy can grant repository actions, or the repository policy can grant them locally.
  4. For a caller outside both the domain owner and the repository administrator account (the account that created the repository), ensure its identity policy also allows the requested actions. An Allow in either resource policy suffices on that side; any applicable explicit Deny wins.
  5. Use aws:PrincipalOrgID in the domain policy when the resource-side grant should cover only a specified organization.

Exam cues

  • If the question says the external build has identity permissions but no domain token grant, think domain resource policy, because token access must be allowed on the shared domain.
  • If the question says the repository policy omits an action allowed by the domain policy, think resource-policy union, because one resource-side Allow can suffice.
  • If the question says permit reads of only selected packages in a repository, think separate repository boundaries, because ReadFromRepository is not package-scoped.

Remember

  • Cross-account external caller: identity Allow plus resource Allow, with no explicit Deny.
  • Domain token permission and repository download permission cover different operations.
  • Creating a repository in another account’s domain needs codeartifact:CreateRepository on that domain.

Trap: Repository and domain policies are not two mandatory Allow checklists for every repository operation. A domain policy can grant repository access, but it cannot grant the caller’s STS bearer-token permission.

External caller: token, endpoint, then download
get token1read2External buildCaller identity policyiDomain tokenOwner resource policyiRepository readEndpoint and packagesi
  1. The external caller requests a token using domain permission and its identity grants.

  2. The caller discovers the endpoint and downloads packages with the required resource and identity permissions.

Detalhes das caixas (3)
External build

Allow the CodeArtifact operations and sts:GetServiceBearerToken in the caller account.

Domain token

Grant GetAuthorizationToken on the domain and identify its owner account.

Repository read

Allow endpoint discovery and reads through the domain or repository resource policy. Explicit Deny wins.

Da documentação da AWS (12)
  • A caller outside the domain-owner and repository-administrator accounts needs both an identity-policy Allow and a resource-policy Allow for cross-account access.
  • Accessing packages across accounts requires GetAuthorizationToken permission on the domain resource.
  • A domain resource policy can grant permissions on the domain and on repositories and packages within it.
  • For repository actions, an explicit Allow in either the domain policy or repository policy is sufficient on the resource-policy side.
  • An explicit Deny in a CodeArtifact domain, repository, or other applicable policy overrides an Allow.
  • ReadFromRepository grants download access at repository scope and cannot be restricted to selected package ARNs.
  • A caller retrieving a CodeArtifact repository endpoint needs codeartifact:GetRepositoryEndpoint.
  • The caller must have sts:GetServiceBearerToken in its identity permissions; a domain policy cannot grant that action.
  • Accessing a CodeArtifact domain owned by another account requires its owner account ID, supplied as domain-owner in CLI requests.
  • A domain policy can use aws:PrincipalOrgID to limit its grants to principals in the specified organization.
  • Creating a repository in another account's domain requires codeartifact:CreateRepository permission on that domain.
  • A CodeArtifact repository is associated with the AWS account used to create it, which is its administrator account.

Flashcards

toque para virar
Resposta

·

Todos os 32 flashcards em lista

What does a CodeArtifact domain provide for its repositories?

A shared storage and policy boundary. Each asset is stored once in the domain, and assets and metadata use one symmetric KMS key. Repository names are unique within the domain.

Two teams need the same dependency in separate CodeArtifact repositories without duplicating its asset storage. What boundary should they share?

Use repositories in the same domain. Assets are deduplicated within that domain.

A team wants to move an existing CodeArtifact repository into another domain. Can it change the repository domain?

No. A repository cannot change domains after creation.

A team publishes an internal package to CodeArtifact, whose repository can fetch public dependencies. Will CodeArtifact publish that internal package to the public registry?

No. External package importing does not publish private CodeArtifact packages back to a public registry.

How do CodeArtifact upstream repositories differ from external connections?

Upstreams are CodeArtifact repositories exposed through one downstream endpoint. An external connection imports from a public registry. A repository supports up to 10 direct upstreams and one external connection.

A CodeArtifact client requests a public package through downstream A, intermediate B, and C with the external connection. Which repositories retain the fetched version?

A and C. The request retains a reference in the requesting downstream and the repository with the external connection, but does not populate intermediate B.

A CodeArtifact upstream package is deleted after a team repository has already fetched it. Can the team repository still serve its retained version?

Yes. Upstream deletion does not remove the retained downstream version.

Two CodeArtifact upstreams contain the same requested package version. Which upstream supplies it?

The first match in configured upstream priority order. Searching stops when the version is found.

Does the 10-upstream limit mean CodeArtifact can search only 10 repositories for a package version?

No. It permits 10 direct upstreams and searches at most 25 repositories through the upstream graph.

A build job has valid AWS credentials but npm cannot authenticate to CodeArtifact. What should the job configure?

Obtain a CodeArtifact authorization token and configure the package manager endpoint. The login command performs both for supported tools; renew the token after expiry.

Which permissions does requesting a CodeArtifact authorization token require?

codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken. The STS action must be allowed for the IAM caller; root users cannot request the token.

A CodeArtifact token is created with default settings during a 15-minute assumed-role session. How long does that token last?

12 hours by default. To expire it with the remaining role session, request duration-seconds 0.

A cross-account build needs a CodeArtifact token that expires with its assumed-role session. Which permissions and duration setting apply?

Allow codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken, then request duration-seconds 0 while assuming the role.

Which AWS permissions support a build that gets a CodeArtifact token, discovers its repository endpoint, and downloads packages?

codeartifact:GetAuthorizationToken, sts:GetServiceBearerToken, codeartifact:GetRepositoryEndpoint, and codeartifact:ReadFromRepository.

A CodeArtifact domain policy allows sts:GetServiceBearerToken, but a build still cannot request its token. Where must that STS permission be granted?

In the caller identity permissions. A domain resource policy cannot grant the STS action.

What CodeArtifact token lifetime can be requested without the assumed-role zero-duration option?

900 to 43200 seconds, or 15 minutes to 12 hours. The default is 12 hours.

Does codeartifact:PublishPackageVersion alone cover every CodeArtifact package format?

No. Maven also requires codeartifact:PutPackageMetadata; NuGet also requires codeartifact:ReadFromRepository.

A CodeArtifact dependency was Archived and an uncached build can no longer download it. How can access be restored?

Change its status to Published or Unlisted with UpdatePackageVersionsStatus. Archived assets remain stored but cannot be downloaded.

A team disposed of a CodeArtifact package version and wants to restore its status for a build. Can it reverse disposal?

No. Disposal permanently deletes the assets and cannot be reversed by changing status.

An npm dependency is Unlisted in CodeArtifact but remains pinned in package-lock.json. Can npm ci install it?

Yes. Unlisted versions remain downloadable even though package-manager version lists omit them.

A team wants CodeArtifact version changes to trigger a dependent application rebuild automatically. What event flow should it configure?

Match CodeArtifact Package Version State Change events with an EventBridge rule, filter the relevant domain and repository, and target CodePipeline with an execution role that permits starting it.

Can a team publish different content under an existing CodeArtifact package asset name without deleting the package version first?

No. Existing assets can be republished only with identical content. Different content requires deleting the version first.

Which command irreversibly disposes a CodeArtifact version, and can update-package-versions-status return it to Unfinished?

Use dispose-package-versions for disposal. A published version cannot return to Unfinished.

An internal package name also exists in a public registry reachable from CodeArtifact. Which package origin settings protect the internal name?

Set Publish to ALLOW and Upstream to BLOCK. Upstream BLOCK prevents public ingestion and internal upstream retention for that package.

A CodeArtifact package allows publishing, but its package group blocks publishing. Can a client publish a new version?

No. BLOCK wins across package and package-group controls.

A CodeArtifact team must allow internal upstream dependencies while blocking public imports for a package group. Which restriction types separate those paths?

Allow INTERNAL_UPSTREAM and block EXTERNAL_UPSTREAM. Package-level Upstream combines both paths, while package groups distinguish them.

Do CodeArtifact first-version origin defaults apply unconditionally to every package?

No. They depend on associated package-group restrictions. With every group restriction allowing entry, direct-first means Publish ALLOW / Upstream BLOCK, while public-first gives the reverse.

How can a build in an external account download from a CodeArtifact repository?

Grant token access on the domain, endpoint discovery and repository reads through applicable resource policies, and corresponding identity permissions in the caller account. Grant sts:GetServiceBearerToken to the caller and pass domain-owner.

A CodeArtifact repository policy omits ReadFromRepository, but the domain policy allows it for an external caller. Is a second resource-policy Allow required?

No. The domain Allow is sufficient on the resource-policy side. The external caller still needs identity permission, and an explicit Deny overrides the grant.

A CodeArtifact administrator wants to allow downloads of just one package by using that package ARN with ReadFromRepository. Will that scope work?

No. ReadFromRepository applies to a repository. Use a repository boundary when package downloads need separate access.

A cross-account CodeArtifact request supplies the domain name but does not identify the owning account. Which CLI argument is required?

--domain-owner with the account ID of the domain owner.

Which CodeArtifact domain-policy condition can restrict a resource-policy grant to accounts in one AWS organization?

aws:PrincipalOrgID. External callers still need identity permissions for the requested actions.

Você concluiu todos os tópicos da DOP-C02!

Seu badge ficou dourado. Próximo passo: agendar a prova na AWS. Depois de passar, adicione-se ao Quem passou.

Compartilhar

Conte que você concluiu esta certificação

Concluí todos os tópicos da AWS Certified DevOps Engineer - Professional (DOP-C02) no Easy Review. Venha estudar também!