Back to Infisical

Cloud 66 Sync

docs/integrations/secret-syncs/cloud-66.mdx

0.161.127.3 KB
Original Source

Prerequisites:

<Note> Cloud 66 only applies environment variable changes to your servers on the next deployment. After a sync runs, redeploy the target stack in Cloud 66 for the updated secrets to take effect. System-managed variables (read-only or generated by Cloud 66) are never modified or removed by Infisical. </Note> <Tabs> <Tab title="Infisical UI"> 1. Navigate to **Project** > **Integrations** and select the **Secret Syncs** tab. Click on the **Add Sync** button. ![Secret Syncs Tab](/images/secret-syncs/general/secret-sync-tab.png)
    2. Select the **Cloud 66** option.
    ![Select Cloud 66](/images/secret-syncs/cloud66/step-1.png)

    3. Configure the **Source** from where secrets should be retrieved, then click **Continue**.
    ![Configure Source](/images/secret-syncs/cloud66/step-3.png)

        - **Environment**: The project environment to retrieve secrets from.
        - **Secret Path**: The folder path to retrieve secrets from.

    <Tip>
        If you need to sync secrets from multiple folder locations, check out [secret imports](/documentation/platform/secret-reference#secret-imports).
    </Tip>

    4. Configure the **Destination** to where secrets should be deployed, then click **Continue**.
    ![Configure Destination](/images/secret-syncs/cloud66/step-4.png)

        - **Cloud 66 Connection**: The Cloud 66 Connection to authenticate with.
        - **Stack**: The Cloud 66 stack (application) to sync secrets to.

        <Note>
            Secrets with hyphens are not allowed by Cloud 66, so they are skipped from the sync process.
        </Note>

    5. Configure the **Initial Sync Behavior** to determine how Infisical should resolve the first sync, then click **Continue**.
    ![Configure Initial Sync Behavior](/images/secret-syncs/cloud66/step-5.png)

        - **Overwrite Cloud 66**: On the initial sync, Infisical writes its secrets to Cloud 66 and imports nothing. Depending on your configuration, this can remove secrets from Cloud 66.
        - **Import from Cloud (Prioritize Infisical)**: Imports secrets from Cloud 66 before the initial sync; if a secret with the same name already exists in Infisical, the Infisical value is kept.
        - **Import from Cloud (Prioritize Cloud)**: Imports secrets from Cloud 66 before the initial sync; if a secret with the same name already exists in Infisical, its value is replaced with the one from Cloud 66.

    6. Configure the **Sync Options** to specify how secrets should be synced, then click **Continue**.
    ![Configure Sync Options](/images/secret-syncs/cloud66/step-6.png)

        - **Disable secret deletion**: If enabled, Infisical will not remove secrets from Cloud 66 during a sync. Enable this option if you intend to manage some secrets manually outside of Infisical.
        - **Auto-sync on changes**: If enabled, secrets will automatically be synced from the source location when changes occur. Disable to enforce manual syncing only.
        - **Customize key names**: Add a prefix or suffix so Infisical can identify which keys in Cloud 66 it manages, leaving everything else untouched.
        <Note>
            We highly recommend customizing key names to ensure that Infisical only manages the specific keys you intend, keeping everything else untouched.
        </Note>

    7. Configure the **Details** of your Cloud 66 Sync, then click **Continue**.
    ![Configure Details](/images/secret-syncs/cloud66/step-7.png)

        - **Name**: The name of your sync. Must be slug-friendly.
        - **Description**: An optional description for your sync.

    8. Review your Cloud 66 Sync configuration, then click **Create Sync**.
    ![Review Configuration](/images/secret-syncs/cloud66/step-8.png)

    9. If enabled, your Cloud 66 Sync will begin syncing your secrets to the destination endpoint.
    ![Sync Created](/images/secret-syncs/cloud66/step-9.png)

</Tab>
<Tab title="API">
    To create a **Cloud 66 Sync**, make an API request to the [Create Cloud 66 Sync](/api-reference/endpoints/secret-syncs/cloud-66/create) API endpoint.

    ### Sample request

    ```bash Request
    curl    --request POST \
    --url https://app.infisical.com/api/v1/secret-syncs/cloud-66 \
    --header 'Content-Type: application/json' \
    --data '{
        "name": "my-cloud-66-sync",
        "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "description": "an example sync",
        "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "environment": "dev",
        "secretPath": "/my-secrets",
        "isEnabled": true,
        "syncOptions": {
            "initialSyncBehavior": "overwrite-destination",
            "disableSecretDeletion": true
        },
        "destinationConfig": {
            "stackId": "stack-550e8400-e29b-41d4-a716",
            "stackName": "my-stack"
        }
    }'
    ```

    ### Sample response

    ```bash Response
    {
        "secretSync": {
            "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "name": "my-cloud-66-sync",
            "description": "an example sync",
            "isEnabled": true,
            "version": 1,
            "folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "createdAt": "2023-11-07T05:31:56Z",
            "updatedAt": "2023-11-07T05:31:56Z",
            "syncStatus": "succeeded",
            "lastSyncJobId": "123",
            "lastSyncMessage": null,
            "lastSyncedAt": "2023-11-07T05:31:56Z",
            "importStatus": null,
            "lastImportJobId": null,
            "lastImportMessage": null,
            "lastImportedAt": null,
            "removeStatus": null,
            "lastRemoveJobId": null,
            "lastRemoveMessage": null,
            "lastRemovedAt": null,
            "syncOptions": {
                "initialSyncBehavior": "overwrite-destination",
                "disableSecretDeletion": true
            },
            "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
            "connection": {
                "app": "cloud-66",
                "name": "my-cloud-66-connection",
                "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
            },
            "environment": {
                "slug": "dev",
                "name": "Development",
                "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
            },
            "folder": {
                "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
                "path": "/my-secrets"
            },
            "destination": "cloud-66",
            "destinationConfig": {
                "stackId": "stack-550e8400-e29b-41d4-a716",
                "stackName": "my-stack"
            }
        }
    }
    ```
</Tab>
</Tabs>