1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. siteverification
  5. getToken
Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi

gcp.siteverification.getToken

Explore with Pulumi AI

A verification token is used to demonstrate ownership of a website or domain.

To get more information about Token, see:

Example Usage

Site Verification Via Site META Tag

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

const example = gcp.siteverification.getToken({
    type: "SITE",
    identifier: "https://www.example.com",
    verificationMethod: "META",
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.siteverification.get_token(type="SITE",
    identifier="https://www.example.com",
    verification_method="META")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/siteverification"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := siteverification.GetToken(ctx, &siteverification.GetTokenArgs{
			Type:               "SITE",
			Identifier:         "https://www.example.com",
			VerificationMethod: "META",
		}, nil)
		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 example = Gcp.SiteVerification.GetToken.Invoke(new()
    {
        Type = "SITE",
        Identifier = "https://www.example.com",
        VerificationMethod = "META",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.siteverification.SiteverificationFunctions;
import com.pulumi.gcp.siteverification.inputs.GetTokenArgs;
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) {
        final var example = SiteverificationFunctions.getToken(GetTokenArgs.builder()
            .type("SITE")
            .identifier("https://www.example.com")
            .verificationMethod("META")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: gcp:siteverification:getToken
      arguments:
        type: SITE
        identifier: https://www.example.com
        verificationMethod: META
Copy

Site Verification Via DNS TXT Record

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

const example = gcp.siteverification.getToken({
    type: "INET_DOMAIN",
    identifier: "www.example.com",
    verificationMethod: "DNS_TXT",
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.siteverification.get_token(type="INET_DOMAIN",
    identifier="www.example.com",
    verification_method="DNS_TXT")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/siteverification"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := siteverification.GetToken(ctx, &siteverification.GetTokenArgs{
			Type:               "INET_DOMAIN",
			Identifier:         "www.example.com",
			VerificationMethod: "DNS_TXT",
		}, nil)
		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 example = Gcp.SiteVerification.GetToken.Invoke(new()
    {
        Type = "INET_DOMAIN",
        Identifier = "www.example.com",
        VerificationMethod = "DNS_TXT",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.siteverification.SiteverificationFunctions;
import com.pulumi.gcp.siteverification.inputs.GetTokenArgs;
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) {
        final var example = SiteverificationFunctions.getToken(GetTokenArgs.builder()
            .type("INET_DOMAIN")
            .identifier("www.example.com")
            .verificationMethod("DNS_TXT")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: gcp:siteverification:getToken
      arguments:
        type: INET_DOMAIN
        identifier: www.example.com
        verificationMethod: DNS_TXT
Copy

Using getToken

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getToken(args: GetTokenArgs, opts?: InvokeOptions): Promise<GetTokenResult>
function getTokenOutput(args: GetTokenOutputArgs, opts?: InvokeOptions): Output<GetTokenResult>
Copy
def get_token(identifier: Optional[str] = None,
              type: Optional[str] = None,
              verification_method: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetTokenResult
def get_token_output(identifier: Optional[pulumi.Input[str]] = None,
              type: Optional[pulumi.Input[str]] = None,
              verification_method: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetTokenResult]
Copy
func GetToken(ctx *Context, args *GetTokenArgs, opts ...InvokeOption) (*GetTokenResult, error)
func GetTokenOutput(ctx *Context, args *GetTokenOutputArgs, opts ...InvokeOption) GetTokenResultOutput
Copy

> Note: This function is named GetToken in the Go SDK.

public static class GetToken 
{
    public static Task<GetTokenResult> InvokeAsync(GetTokenArgs args, InvokeOptions? opts = null)
    public static Output<GetTokenResult> Invoke(GetTokenInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTokenResult> getToken(GetTokenArgs args, InvokeOptions options)
public static Output<GetTokenResult> getToken(GetTokenArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:siteverification/getToken:getToken
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Identifier
This property is required.
Changes to this property will trigger replacement.
string
The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the identifier is a domain name.
Type
This property is required.
Changes to this property will trigger replacement.
string
The type of resource to be verified, either a domain or a web site. Possible values are: INET_DOMAIN, SITE.
VerificationMethod
This property is required.
Changes to this property will trigger replacement.
string
The verification method for the Site Verification system to use to verify this site or domain. Possible values are: ANALYTICS, DNS_CNAME, DNS_TXT, FILE, META, TAG_MANAGER.


Identifier
This property is required.
Changes to this property will trigger replacement.
string
The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the identifier is a domain name.
Type
This property is required.
Changes to this property will trigger replacement.
string
The type of resource to be verified, either a domain or a web site. Possible values are: INET_DOMAIN, SITE.
VerificationMethod
This property is required.
Changes to this property will trigger replacement.
string
The verification method for the Site Verification system to use to verify this site or domain. Possible values are: ANALYTICS, DNS_CNAME, DNS_TXT, FILE, META, TAG_MANAGER.


identifier
This property is required.
Changes to this property will trigger replacement.
String
The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the identifier is a domain name.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of resource to be verified, either a domain or a web site. Possible values are: INET_DOMAIN, SITE.
verificationMethod
This property is required.
Changes to this property will trigger replacement.
String
The verification method for the Site Verification system to use to verify this site or domain. Possible values are: ANALYTICS, DNS_CNAME, DNS_TXT, FILE, META, TAG_MANAGER.


identifier
This property is required.
Changes to this property will trigger replacement.
string
The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the identifier is a domain name.
type
This property is required.
Changes to this property will trigger replacement.
string
The type of resource to be verified, either a domain or a web site. Possible values are: INET_DOMAIN, SITE.
verificationMethod
This property is required.
Changes to this property will trigger replacement.
string
The verification method for the Site Verification system to use to verify this site or domain. Possible values are: ANALYTICS, DNS_CNAME, DNS_TXT, FILE, META, TAG_MANAGER.


identifier
This property is required.
Changes to this property will trigger replacement.
str
The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the identifier is a domain name.
type
This property is required.
Changes to this property will trigger replacement.
str
The type of resource to be verified, either a domain or a web site. Possible values are: INET_DOMAIN, SITE.
verification_method
This property is required.
Changes to this property will trigger replacement.
str
The verification method for the Site Verification system to use to verify this site or domain. Possible values are: ANALYTICS, DNS_CNAME, DNS_TXT, FILE, META, TAG_MANAGER.


identifier
This property is required.
Changes to this property will trigger replacement.
String
The site identifier. If the type is set to SITE, the identifier is a URL. If the type is set to INET_DOMAIN, the identifier is a domain name.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of resource to be verified, either a domain or a web site. Possible values are: INET_DOMAIN, SITE.
verificationMethod
This property is required.
Changes to this property will trigger replacement.
String
The verification method for the Site Verification system to use to verify this site or domain. Possible values are: ANALYTICS, DNS_CNAME, DNS_TXT, FILE, META, TAG_MANAGER.


getToken Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Identifier string
Token string
The generated token for use in subsequent verification steps.
Type string
VerificationMethod string
Id string
The provider-assigned unique ID for this managed resource.
Identifier string
Token string
The generated token for use in subsequent verification steps.
Type string
VerificationMethod string
id String
The provider-assigned unique ID for this managed resource.
identifier String
token String
The generated token for use in subsequent verification steps.
type String
verificationMethod String
id string
The provider-assigned unique ID for this managed resource.
identifier string
token string
The generated token for use in subsequent verification steps.
type string
verificationMethod string
id str
The provider-assigned unique ID for this managed resource.
identifier str
token str
The generated token for use in subsequent verification steps.
type str
verification_method str
id String
The provider-assigned unique ID for this managed resource.
identifier String
token String
The generated token for use in subsequent verification steps.
type String
verificationMethod String

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.