gcloud artifacts attachments create Stay organized with collections Save and categorize content based on your preferences.
- 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 target
projects/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 the
projectattribute:- provide the argument
attachmenton the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
ATTACHMENT- ID of the attachment or fully qualified identifier for the attachment.
To set the
nameattribute:- provide the argument
attachmenton the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--location=LOCATION- Location of the attachment.
To set the
locationattribute:- provide the argument
attachmenton the command line with a fullyspecified name; - provide the argument
--locationon the command line; - set the property
artifacts/location.
- provide the argument
--repository=REPOSITORY- Repository of the attachment.
To set the
repositoryattribute:- provide the argument
attachmenton the command line with a fullyspecified name; - provide the argument
--repositoryon the command line; - set the property
artifacts/repository.
- provide the argument
- provide the argument
- 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.
- 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 helpfor 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.