import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Description * * ## Example Usage * * ### Developer Connect Insights Config Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * import * as time from "@pulumiverse/time"; * * const project = new gcp.organizations.Project("project", { * projectId: "dci-tf-_3684", * name: "Service Project", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * // Grant Permissions * const apphubPermissions = new gcp.projects.IAMMember("apphub_permissions", { * project: project.projectId, * role: "roles/apphub.admin", * member: "serviceAccount:hashicorp-test-runner@ci-test-project-188019.iam.gserviceaccount.com", * }); * const insightsAgent = new gcp.projects.IAMMember("insights_agent", { * project: project.projectId, * role: "roles/developerconnect.insightsAgent", * member: "serviceAccount:66214305248-compute@developer.gserviceaccount.com", * }); * // Enable APIs * const apphubApiService = new gcp.projects.Service("apphub_api_service", { * project: project.projectId, * service: "apphub.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const containeranalysisApi = new gcp.projects.Service("containeranalysis_api", { * project: project.projectId, * service: "containeranalysis.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const containerscanningApi = new gcp.projects.Service("containerscanning_api", { * project: project.projectId, * service: "containerscanning.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const containerApi = new gcp.projects.Service("container_api", { * project: project.projectId, * service: "container.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const artifactregistryApi = new gcp.projects.Service("artifactregistry_api", { * project: project.projectId, * service: "artifactregistry.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const cloudbuildApi = new gcp.projects.Service("cloudbuild_api", { * project: project.projectId, * service: "cloudbuild.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const cloudassetApi = new gcp.projects.Service("cloudasset_api", { * project: project.projectId, * service: "cloudasset.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const computeApi = new gcp.projects.Service("compute_api", { * project: project.projectId, * service: "compute.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const devconnectApi = new gcp.projects.Service("devconnect_api", { * project: project.projectId, * service: "developerconnect.googleapis.com", * }, { * dependsOn: [project], * }); * // Wait delay after enabling APIs and granting permissions * const waitForPropagation = new time.Sleep("wait_for_propagation", {createDuration: "120s"}, { * dependsOn: [ * apphubPermissions, * insightsAgent, * apphubApiService, * containeranalysisApi, * containerscanningApi, * containerApi, * artifactregistryApi, * artifactregistryApi, * cloudbuildApi, * cloudassetApi, * computeApi, * devconnectApi, * ], * }); * const myApphubApplication = new gcp.apphub.Application("my_apphub_application", { * location: "us-central1", * applicationId: "tf-test-example-application_10719", * scope: { * type: "REGIONAL", * }, * project: project.projectId, * }, { * dependsOn: [waitForPropagation], * }); * const insightsConfig = new gcp.developerconnect.InsightsConfig("insights_config", { * location: "us-central1", * insightsConfigId: "tf-test-ic-apphub-_1443", * project: project.projectId, * annotations: {}, * labels: {}, * appHubApplication: std.format({ * input: "//apphub.googleapis.com/projects/%s/locations/%s/applications/%s", * args: [ * project.number, * myApphubApplication.location, * myApphubApplication.applicationId, * ], * }).then(invoke => invoke.result), * artifactConfigs: [{ * googleArtifactAnalysis: { * projectId: project.projectId, * }, * googleArtifactRegistry: { * artifactRegistryPackage: "my-package", * projectId: project.projectId, * }, * uri: "us-docker.pkg.dev/my-project/my-repo/my-image", * }], * }, { * dependsOn: [waitForPropagation], * }); * ``` * ### Developer Connect Insights Config Projects * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const project = new gcp.organizations.Project("project", { * projectId: "dci-tf-_26032", * name: "Service Project", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * // Grant Permissions * const apphubPermissions = new gcp.projects.IAMMember("apphub_permissions", { * project: project.projectId, * role: "roles/apphub.admin", * member: "serviceAccount:hashicorp-test-runner@ci-test-project-188019.iam.gserviceaccount.com", * }); * const insightsAgent = new gcp.projects.IAMMember("insights_agent", { * project: project.projectId, * role: "roles/developerconnect.insightsAgent", * member: "serviceAccount:66214305248-compute@developer.gserviceaccount.com", * }); * // Enable APIs * const apphubApiService = new gcp.projects.Service("apphub_api_service", { * project: project.projectId, * service: "apphub.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const containeranalysisApi = new gcp.projects.Service("containeranalysis_api", { * project: project.projectId, * service: "containeranalysis.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const containerscanningApi = new gcp.projects.Service("containerscanning_api", { * project: project.projectId, * service: "containerscanning.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const containerApi = new gcp.projects.Service("container_api", { * project: project.projectId, * service: "container.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const artifactregistryApi = new gcp.projects.Service("artifactregistry_api", { * project: project.projectId, * service: "artifactregistry.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const cloudbuildApi = new gcp.projects.Service("cloudbuild_api", { * project: project.projectId, * service: "cloudbuild.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const cloudassetApi = new gcp.projects.Service("cloudasset_api", { * project: project.projectId, * service: "cloudasset.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const computeApi = new gcp.projects.Service("compute_api", { * project: project.projectId, * service: "compute.googleapis.com", * disableDependentServices: true, * }, { * dependsOn: [project], * }); * const devconnectApi = new gcp.projects.Service("devconnect_api", { * project: project.projectId, * service: "developerconnect.googleapis.com", * }, { * dependsOn: [project], * }); * // Wait delay after enabling APIs and granting permissions * const waitForPropagation = new time.Sleep("wait_for_propagation", {createDuration: "120s"}, { * dependsOn: [ * apphubPermissions, * insightsAgent, * apphubApiService, * containeranalysisApi, * containerscanningApi, * containerApi, * artifactregistryApi, * artifactregistryApi, * cloudbuildApi, * cloudassetApi, * computeApi, * devconnectApi, * ], * }); * const insightsConfigProjects = new gcp.developerconnect.InsightsConfig("insights_config_projects", { * location: "us-central1", * insightsConfigId: "tf-test-ic-projects-_8647", * project: project.projectId, * annotations: {}, * labels: {}, * targetProjects: { * projectIds: [pulumi.interpolate`projects/${project.projectId}`], * }, * artifactConfigs: [{ * googleArtifactAnalysis: { * projectId: project.projectId, * }, * googleArtifactRegistry: { * artifactRegistryPackage: "my-package", * projectId: project.projectId, * }, * uri: "us-docker.pkg.dev/my-project/my-repo/my-image", * }], * }, { * dependsOn: [waitForPropagation], * }); * ``` * * ## Import * * InsightsConfig can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/insightsConfigs/{{insights_config_id}}` * * `{{project}}/{{location}}/{{insights_config_id}}` * * `{{location}}/{{insights_config_id}}` * * When using the `pulumi import` command, InsightsConfig can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:developerconnect/insightsConfig:InsightsConfig default projects/{{project}}/locations/{{location}}/insightsConfigs/{{insights_config_id}} * $ pulumi import gcp:developerconnect/insightsConfig:InsightsConfig default {{project}}/{{location}}/{{insights_config_id}} * $ pulumi import gcp:developerconnect/insightsConfig:InsightsConfig default {{location}}/{{insights_config_id}} * ``` */ export declare class InsightsConfig extends pulumi.CustomResource { /** * Get an existing InsightsConfig resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: InsightsConfigState, opts?: pulumi.CustomResourceOptions): InsightsConfig; /** * Returns true if the given object is an instance of InsightsConfig. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is InsightsConfig; /** * User specified annotations. See https://google.aip.dev/148#annotations * for more details such as format and size limitations. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ readonly annotations: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The name of the App Hub Application. * Format: * projects/{project}/locations/{location}/applications/{application} */ readonly appHubApplication: pulumi.Output; /** * The artifact configurations of the artifacts that are deployed. * Structure is documented below. */ readonly artifactConfigs: pulumi.Output; /** * [Output only] Create timestamp */ readonly createTime: pulumi.Output; /** * All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services. */ readonly effectiveAnnotations: pulumi.Output<{ [key: string]: string; }>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * Any errors that occurred while setting up the InsightsConfig. * Each error will be in the format: `field_name: errorMessage`, e.g. * GetAppHubApplication: Permission denied while getting App Hub * application. Please grant permissions to the P4SA. * Structure is documented below. */ readonly errors: pulumi.Output; /** * ID of the requesting InsightsConfig. */ readonly insightsConfigId: pulumi.Output; /** * Set of labels associated with an InsightsConfig. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. */ readonly location: pulumi.Output; /** * Identifier. The name of the InsightsConfig. * Format: * projects/{project}/locations/{location}/insightsConfigs/{insightsConfig} */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * Reconciling (https://google.aip.dev/128#reconciliation). * Set to true if the current state of InsightsConfig does not match the * user's intended state, and the service is actively updating the resource to * reconcile them. This can happen due to user-triggered updates or * system actions like failover or maintenance. */ readonly reconciling: pulumi.Output; /** * The runtime configurations where the application is deployed. * Structure is documented below. */ readonly runtimeConfigs: pulumi.Output; /** * (Output) * The state of the Runtime. * Possible values: * STATE_UNSPECIFIED * LINKED * UNLINKED */ readonly state: pulumi.Output; /** * The projects to track with the InsightsConfig. * Structure is documented below. */ readonly targetProjects: pulumi.Output; /** * [Output only] Update timestamp */ readonly updateTime: pulumi.Output; /** * Create a InsightsConfig resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: InsightsConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering InsightsConfig resources. */ export interface InsightsConfigState { /** * User specified annotations. See https://google.aip.dev/148#annotations * for more details such as format and size limitations. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The name of the App Hub Application. * Format: * projects/{project}/locations/{location}/applications/{application} */ appHubApplication?: pulumi.Input; /** * The artifact configurations of the artifacts that are deployed. * Structure is documented below. */ artifactConfigs?: pulumi.Input[]>; /** * [Output only] Create timestamp */ createTime?: pulumi.Input; /** * All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services. */ effectiveAnnotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Any errors that occurred while setting up the InsightsConfig. * Each error will be in the format: `field_name: errorMessage`, e.g. * GetAppHubApplication: Permission denied while getting App Hub * application. Please grant permissions to the P4SA. * Structure is documented below. */ errors?: pulumi.Input[]>; /** * ID of the requesting InsightsConfig. */ insightsConfigId?: pulumi.Input; /** * Set of labels associated with an InsightsConfig. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. */ location?: pulumi.Input; /** * Identifier. The name of the InsightsConfig. * Format: * projects/{project}/locations/{location}/insightsConfigs/{insightsConfig} */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Reconciling (https://google.aip.dev/128#reconciliation). * Set to true if the current state of InsightsConfig does not match the * user's intended state, and the service is actively updating the resource to * reconcile them. This can happen due to user-triggered updates or * system actions like failover or maintenance. */ reconciling?: pulumi.Input; /** * The runtime configurations where the application is deployed. * Structure is documented below. */ runtimeConfigs?: pulumi.Input[]>; /** * (Output) * The state of the Runtime. * Possible values: * STATE_UNSPECIFIED * LINKED * UNLINKED */ state?: pulumi.Input; /** * The projects to track with the InsightsConfig. * Structure is documented below. */ targetProjects?: pulumi.Input; /** * [Output only] Update timestamp */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a InsightsConfig resource. */ export interface InsightsConfigArgs { /** * User specified annotations. See https://google.aip.dev/148#annotations * for more details such as format and size limitations. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The name of the App Hub Application. * Format: * projects/{project}/locations/{location}/applications/{application} */ appHubApplication?: pulumi.Input; /** * The artifact configurations of the artifacts that are deployed. * Structure is documented below. */ artifactConfigs?: pulumi.Input[]>; /** * ID of the requesting InsightsConfig. */ insightsConfigId: pulumi.Input; /** * Set of labels associated with an InsightsConfig. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. */ location: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The projects to track with the InsightsConfig. * Structure is documented below. */ targetProjects?: pulumi.Input; }