gcloud artifacts attachments create

NAME
gcloud artifacts attachments create - creates an Artifact Registry attachment in a repository
SYNOPSIS
gcloud artifacts attachments create(ATTACHMENT :--location=LOCATION--repository=REPOSITORY)--attachment-type=ATTACHMENT_TYPE--files=[FILES,…]--target=TARGET[--attachment-namespace=ATTACHMENT_NAMESPACE][GCLOUD_WIDE_FLAG]
DESCRIPTION
Creates an Artifact Registry attachment in a repository.
EXAMPLES
To create an attachment for targetprojects/myproject/locations/us-central1/packages/mypackage/versions/sha256:123using a file located in/path/to/file/sbom.json:
gcloudartifactsattachmentscreate--target=projects/myproject/locations/us-central1/packages/mypackage/versions/sha256:123--files=/path/to/file/sbom.json
POSITIONAL ARGUMENTS
Attachment resource - The Artifact Registry attachment name. The arguments inthis group can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.

To set theproject attribute:

  • provide the argumentattachment on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

ATTACHMENT
ID of the attachment or fully qualified identifier for the attachment.

To set thename attribute:

  • provide the argumentattachment on the command line.

This positional argument must be specified if any of the other arguments in thisgroup are specified.

--location=LOCATION
Location of the attachment.

To set thelocation attribute:

  • provide the argumentattachment on the command line with a fullyspecified name;
  • provide the argument--location on the command line;
  • set the propertyartifacts/location.
--repository=REPOSITORY
Repository of the attachment.

To set therepository attribute:

  • provide the argumentattachment on the command line with a fullyspecified name;
  • provide the argument--repository on the command line;
  • set the propertyartifacts/repository.
REQUIRED FLAGS
--attachment-type=ATTACHMENT_TYPE
Type of the attachment
--files=[FILES,…]
Comma-seperated list of files that are part of this attachment
--target=TARGET
Target of the attachment, should be fully qualified version name
OPTIONAL FLAGS
--attachment-namespace=ATTACHMENT_NAMESPACE
Namespace of the attachment
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.