This page describes how to create or update attachment group resources in Google Distributed Cloud (GDC) air-gapped.

An attachment group represents a collection of VLAN attachments that
share access to a set of organizations. An `AttachmentGroup` resource lists
the organizations allowed to use virtual routing and forwarding (VRF) on the
`InterconnectAttachment` resource.

Attachment groups are a required resource in setting up a secure air-gapped connection with high bandwidth and low latency.

This page is for developers within the application operator group who are looking to establish connectivity with interconnects. For more information, see [Audiences for GDC air-gapped documentation](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/audiences.md.txt).

## Before you begin

To create or update an attachment group, you must have the following:

- The necessary identity and access roles. For more information, see [Prepare predefined roles and permissions](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/interconnects/interconnect-overview.md.txt#prepare-roles).

## Create or update an attachment group

To create or update an attachment group, follow these steps:

1. Create a YAML file named `attachmentgroup.yaml`.
2. Add the following content to the file:

   ```yaml
   apiVersion: system.private.gdc.goog/v1alpha1
   kind: AttachmentGroup
   metadata:
     name: attachment-group-IDENTIFIER
     namespace: gpc-system
   spec:
     identifier: IDENTIFIER
     entities:
       - orgName: ORG_NAME
         domainType: DOMAIN_TYPE
   ```
3. Replace the following:

   - `IDENTIFIER`: a unique identifier string for the attachment group. Because VLAN attachments that you create use the `DirectConnect` type, you can choose any unique identifier. For more information, see [Interconnect types](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/interconnects/interconnect-overview.md.txt#interconnect-types).
   - `ORG_NAME`: the name of the tenant organization that all VLAN attachments in the attachment group can connect to. This must be your organization's name.
   - `DOMAIN_TYPE`: the specific domain of the
     tenant organization in the entry that all VLAN attachments can
     connect to. You must provide one of the following valid values:

     - `OrgAdmin`: Connect to the Org Management-plane infrastructure.
     - `OrgData`: Connect to the Org Data-plane infrastructure.
     - `OrgMixed:` Use the `OrgMixed` type to connect to both the Org Management-plane and Org Data-plane infrastructure.
4. Create the attachment group:

   ```bash
   kubectl apply -f attachmentgroup.yaml -n gpc-system
   --kubeconfig=MANAGEMENT_API_SERVER
   ```

   Replace `MANAGEMENT_API_SERVER` with the path to the
   kubeconfig file for the Management API server.
5. Check that the creation of attachment group is successful:

   ```bash
   kubectl get attachmentgroup -n gpc-system
   --kubeconfig=MANAGEMENT_API_SERVER
   ```

   The output returns the attachment group and shows `True` in the `Ready`
   column:

       NAME                     IDENTIFIER       READY
       attachment-group-mixed   mixed            True

## What's next

- [Create a VLAN attachment](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/interconnects/create-vlan-attachment.md.txt)