Skip to content

googleSiteVerification

View Source

Sets up a google site verification record. This can be used for verifying you own a domain for usage with Gmail and the Google Search console, among other things.

import * as pulumi from "@pulumi/pulumi";
import * as saws from "@stackattack/aws";
const ctx = saws.context();
const config = new pulumi.Config();
const verificationCode = config.require("google-verification-code");
saws.googleSiteVerification(ctx, {
domain: "mydomain.com",
verificationCode
});

After deployment, google should be able to verify that you own the domain.

You can manually verify that the record has been created successfully using dig:

Terminal window
dig TXT mydomain.com

See Verify your domain for Google Workspace for details on using your domain with Google Workspace.

The costs associated with setting up a single DNS record are minimal. You’ll need a Route53 hosted zone, which costs ~$0.50/month, and DNS queries are billed at $0.40/million. Google only needs one DNS query to verify the domain, though they recommend you keep the site verification record indefinitely to ensure that they can continue to verify ownership.

function googleSiteVerification(ctx: Context, args: GoogleSiteVerificationArgs): Record
  • (Record) -

Configuration arguments for setting up google site verification

  • domain (Input<string>) - The domain name to configure for Gmail
  • noPrefix? (boolean) - Whether to skip adding a prefix to the resource name
  • verificationCode (Input<string>) - Google verification code for domain ownership. If not passed, no verification record will be created for the domain. This should start with google-site-verification=....
  • zoneId? (Input<string>) - Route53 zone ID (auto-detected from domain if not provided)