@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
530 lines (529 loc) • 20.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* An Anthos cluster running on customer owned infrastructure.
*
* To get more information about Cluster, see:
*
* * [API documentation](https://cloud.google.com/anthos/clusters/docs/multi-cloud/reference/rest)
* * How-to Guides
* * [API reference](https://cloud.google.com/anthos/clusters/docs/multi-cloud/reference/rest/v1/projects.locations.attachedClusters)
* * [Multicloud overview](https://cloud.google.com/anthos/clusters/docs/multi-cloud)
*
* ## Example Usage
*
* ### Container Attached Cluster Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const versions = project.then(project => gcp.container.getAttachedVersions({
* location: "us-west1",
* project: project.projectId,
* }));
* const primary = new gcp.container.AttachedCluster("primary", {
* name: "basic",
* location: "us-west1",
* project: project.then(project => project.projectId),
* description: "Test cluster",
* distribution: "aks",
* oidcConfig: {
* issuerUrl: "https://oidc.issuer.url",
* },
* platformVersion: versions.then(versions => versions.validVersions?.[0]),
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* });
* ```
* ### Container Attached Cluster Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
*
* const project = gcp.organizations.getProject({});
* const versions = project.then(project => gcp.container.getAttachedVersions({
* location: "us-west1",
* project: project.projectId,
* }));
* const primary = new gcp.container.AttachedCluster("primary", {
* name: "basic",
* project: project.then(project => project.projectId),
* location: "us-west1",
* description: "Test cluster",
* distribution: "aks",
* annotations: {
* "label-one": "value-one",
* },
* authorization: {
* adminUsers: [
* "user1@example.com",
* "user2@example.com",
* ],
* adminGroups: [
* "group1@example.com",
* "group2@example.com",
* ],
* },
* oidcConfig: {
* issuerUrl: "https://oidc.issuer.url",
* jwks: std.base64encode({
* input: "{\"keys\":[{\"use\":\"sig\",\"kty\":\"RSA\",\"kid\":\"testid\",\"alg\":\"RS256\",\"n\":\"somedata\",\"e\":\"AQAB\"}]}",
* }).then(invoke => invoke.result),
* },
* platformVersion: versions.then(versions => versions.validVersions?.[0]),
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* loggingConfig: {
* componentConfig: {
* enableComponents: [
* "SYSTEM_COMPONENTS",
* "WORKLOADS",
* ],
* },
* },
* monitoringConfig: {
* managedPrometheusConfig: {
* enabled: true,
* },
* },
* binaryAuthorization: {
* evaluationMode: "PROJECT_SINGLETON_POLICY_ENFORCE",
* },
* proxyConfig: {
* kubernetesSecret: {
* name: "proxy-config",
* namespace: "default",
* },
* },
* });
* ```
* ### Container Attached Cluster Ignore Errors
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const versions = project.then(project => gcp.container.getAttachedVersions({
* location: "us-west1",
* project: project.projectId,
* }));
* const primary = new gcp.container.AttachedCluster("primary", {
* name: "basic",
* location: "us-west1",
* project: project.then(project => project.projectId),
* description: "Test cluster",
* distribution: "aks",
* oidcConfig: {
* issuerUrl: "https://oidc.issuer.url",
* },
* platformVersion: versions.then(versions => versions.validVersions?.[0]),
* fleet: {
* project: project.then(project => `projects/${project.number}`),
* },
* deletionPolicy: "DELETE_IGNORE_ERRORS",
* });
* ```
*
* ## Import
*
* Cluster can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/attachedClusters/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:container/attachedCluster:AttachedCluster default projects/{{project}}/locations/{{location}}/attachedClusters/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:container/attachedCluster:AttachedCluster default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:container/attachedCluster:AttachedCluster default {{location}}/{{name}}
* ```
*/
export declare class AttachedCluster extends pulumi.CustomResource {
/**
* Get an existing AttachedCluster 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?: AttachedClusterState, opts?: pulumi.CustomResourceOptions): AttachedCluster;
/**
* Returns true if the given object is an instance of AttachedCluster. 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 AttachedCluster;
/**
* Optional. Annotations on the cluster. This field has the same restrictions as Kubernetes annotations. The total size of
* all keys and values combined is limited to 256k. Key can have 2 segments: prefix (optional) and name (required),
* separated by a slash (/). Prefix must be a DNS subdomain. Name must be 63 characters or less, begin and end with
* alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics between. **Note**: This field is
* non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field
* 'effective_annotations' for all of the annotations present on the resource.
*/
readonly annotations: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Configuration related to the cluster RBAC settings.
*/
readonly authorization: pulumi.Output<outputs.container.AttachedClusterAuthorization | undefined>;
/**
* Binary Authorization configuration.
*/
readonly binaryAuthorization: pulumi.Output<outputs.container.AttachedClusterBinaryAuthorization>;
/**
* Output only. The region where this cluster runs.
* For EKS clusters, this is an AWS region. For AKS clusters,
* this is an Azure region.
*/
readonly clusterRegion: pulumi.Output<string>;
/**
* Output only. The time at which this cluster was created.
*/
readonly createTime: pulumi.Output<string>;
/**
* Policy to determine what flags to send on delete. Possible values: DELETE, DELETE_IGNORE_ERRORS
*/
readonly deletionPolicy: pulumi.Output<string | undefined>;
/**
* A human readable description of this attached cluster. Cannot be longer than 255 UTF-8 encoded bytes.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The Kubernetes distribution of the underlying attached cluster. Supported values:
* "eks", "aks", "generic". The generic distribution provides the ability to register
* or migrate any CNCF conformant cluster.
*/
readonly distribution: pulumi.Output<string>;
readonly effectiveAnnotations: pulumi.Output<{
[key: string]: string;
}>;
/**
* A set of errors found in the cluster.
* Structure is documented below.
*/
readonly errors: pulumi.Output<outputs.container.AttachedClusterError[]>;
/**
* Fleet configuration.
* Structure is documented below.
*/
readonly fleet: pulumi.Output<outputs.container.AttachedClusterFleet>;
/**
* The Kubernetes version of the cluster.
*/
readonly kubernetesVersion: pulumi.Output<string>;
/**
* The location for the resource
*/
readonly location: pulumi.Output<string>;
/**
* Logging configuration.
*/
readonly loggingConfig: pulumi.Output<outputs.container.AttachedClusterLoggingConfig | undefined>;
/**
* Monitoring configuration.
*/
readonly monitoringConfig: pulumi.Output<outputs.container.AttachedClusterMonitoringConfig>;
/**
* The name of this resource.
*/
readonly name: pulumi.Output<string>;
/**
* OIDC discovery information of the target cluster.
* Kubernetes Service Account (KSA) tokens are JWT tokens signed by the cluster
* API server. This fields indicates how GCP services
* validate KSA tokens in order to allow system workloads (such as GKE Connect
* and telemetry agents) to authenticate back to GCP.
* Both clusters with public and private issuer URLs are supported.
* Clusters with public issuers only need to specify the `issuerUrl` field
* while clusters with private issuers need to provide both
* `issuerUrl` and `jwks`.
* Structure is documented below.
*/
readonly oidcConfig: pulumi.Output<outputs.container.AttachedClusterOidcConfig>;
/**
* The platform version for the cluster (e.g. `1.23.0-gke.1`).
*/
readonly platformVersion: pulumi.Output<string>;
readonly project: pulumi.Output<string>;
/**
* Support for proxy configuration.
*/
readonly proxyConfig: pulumi.Output<outputs.container.AttachedClusterProxyConfig | undefined>;
/**
* If set, there are currently changes in flight to the cluster.
*/
readonly reconciling: pulumi.Output<boolean>;
/**
* Enable/Disable Security Posture API features for the cluster.
*
* @deprecated `securityPostureConfig` is deprecated and will be removed in a future major release.
*/
readonly securityPostureConfig: pulumi.Output<outputs.container.AttachedClusterSecurityPostureConfig>;
/**
* The current state of the cluster. Possible values:
* STATE_UNSPECIFIED, PROVISIONING, RUNNING, RECONCILING, STOPPING, ERROR,
* DEGRADED
*/
readonly state: pulumi.Output<string>;
/**
* A globally unique identifier for the cluster.
*/
readonly uid: pulumi.Output<string>;
/**
* The time at which this cluster was last updated.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Workload Identity settings.
* Structure is documented below.
*/
readonly workloadIdentityConfigs: pulumi.Output<outputs.container.AttachedClusterWorkloadIdentityConfig[]>;
/**
* Create a AttachedCluster 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: AttachedClusterArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AttachedCluster resources.
*/
export interface AttachedClusterState {
/**
* Optional. Annotations on the cluster. This field has the same restrictions as Kubernetes annotations. The total size of
* all keys and values combined is limited to 256k. Key can have 2 segments: prefix (optional) and name (required),
* separated by a slash (/). Prefix must be a DNS subdomain. Name must be 63 characters or less, begin and end with
* alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics between. **Note**: This field is
* non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field
* 'effective_annotations' for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Configuration related to the cluster RBAC settings.
*/
authorization?: pulumi.Input<inputs.container.AttachedClusterAuthorization>;
/**
* Binary Authorization configuration.
*/
binaryAuthorization?: pulumi.Input<inputs.container.AttachedClusterBinaryAuthorization>;
/**
* Output only. The region where this cluster runs.
* For EKS clusters, this is an AWS region. For AKS clusters,
* this is an Azure region.
*/
clusterRegion?: pulumi.Input<string>;
/**
* Output only. The time at which this cluster was created.
*/
createTime?: pulumi.Input<string>;
/**
* Policy to determine what flags to send on delete. Possible values: DELETE, DELETE_IGNORE_ERRORS
*/
deletionPolicy?: pulumi.Input<string>;
/**
* A human readable description of this attached cluster. Cannot be longer than 255 UTF-8 encoded bytes.
*/
description?: pulumi.Input<string>;
/**
* The Kubernetes distribution of the underlying attached cluster. Supported values:
* "eks", "aks", "generic". The generic distribution provides the ability to register
* or migrate any CNCF conformant cluster.
*/
distribution?: pulumi.Input<string>;
effectiveAnnotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A set of errors found in the cluster.
* Structure is documented below.
*/
errors?: pulumi.Input<pulumi.Input<inputs.container.AttachedClusterError>[]>;
/**
* Fleet configuration.
* Structure is documented below.
*/
fleet?: pulumi.Input<inputs.container.AttachedClusterFleet>;
/**
* The Kubernetes version of the cluster.
*/
kubernetesVersion?: pulumi.Input<string>;
/**
* The location for the resource
*/
location?: pulumi.Input<string>;
/**
* Logging configuration.
*/
loggingConfig?: pulumi.Input<inputs.container.AttachedClusterLoggingConfig>;
/**
* Monitoring configuration.
*/
monitoringConfig?: pulumi.Input<inputs.container.AttachedClusterMonitoringConfig>;
/**
* The name of this resource.
*/
name?: pulumi.Input<string>;
/**
* OIDC discovery information of the target cluster.
* Kubernetes Service Account (KSA) tokens are JWT tokens signed by the cluster
* API server. This fields indicates how GCP services
* validate KSA tokens in order to allow system workloads (such as GKE Connect
* and telemetry agents) to authenticate back to GCP.
* Both clusters with public and private issuer URLs are supported.
* Clusters with public issuers only need to specify the `issuerUrl` field
* while clusters with private issuers need to provide both
* `issuerUrl` and `jwks`.
* Structure is documented below.
*/
oidcConfig?: pulumi.Input<inputs.container.AttachedClusterOidcConfig>;
/**
* The platform version for the cluster (e.g. `1.23.0-gke.1`).
*/
platformVersion?: pulumi.Input<string>;
project?: pulumi.Input<string>;
/**
* Support for proxy configuration.
*/
proxyConfig?: pulumi.Input<inputs.container.AttachedClusterProxyConfig>;
/**
* If set, there are currently changes in flight to the cluster.
*/
reconciling?: pulumi.Input<boolean>;
/**
* Enable/Disable Security Posture API features for the cluster.
*
* @deprecated `securityPostureConfig` is deprecated and will be removed in a future major release.
*/
securityPostureConfig?: pulumi.Input<inputs.container.AttachedClusterSecurityPostureConfig>;
/**
* The current state of the cluster. Possible values:
* STATE_UNSPECIFIED, PROVISIONING, RUNNING, RECONCILING, STOPPING, ERROR,
* DEGRADED
*/
state?: pulumi.Input<string>;
/**
* A globally unique identifier for the cluster.
*/
uid?: pulumi.Input<string>;
/**
* The time at which this cluster was last updated.
*/
updateTime?: pulumi.Input<string>;
/**
* Workload Identity settings.
* Structure is documented below.
*/
workloadIdentityConfigs?: pulumi.Input<pulumi.Input<inputs.container.AttachedClusterWorkloadIdentityConfig>[]>;
}
/**
* The set of arguments for constructing a AttachedCluster resource.
*/
export interface AttachedClusterArgs {
/**
* Optional. Annotations on the cluster. This field has the same restrictions as Kubernetes annotations. The total size of
* all keys and values combined is limited to 256k. Key can have 2 segments: prefix (optional) and name (required),
* separated by a slash (/). Prefix must be a DNS subdomain. Name must be 63 characters or less, begin and end with
* alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics between. **Note**: This field is
* non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field
* 'effective_annotations' for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Configuration related to the cluster RBAC settings.
*/
authorization?: pulumi.Input<inputs.container.AttachedClusterAuthorization>;
/**
* Binary Authorization configuration.
*/
binaryAuthorization?: pulumi.Input<inputs.container.AttachedClusterBinaryAuthorization>;
/**
* Policy to determine what flags to send on delete. Possible values: DELETE, DELETE_IGNORE_ERRORS
*/
deletionPolicy?: pulumi.Input<string>;
/**
* A human readable description of this attached cluster. Cannot be longer than 255 UTF-8 encoded bytes.
*/
description?: pulumi.Input<string>;
/**
* The Kubernetes distribution of the underlying attached cluster. Supported values:
* "eks", "aks", "generic". The generic distribution provides the ability to register
* or migrate any CNCF conformant cluster.
*/
distribution: pulumi.Input<string>;
/**
* Fleet configuration.
* Structure is documented below.
*/
fleet: pulumi.Input<inputs.container.AttachedClusterFleet>;
/**
* The location for the resource
*/
location: pulumi.Input<string>;
/**
* Logging configuration.
*/
loggingConfig?: pulumi.Input<inputs.container.AttachedClusterLoggingConfig>;
/**
* Monitoring configuration.
*/
monitoringConfig?: pulumi.Input<inputs.container.AttachedClusterMonitoringConfig>;
/**
* The name of this resource.
*/
name?: pulumi.Input<string>;
/**
* OIDC discovery information of the target cluster.
* Kubernetes Service Account (KSA) tokens are JWT tokens signed by the cluster
* API server. This fields indicates how GCP services
* validate KSA tokens in order to allow system workloads (such as GKE Connect
* and telemetry agents) to authenticate back to GCP.
* Both clusters with public and private issuer URLs are supported.
* Clusters with public issuers only need to specify the `issuerUrl` field
* while clusters with private issuers need to provide both
* `issuerUrl` and `jwks`.
* Structure is documented below.
*/
oidcConfig: pulumi.Input<inputs.container.AttachedClusterOidcConfig>;
/**
* The platform version for the cluster (e.g. `1.23.0-gke.1`).
*/
platformVersion: pulumi.Input<string>;
project?: pulumi.Input<string>;
/**
* Support for proxy configuration.
*/
proxyConfig?: pulumi.Input<inputs.container.AttachedClusterProxyConfig>;
/**
* Enable/Disable Security Posture API features for the cluster.
*
* @deprecated `securityPostureConfig` is deprecated and will be removed in a future major release.
*/
securityPostureConfig?: pulumi.Input<inputs.container.AttachedClusterSecurityPostureConfig>;
}