Criar CICD para sua integração

Este tutorial descreve como automatizar a promoção de uma integração entre diferentes ambientes em diferentes projetos do Google Cloud usando variáveis de configuração (prévia).

Visão geral

Neste tutorial, você vai automatizar implantações do Application Integration usando uma variável de configuração para uma integração de amostra. Esse fluxo de integração de amostra chama uma API e publica a resposta dela em um tópico do Pub/Sub. Este exemplo ilustra o uso das tarefas Chamar endpoint REST e Conectores. É possível armazenar a integração de amostra em repositórios do GitHub que correspondem aos diferentes ambientes e projetos do Google Cloud .

Objetivos

Neste tutorial, mostramos como concluir as seguintes tarefas na sua integração:

  • Crie uma integração.
  • Crie variáveis de configuração e use-as na sua integração.
  • Promova sua integração para outro ambiente.

Custos

Neste tutorial, você vai usar os seguintes componentes faturáveis do Google Cloud:

As instruções deste tutorial foram criadas para manter o uso de recursos dentro dos limites dos Google Cloud recursos sem custo financeiro da nuvem e da oferta de teste.

Ao concluir as tarefas descritas neste documento, é possível evitar o faturamento contínuo excluindo os recursos criados. Para mais informações, consulte Limpeza.

Antes de começar

  1. Faça login na sua conta do Google Cloud . Se você começou a usar o Google Cloud, crie uma conta para avaliar o desempenho de nossos produtos em situações reais. Clientes novos também recebem US$ 300 em créditos para executar, testar e implantar cargas de trabalho.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Secret Manager API, Connectors API APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  5. Create a service account:

    1. Ensure that you have the Create Service Accounts IAM role (roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles.
    2. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    3. Select your project.
    4. In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.

      In the Service account description field, enter a description. For example, Service account for quickstart.

    5. Click Create and continue.
    6. Grant the Pub/Sub Publisher (roles/pubsub.publisher) role to the service account.

      To grant the role, find the Select a role list, then select Pub/Sub Publisher (roles/pubsub.publisher).

    7. Click Continue.
    8. Click Done to finish creating the service account.

  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. Verify that billing is enabled for your Google Cloud project.

  8. Enable the Secret Manager API, Connectors API APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  9. Create a service account:

    1. Ensure that you have the Create Service Accounts IAM role (roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles.
    2. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    3. Select your project.
    4. In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.

      In the Service account description field, enter a description. For example, Service account for quickstart.

    5. Click