@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
624 lines • 24.6 kB
TypeScript
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-_44339",
* 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_34599",
* scope: {
* type: "REGIONAL",
* },
* project: project.projectId,
* }, {
* dependsOn: [waitForPropagation],
* });
* const insightsConfig = new gcp.developerconnect.InsightsConfig("insights_config", {
* location: "us-central1",
* insightsConfigId: "tf-test-ic-apphub-_79513",
* 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-_55500",
* 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-_12223",
* 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<pulumi.ID>, 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<string | undefined>;
/**
* The artifact configurations of the artifacts that are deployed.
* Structure is documented below.
*/
readonly artifactConfigs: pulumi.Output<outputs.developerconnect.InsightsConfigArtifactConfig[] | undefined>;
/**
* [Output only] Create timestamp
*/
readonly createTime: pulumi.Output<string>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* 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<outputs.developerconnect.InsightsConfigError[]>;
/**
* ID of the requesting InsightsConfig.
*/
readonly insightsConfigId: pulumi.Output<string>;
/**
* 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<string>;
/**
* Identifier. The name of the InsightsConfig.
* Format:
* projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* 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<boolean>;
/**
* The runtime configurations where the application is deployed.
* Structure is documented below.
*/
readonly runtimeConfigs: pulumi.Output<outputs.developerconnect.InsightsConfigRuntimeConfig[]>;
/**
* (Output)
* The state of the Runtime.
* Possible values:
* STATE_UNSPECIFIED
* LINKED
* UNLINKED
*/
readonly state: pulumi.Output<string>;
/**
* The projects to track with the InsightsConfig.
* Structure is documented below.
*/
readonly targetProjects: pulumi.Output<outputs.developerconnect.InsightsConfigTargetProjects | undefined>;
/**
* [Output only] Update timestamp
*/
readonly updateTime: pulumi.Output<string>;
/**
* 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<string>;
} | undefined>;
/**
* The name of the App Hub Application.
* Format:
* projects/{project}/locations/{location}/applications/{application}
*/
appHubApplication?: pulumi.Input<string | undefined>;
/**
* The artifact configurations of the artifacts that are deployed.
* Structure is documented below.
*/
artifactConfigs?: pulumi.Input<pulumi.Input<inputs.developerconnect.InsightsConfigArtifactConfig>[] | undefined>;
/**
* [Output only] Create timestamp
*/
createTime?: pulumi.Input<string | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* 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<string>;
} | undefined>;
/**
* 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<string>;
} | undefined>;
/**
* 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<pulumi.Input<inputs.developerconnect.InsightsConfigError>[] | undefined>;
/**
* ID of the requesting InsightsConfig.
*/
insightsConfigId?: pulumi.Input<string | undefined>;
/**
* 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<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.
*/
location?: pulumi.Input<string | undefined>;
/**
* Identifier. The name of the InsightsConfig.
* Format:
* projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
*/
name?: pulumi.Input<string | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* 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<boolean | undefined>;
/**
* The runtime configurations where the application is deployed.
* Structure is documented below.
*/
runtimeConfigs?: pulumi.Input<pulumi.Input<inputs.developerconnect.InsightsConfigRuntimeConfig>[] | undefined>;
/**
* (Output)
* The state of the Runtime.
* Possible values:
* STATE_UNSPECIFIED
* LINKED
* UNLINKED
*/
state?: pulumi.Input<string | undefined>;
/**
* The projects to track with the InsightsConfig.
* Structure is documented below.
*/
targetProjects?: pulumi.Input<inputs.developerconnect.InsightsConfigTargetProjects | undefined>;
/**
* [Output only] Update timestamp
*/
updateTime?: pulumi.Input<string | undefined>;
}
/**
* 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<string>;
} | undefined>;
/**
* The name of the App Hub Application.
* Format:
* projects/{project}/locations/{location}/applications/{application}
*/
appHubApplication?: pulumi.Input<string | undefined>;
/**
* The artifact configurations of the artifacts that are deployed.
* Structure is documented below.
*/
artifactConfigs?: pulumi.Input<pulumi.Input<inputs.developerconnect.InsightsConfigArtifactConfig>[] | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* ID of the requesting InsightsConfig.
*/
insightsConfigId: pulumi.Input<string>;
/**
* 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<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.
*/
location: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* The projects to track with the InsightsConfig.
* Structure is documented below.
*/
targetProjects?: pulumi.Input<inputs.developerconnect.InsightsConfigTargetProjects | undefined>;
}
//# sourceMappingURL=insightsConfig.d.ts.map