1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. essentialcontacts
  5. DocumentAiProcessorDefaultVersion
Google Cloud v8.14.0 published on Wednesday, Jan 15, 2025 by Pulumi

gcp.essentialcontacts.DocumentAiProcessorDefaultVersion

Explore with Pulumi AI

The default version for the processor. Deleting this resource is a no-op, and does not unset the default version.

Example Usage

Documentai Default Version

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const processor = new gcp.essentialcontacts.DocumentAiProcessor("processor", {
    location: "us",
    displayName: "test-processor",
    type: "OCR_PROCESSOR",
});
const processorDocumentAiProcessorDefaultVersion = new gcp.essentialcontacts.DocumentAiProcessorDefaultVersion("processor", {
    processor: processor.id,
    version: pulumi.interpolate`${processor.id}/processorVersions/stable`,
});
Copy
import pulumi
import pulumi_gcp as gcp

processor = gcp.essentialcontacts.DocumentAiProcessor("processor",
    location="us",
    display_name="test-processor",
    type="OCR_PROCESSOR")
processor_document_ai_processor_default_version = gcp.essentialcontacts.DocumentAiProcessorDefaultVersion("processor",
    processor=processor.id,
    version=processor.id.apply(lambda id: f"{id}/processorVersions/stable"))
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/essentialcontacts"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		processor, err := essentialcontacts.NewDocumentAiProcessor(ctx, "processor", &essentialcontacts.DocumentAiProcessorArgs{
			Location:    pulumi.String("us"),
			DisplayName: pulumi.String("test-processor"),
			Type:        pulumi.String("OCR_PROCESSOR"),
		})
		if err != nil {
			return err
		}
		_, err = essentialcontacts.NewDocumentAiProcessorDefaultVersion(ctx, "processor", &essentialcontacts.DocumentAiProcessorDefaultVersionArgs{
			Processor: processor.ID(),
			Version: processor.ID().ApplyT(func(id string) (string, error) {
				return fmt.Sprintf("%v/processorVersions/stable", id), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var processor = new Gcp.EssentialContacts.DocumentAiProcessor("processor", new()
    {
        Location = "us",
        DisplayName = "test-processor",
        Type = "OCR_PROCESSOR",
    });

    var processorDocumentAiProcessorDefaultVersion = new Gcp.EssentialContacts.DocumentAiProcessorDefaultVersion("processor", new()
    {
        Processor = processor.Id,
        Version = processor.Id.Apply(id => $"{id}/processorVersions/stable"),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.essentialcontacts.DocumentAiProcessor;
import com.pulumi.gcp.essentialcontacts.DocumentAiProcessorArgs;
import com.pulumi.gcp.essentialcontacts.DocumentAiProcessorDefaultVersion;
import com.pulumi.gcp.essentialcontacts.DocumentAiProcessorDefaultVersionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var processor = new DocumentAiProcessor("processor", DocumentAiProcessorArgs.builder()
            .location("us")
            .displayName("test-processor")
            .type("OCR_PROCESSOR")
            .build());

        var processorDocumentAiProcessorDefaultVersion = new DocumentAiProcessorDefaultVersion("processorDocumentAiProcessorDefaultVersion", DocumentAiProcessorDefaultVersionArgs.builder()
            .processor(processor.id())
            .version(processor.id().applyValue(id -> String.format("%s/processorVersions/stable", id)))
            .build());

    }
}
Copy
resources:
  processor:
    type: gcp:essentialcontacts:DocumentAiProcessor
    properties:
      location: us
      displayName: test-processor
      type: OCR_PROCESSOR
  processorDocumentAiProcessorDefaultVersion:
    type: gcp:essentialcontacts:DocumentAiProcessorDefaultVersion
    name: processor
    properties:
      processor: ${processor.id}
      version: ${processor.id}/processorVersions/stable
Copy

Create DocumentAiProcessorDefaultVersion Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new DocumentAiProcessorDefaultVersion(name: string, args: DocumentAiProcessorDefaultVersionArgs, opts?: CustomResourceOptions);
@overload
def DocumentAiProcessorDefaultVersion(resource_name: str,
                                      args: DocumentAiProcessorDefaultVersionArgs,
                                      opts: Optional[ResourceOptions] = None)

@overload
def DocumentAiProcessorDefaultVersion(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      processor: Optional[str] = None,
                                      version: Optional[str] = None)
func NewDocumentAiProcessorDefaultVersion(ctx *Context, name string, args DocumentAiProcessorDefaultVersionArgs, opts ...ResourceOption) (*DocumentAiProcessorDefaultVersion, error)
public DocumentAiProcessorDefaultVersion(string name, DocumentAiProcessorDefaultVersionArgs args, CustomResourceOptions? opts = null)
public DocumentAiProcessorDefaultVersion(String name, DocumentAiProcessorDefaultVersionArgs args)
public DocumentAiProcessorDefaultVersion(String name, DocumentAiProcessorDefaultVersionArgs args, CustomResourceOptions options)
type: gcp:essentialcontacts:DocumentAiProcessorDefaultVersion
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DocumentAiProcessorDefaultVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DocumentAiProcessorDefaultVersionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DocumentAiProcessorDefaultVersionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DocumentAiProcessorDefaultVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DocumentAiProcessorDefaultVersionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var documentAiProcessorDefaultVersionResource = new Gcp.EssentialContacts.DocumentAiProcessorDefaultVersion("documentAiProcessorDefaultVersionResource", new()
{
    Processor = "string",
    Version = "string",
});
Copy
example, err := essentialcontacts.NewDocumentAiProcessorDefaultVersion(ctx, "documentAiProcessorDefaultVersionResource", &essentialcontacts.DocumentAiProcessorDefaultVersionArgs{
	Processor: pulumi.String("string"),
	Version:   pulumi.String("string"),
})
Copy
var documentAiProcessorDefaultVersionResource = new DocumentAiProcessorDefaultVersion("documentAiProcessorDefaultVersionResource", DocumentAiProcessorDefaultVersionArgs.builder()
    .processor("string")
    .version("string")
    .build());
Copy
document_ai_processor_default_version_resource = gcp.essentialcontacts.DocumentAiProcessorDefaultVersion("documentAiProcessorDefaultVersionResource",
    processor="string",
    version="string")
Copy
const documentAiProcessorDefaultVersionResource = new gcp.essentialcontacts.DocumentAiProcessorDefaultVersion("documentAiProcessorDefaultVersionResource", {
    processor: "string",
    version: "string",
});
Copy
type: gcp:essentialcontacts:DocumentAiProcessorDefaultVersion
properties:
    processor: string
    version: string
Copy

DocumentAiProcessorDefaultVersion Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The DocumentAiProcessorDefaultVersion resource accepts the following input properties:

Processor
This property is required.
Changes to this property will trigger replacement.
string
The processor to set the version on.


Version
This property is required.
Changes to this property will trigger replacement.
string
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
Processor
This property is required.
Changes to this property will trigger replacement.
string
The processor to set the version on.


Version
This property is required.
Changes to this property will trigger replacement.
string
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor
This property is required.
Changes to this property will trigger replacement.
String
The processor to set the version on.


version
This property is required.
Changes to this property will trigger replacement.
String
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor
This property is required.
Changes to this property will trigger replacement.
string
The processor to set the version on.


version
This property is required.
Changes to this property will trigger replacement.
string
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor
This property is required.
Changes to this property will trigger replacement.
str
The processor to set the version on.


version
This property is required.
Changes to this property will trigger replacement.
str
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor
This property is required.
Changes to this property will trigger replacement.
String
The processor to set the version on.


version
This property is required.
Changes to this property will trigger replacement.
String
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.

Outputs

All input properties are implicitly available as output properties. Additionally, the DocumentAiProcessorDefaultVersion resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing DocumentAiProcessorDefaultVersion Resource

Get an existing DocumentAiProcessorDefaultVersion resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DocumentAiProcessorDefaultVersionState, opts?: CustomResourceOptions): DocumentAiProcessorDefaultVersion
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        processor: Optional[str] = None,
        version: Optional[str] = None) -> DocumentAiProcessorDefaultVersion
func GetDocumentAiProcessorDefaultVersion(ctx *Context, name string, id IDInput, state *DocumentAiProcessorDefaultVersionState, opts ...ResourceOption) (*DocumentAiProcessorDefaultVersion, error)
public static DocumentAiProcessorDefaultVersion Get(string name, Input<string> id, DocumentAiProcessorDefaultVersionState? state, CustomResourceOptions? opts = null)
public static DocumentAiProcessorDefaultVersion get(String name, Output<String> id, DocumentAiProcessorDefaultVersionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Processor Changes to this property will trigger replacement. string
The processor to set the version on.


Version Changes to this property will trigger replacement. string
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
Processor Changes to this property will trigger replacement. string
The processor to set the version on.


Version Changes to this property will trigger replacement. string
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor Changes to this property will trigger replacement. String
The processor to set the version on.


version Changes to this property will trigger replacement. String
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor Changes to this property will trigger replacement. string
The processor to set the version on.


version Changes to this property will trigger replacement. string
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor Changes to this property will trigger replacement. str
The processor to set the version on.


version Changes to this property will trigger replacement. str
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.
processor Changes to this property will trigger replacement. String
The processor to set the version on.


version Changes to this property will trigger replacement. String
The version to set. Using stable or rc will cause the API to return the latest version in that release channel. Apply lifecycle.ignore_changes to the version field to suppress this diff.

Import

ProcessorDefaultVersion can be imported using any of these accepted formats:

  • {{processor}}

When using the pulumi import command, ProcessorDefaultVersion can be imported using one of the formats above. For example:

$ pulumi import gcp:essentialcontacts/documentAiProcessorDefaultVersion:DocumentAiProcessorDefaultVersion default {{processor}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.