Google Cloud v8.21.0 published on Wednesday, Mar 5, 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:
- API documentation
- How-to Guides
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",
});
import pulumi
import pulumi_gcp as gcp
example = gcp.siteverification.get_token(type="SITE",
    identifier="https://www.example.com",
    verification_method="META")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: gcp:siteverification:getToken
      arguments:
        type: SITE
        identifier: https://www.example.com
        verificationMethod: META
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",
});
import pulumi
import pulumi_gcp as gcp
example = gcp.siteverification.get_token(type="INET_DOMAIN",
    identifier="www.example.com",
    verification_method="DNS_TXT")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: gcp:siteverification:getToken
      arguments:
        type: INET_DOMAIN
        identifier: www.example.com
        verificationMethod: DNS_TXT
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>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]func GetToken(ctx *Context, args *GetTokenArgs, opts ...InvokeOption) (*GetTokenResult, error)
func GetTokenOutput(ctx *Context, args *GetTokenOutputArgs, opts ...InvokeOption) GetTokenResultOutput> 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)
}public static CompletableFuture<GetTokenResult> getToken(GetTokenArgs args, InvokeOptions options)
public static Output<GetTokenResult> getToken(GetTokenArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:siteverification/getToken:getToken
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Identifier 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 string
- The type of resource to be verified, either a domain or a web site.
Possible values are: INET_DOMAIN,SITE.
- VerificationMethod 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 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 string
- The type of resource to be verified, either a domain or a web site.
Possible values are: INET_DOMAIN,SITE.
- VerificationMethod 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 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 String
- The type of resource to be verified, either a domain or a web site.
Possible values are: INET_DOMAIN,SITE.
- verificationMethod 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 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 string
- The type of resource to be verified, either a domain or a web site.
Possible values are: INET_DOMAIN,SITE.
- verificationMethod 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 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 str
- The type of resource to be verified, either a domain or a web site.
Possible values are: INET_DOMAIN,SITE.
- verification_method 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 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 String
- The type of resource to be verified, either a domain or a web site.
Possible values are: INET_DOMAIN,SITE.
- verificationMethod 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-betaTerraform Provider.