1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. projects
  5. ApiKey
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.projects.ApiKey

Explore with Pulumi AI

The Apikeys Key resource

Example Usage

Android_key

A basic example of a android api keys key

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

const primary = new gcp.projects.ApiKey("primary", {
    name: "key",
    displayName: "sample-key",
    restrictions: {
        androidKeyRestrictions: {
            allowedApplications: [{
                packageName: "com.example.app123",
                sha1Fingerprint: "1699466a142d4682a5f91b50fdf400f2358e2b0b",
            }],
        },
        apiTargets: [{
            service: "translate.googleapis.com",
            methods: ["GET*"],
        }],
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

primary = gcp.projects.ApiKey("primary",
    name="key",
    display_name="sample-key",
    restrictions={
        "android_key_restrictions": {
            "allowed_applications": [{
                "package_name": "com.example.app123",
                "sha1_fingerprint": "1699466a142d4682a5f91b50fdf400f2358e2b0b",
            }],
        },
        "api_targets": [{
            "service": "translate.googleapis.com",
            "methods": ["GET*"],
        }],
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := projects.NewApiKey(ctx, "primary", &projects.ApiKeyArgs{
			Name:        pulumi.String("key"),
			DisplayName: pulumi.String("sample-key"),
			Restrictions: &projects.ApiKeyRestrictionsArgs{
				AndroidKeyRestrictions: &projects.ApiKeyRestrictionsAndroidKeyRestrictionsArgs{
					AllowedApplications: projects.ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArray{
						&projects.ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArgs{
							PackageName:     pulumi.String("com.example.app123"),
							Sha1Fingerprint: pulumi.String("1699466a142d4682a5f91b50fdf400f2358e2b0b"),
						},
					},
				},
				ApiTargets: projects.ApiKeyRestrictionsApiTargetArray{
					&projects.ApiKeyRestrictionsApiTargetArgs{
						Service: pulumi.String("translate.googleapis.com"),
						Methods: pulumi.StringArray{
							pulumi.String("GET*"),
						},
					},
				},
			},
		})
		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 primary = new Gcp.Projects.ApiKey("primary", new()
    {
        Name = "key",
        DisplayName = "sample-key",
        Restrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsArgs
        {
            AndroidKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsAndroidKeyRestrictionsArgs
            {
                AllowedApplications = new[]
                {
                    new Gcp.Projects.Inputs.ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArgs
                    {
                        PackageName = "com.example.app123",
                        Sha1Fingerprint = "1699466a142d4682a5f91b50fdf400f2358e2b0b",
                    },
                },
            },
            ApiTargets = new[]
            {
                new Gcp.Projects.Inputs.ApiKeyRestrictionsApiTargetArgs
                {
                    Service = "translate.googleapis.com",
                    Methods = new[]
                    {
                        "GET*",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.ApiKey;
import com.pulumi.gcp.projects.ApiKeyArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsAndroidKeyRestrictionsArgs;
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 primary = new ApiKey("primary", ApiKeyArgs.builder()
            .name("key")
            .displayName("sample-key")
            .restrictions(ApiKeyRestrictionsArgs.builder()
                .androidKeyRestrictions(ApiKeyRestrictionsAndroidKeyRestrictionsArgs.builder()
                    .allowedApplications(ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArgs.builder()
                        .packageName("com.example.app123")
                        .sha1Fingerprint("1699466a142d4682a5f91b50fdf400f2358e2b0b")
                        .build())
                    .build())
                .apiTargets(ApiKeyRestrictionsApiTargetArgs.builder()
                    .service("translate.googleapis.com")
                    .methods("GET*")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  primary:
    type: gcp:projects:ApiKey
    properties:
      name: key
      displayName: sample-key
      restrictions:
        androidKeyRestrictions:
          allowedApplications:
            - packageName: com.example.app123
              sha1Fingerprint: 1699466a142d4682a5f91b50fdf400f2358e2b0b
        apiTargets:
          - service: translate.googleapis.com
            methods:
              - GET*
Copy

Basic_key

A basic example of a api keys key

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

const primary = new gcp.projects.ApiKey("primary", {
    name: "key",
    displayName: "sample-key",
    restrictions: {
        apiTargets: [{
            service: "translate.googleapis.com",
            methods: ["GET*"],
        }],
        browserKeyRestrictions: {
            allowedReferrers: [".*"],
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

primary = gcp.projects.ApiKey("primary",
    name="key",
    display_name="sample-key",
    restrictions={
        "api_targets": [{
            "service": "translate.googleapis.com",
            "methods": ["GET*"],
        }],
        "browser_key_restrictions": {
            "allowed_referrers": [".*"],
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := projects.NewApiKey(ctx, "primary", &projects.ApiKeyArgs{
			Name:        pulumi.String("key"),
			DisplayName: pulumi.String("sample-key"),
			Restrictions: &projects.ApiKeyRestrictionsArgs{
				ApiTargets: projects.ApiKeyRestrictionsApiTargetArray{
					&projects.ApiKeyRestrictionsApiTargetArgs{
						Service: pulumi.String("translate.googleapis.com"),
						Methods: pulumi.StringArray{
							pulumi.String("GET*"),
						},
					},
				},
				BrowserKeyRestrictions: &projects.ApiKeyRestrictionsBrowserKeyRestrictionsArgs{
					AllowedReferrers: pulumi.StringArray{
						pulumi.String(".*"),
					},
				},
			},
		})
		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 primary = new Gcp.Projects.ApiKey("primary", new()
    {
        Name = "key",
        DisplayName = "sample-key",
        Restrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsArgs
        {
            ApiTargets = new[]
            {
                new Gcp.Projects.Inputs.ApiKeyRestrictionsApiTargetArgs
                {
                    Service = "translate.googleapis.com",
                    Methods = new[]
                    {
                        "GET*",
                    },
                },
            },
            BrowserKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsBrowserKeyRestrictionsArgs
            {
                AllowedReferrers = new[]
                {
                    ".*",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.ApiKey;
import com.pulumi.gcp.projects.ApiKeyArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsBrowserKeyRestrictionsArgs;
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 primary = new ApiKey("primary", ApiKeyArgs.builder()
            .name("key")
            .displayName("sample-key")
            .restrictions(ApiKeyRestrictionsArgs.builder()
                .apiTargets(ApiKeyRestrictionsApiTargetArgs.builder()
                    .service("translate.googleapis.com")
                    .methods("GET*")
                    .build())
                .browserKeyRestrictions(ApiKeyRestrictionsBrowserKeyRestrictionsArgs.builder()
                    .allowedReferrers(".*")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  primary:
    type: gcp:projects:ApiKey
    properties:
      name: key
      displayName: sample-key
      restrictions:
        apiTargets:
          - service: translate.googleapis.com
            methods:
              - GET*
        browserKeyRestrictions:
          allowedReferrers:
            - .*
Copy

Ios_key

A basic example of a ios api keys key

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

const primary = new gcp.projects.ApiKey("primary", {
    name: "key",
    displayName: "sample-key",
    restrictions: {
        apiTargets: [{
            service: "translate.googleapis.com",
            methods: ["GET*"],
        }],
        iosKeyRestrictions: {
            allowedBundleIds: ["com.google.app.macos"],
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

primary = gcp.projects.ApiKey("primary",
    name="key",
    display_name="sample-key",
    restrictions={
        "api_targets": [{
            "service": "translate.googleapis.com",
            "methods": ["GET*"],
        }],
        "ios_key_restrictions": {
            "allowed_bundle_ids": ["com.google.app.macos"],
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := projects.NewApiKey(ctx, "primary", &projects.ApiKeyArgs{
			Name:        pulumi.String("key"),
			DisplayName: pulumi.String("sample-key"),
			Restrictions: &projects.ApiKeyRestrictionsArgs{
				ApiTargets: projects.ApiKeyRestrictionsApiTargetArray{
					&projects.ApiKeyRestrictionsApiTargetArgs{
						Service: pulumi.String("translate.googleapis.com"),
						Methods: pulumi.StringArray{
							pulumi.String("GET*"),
						},
					},
				},
				IosKeyRestrictions: &projects.ApiKeyRestrictionsIosKeyRestrictionsArgs{
					AllowedBundleIds: pulumi.StringArray{
						pulumi.String("com.google.app.macos"),
					},
				},
			},
		})
		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 primary = new Gcp.Projects.ApiKey("primary", new()
    {
        Name = "key",
        DisplayName = "sample-key",
        Restrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsArgs
        {
            ApiTargets = new[]
            {
                new Gcp.Projects.Inputs.ApiKeyRestrictionsApiTargetArgs
                {
                    Service = "translate.googleapis.com",
                    Methods = new[]
                    {
                        "GET*",
                    },
                },
            },
            IosKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsIosKeyRestrictionsArgs
            {
                AllowedBundleIds = new[]
                {
                    "com.google.app.macos",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.ApiKey;
import com.pulumi.gcp.projects.ApiKeyArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsIosKeyRestrictionsArgs;
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 primary = new ApiKey("primary", ApiKeyArgs.builder()
            .name("key")
            .displayName("sample-key")
            .restrictions(ApiKeyRestrictionsArgs.builder()
                .apiTargets(ApiKeyRestrictionsApiTargetArgs.builder()
                    .service("translate.googleapis.com")
                    .methods("GET*")
                    .build())
                .iosKeyRestrictions(ApiKeyRestrictionsIosKeyRestrictionsArgs.builder()
                    .allowedBundleIds("com.google.app.macos")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  primary:
    type: gcp:projects:ApiKey
    properties:
      name: key
      displayName: sample-key
      restrictions:
        apiTargets:
          - service: translate.googleapis.com
            methods:
              - GET*
        iosKeyRestrictions:
          allowedBundleIds:
            - com.google.app.macos
Copy

Minimal_key

A minimal example of a api keys key

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

const primary = new gcp.projects.ApiKey("primary", {
    name: "key",
    displayName: "sample-key",
});
Copy
import pulumi
import pulumi_gcp as gcp

primary = gcp.projects.ApiKey("primary",
    name="key",
    display_name="sample-key")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := projects.NewApiKey(ctx, "primary", &projects.ApiKeyArgs{
			Name:        pulumi.String("key"),
			DisplayName: pulumi.String("sample-key"),
		})
		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 primary = new Gcp.Projects.ApiKey("primary", new()
    {
        Name = "key",
        DisplayName = "sample-key",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.ApiKey;
import com.pulumi.gcp.projects.ApiKeyArgs;
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 primary = new ApiKey("primary", ApiKeyArgs.builder()
            .name("key")
            .displayName("sample-key")
            .build());

    }
}
Copy
resources:
  primary:
    type: gcp:projects:ApiKey
    properties:
      name: key
      displayName: sample-key
Copy

Server_key

A basic example of a server api keys key

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

const primary = new gcp.projects.ApiKey("primary", {
    name: "key",
    displayName: "sample-key",
    restrictions: {
        apiTargets: [{
            service: "translate.googleapis.com",
            methods: ["GET*"],
        }],
        serverKeyRestrictions: {
            allowedIps: ["127.0.0.1"],
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

primary = gcp.projects.ApiKey("primary",
    name="key",
    display_name="sample-key",
    restrictions={
        "api_targets": [{
            "service": "translate.googleapis.com",
            "methods": ["GET*"],
        }],
        "server_key_restrictions": {
            "allowed_ips": ["127.0.0.1"],
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := projects.NewApiKey(ctx, "primary", &projects.ApiKeyArgs{
			Name:        pulumi.String("key"),
			DisplayName: pulumi.String("sample-key"),
			Restrictions: &projects.ApiKeyRestrictionsArgs{
				ApiTargets: projects.ApiKeyRestrictionsApiTargetArray{
					&projects.ApiKeyRestrictionsApiTargetArgs{
						Service: pulumi.String("translate.googleapis.com"),
						Methods: pulumi.StringArray{
							pulumi.String("GET*"),
						},
					},
				},
				ServerKeyRestrictions: &projects.ApiKeyRestrictionsServerKeyRestrictionsArgs{
					AllowedIps: pulumi.StringArray{
						pulumi.String("127.0.0.1"),
					},
				},
			},
		})
		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 primary = new Gcp.Projects.ApiKey("primary", new()
    {
        Name = "key",
        DisplayName = "sample-key",
        Restrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsArgs
        {
            ApiTargets = new[]
            {
                new Gcp.Projects.Inputs.ApiKeyRestrictionsApiTargetArgs
                {
                    Service = "translate.googleapis.com",
                    Methods = new[]
                    {
                        "GET*",
                    },
                },
            },
            ServerKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsServerKeyRestrictionsArgs
            {
                AllowedIps = new[]
                {
                    "127.0.0.1",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.ApiKey;
import com.pulumi.gcp.projects.ApiKeyArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs;
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsServerKeyRestrictionsArgs;
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 primary = new ApiKey("primary", ApiKeyArgs.builder()
            .name("key")
            .displayName("sample-key")
            .restrictions(ApiKeyRestrictionsArgs.builder()
                .apiTargets(ApiKeyRestrictionsApiTargetArgs.builder()
                    .service("translate.googleapis.com")
                    .methods("GET*")
                    .build())
                .serverKeyRestrictions(ApiKeyRestrictionsServerKeyRestrictionsArgs.builder()
                    .allowedIps("127.0.0.1")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  primary:
    type: gcp:projects:ApiKey
    properties:
      name: key
      displayName: sample-key
      restrictions:
        apiTargets:
          - service: translate.googleapis.com
            methods:
              - GET*
        serverKeyRestrictions:
          allowedIps:
            - 127.0.0.1
Copy

Create ApiKey Resource

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

Constructor syntax

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

@overload
def ApiKey(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           display_name: Optional[str] = None,
           name: Optional[str] = None,
           project: Optional[str] = None,
           restrictions: Optional[ApiKeyRestrictionsArgs] = None)
func NewApiKey(ctx *Context, name string, args *ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)
public ApiKey(string name, ApiKeyArgs? args = null, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: gcp:projects:ApiKey
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 ApiKeyArgs
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 ApiKeyArgs
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 ApiKeyArgs
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 ApiKeyArgs
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. ApiKeyArgs
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 apiKeyResource = new Gcp.Projects.ApiKey("apiKeyResource", new()
{
    DisplayName = "string",
    Name = "string",
    Project = "string",
    Restrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsArgs
    {
        AndroidKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsAndroidKeyRestrictionsArgs
        {
            AllowedApplications = new[]
            {
                new Gcp.Projects.Inputs.ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArgs
                {
                    PackageName = "string",
                    Sha1Fingerprint = "string",
                },
            },
        },
        ApiTargets = new[]
        {
            new Gcp.Projects.Inputs.ApiKeyRestrictionsApiTargetArgs
            {
                Service = "string",
                Methods = new[]
                {
                    "string",
                },
            },
        },
        BrowserKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsBrowserKeyRestrictionsArgs
        {
            AllowedReferrers = new[]
            {
                "string",
            },
        },
        IosKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsIosKeyRestrictionsArgs
        {
            AllowedBundleIds = new[]
            {
                "string",
            },
        },
        ServerKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsServerKeyRestrictionsArgs
        {
            AllowedIps = new[]
            {
                "string",
            },
        },
    },
});
Copy
example, err := projects.NewApiKey(ctx, "apiKeyResource", &projects.ApiKeyArgs{
	DisplayName: pulumi.String("string"),
	Name:        pulumi.String("string"),
	Project:     pulumi.String("string"),
	Restrictions: &projects.ApiKeyRestrictionsArgs{
		AndroidKeyRestrictions: &projects.ApiKeyRestrictionsAndroidKeyRestrictionsArgs{
			AllowedApplications: projects.ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArray{
				&projects.ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArgs{
					PackageName:     pulumi.String("string"),
					Sha1Fingerprint: pulumi.String("string"),
				},
			},
		},
		ApiTargets: projects.ApiKeyRestrictionsApiTargetArray{
			&projects.ApiKeyRestrictionsApiTargetArgs{
				Service: pulumi.String("string"),
				Methods: pulumi.StringArray{
					pulumi.String("string"),
				},
			},
		},
		BrowserKeyRestrictions: &projects.ApiKeyRestrictionsBrowserKeyRestrictionsArgs{
			AllowedReferrers: pulumi.StringArray{
				pulumi.String("string"),
			},
		},
		IosKeyRestrictions: &projects.ApiKeyRestrictionsIosKeyRestrictionsArgs{
			AllowedBundleIds: pulumi.StringArray{
				pulumi.String("string"),
			},
		},
		ServerKeyRestrictions: &projects.ApiKeyRestrictionsServerKeyRestrictionsArgs{
			AllowedIps: pulumi.StringArray{
				pulumi.String("string"),
			},
		},
	},
})
Copy
var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
    .displayName("string")
    .name("string")
    .project("string")
    .restrictions(ApiKeyRestrictionsArgs.builder()
        .androidKeyRestrictions(ApiKeyRestrictionsAndroidKeyRestrictionsArgs.builder()
            .allowedApplications(ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArgs.builder()
                .packageName("string")
                .sha1Fingerprint("string")
                .build())
            .build())
        .apiTargets(ApiKeyRestrictionsApiTargetArgs.builder()
            .service("string")
            .methods("string")
            .build())
        .browserKeyRestrictions(ApiKeyRestrictionsBrowserKeyRestrictionsArgs.builder()
            .allowedReferrers("string")
            .build())
        .iosKeyRestrictions(ApiKeyRestrictionsIosKeyRestrictionsArgs.builder()
            .allowedBundleIds("string")
            .build())
        .serverKeyRestrictions(ApiKeyRestrictionsServerKeyRestrictionsArgs.builder()
            .allowedIps("string")
            .build())
        .build())
    .build());
Copy
api_key_resource = gcp.projects.ApiKey("apiKeyResource",
    display_name="string",
    name="string",
    project="string",
    restrictions={
        "android_key_restrictions": {
            "allowed_applications": [{
                "package_name": "string",
                "sha1_fingerprint": "string",
            }],
        },
        "api_targets": [{
            "service": "string",
            "methods": ["string"],
        }],
        "browser_key_restrictions": {
            "allowed_referrers": ["string"],
        },
        "ios_key_restrictions": {
            "allowed_bundle_ids": ["string"],
        },
        "server_key_restrictions": {
            "allowed_ips": ["string"],
        },
    })
Copy
const apiKeyResource = new gcp.projects.ApiKey("apiKeyResource", {
    displayName: "string",
    name: "string",
    project: "string",
    restrictions: {
        androidKeyRestrictions: {
            allowedApplications: [{
                packageName: "string",
                sha1Fingerprint: "string",
            }],
        },
        apiTargets: [{
            service: "string",
            methods: ["string"],
        }],
        browserKeyRestrictions: {
            allowedReferrers: ["string"],
        },
        iosKeyRestrictions: {
            allowedBundleIds: ["string"],
        },
        serverKeyRestrictions: {
            allowedIps: ["string"],
        },
    },
});
Copy
type: gcp:projects:ApiKey
properties:
    displayName: string
    name: string
    project: string
    restrictions:
        androidKeyRestrictions:
            allowedApplications:
                - packageName: string
                  sha1Fingerprint: string
        apiTargets:
            - methods:
                - string
              service: string
        browserKeyRestrictions:
            allowedReferrers:
                - string
        iosKeyRestrictions:
            allowedBundleIds:
                - string
        serverKeyRestrictions:
            allowedIps:
                - string
Copy

ApiKey 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 ApiKey resource accepts the following input properties:

DisplayName string
Human-readable display name of this API key. Modifiable by user.
Name Changes to this property will trigger replacement. string
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
Project Changes to this property will trigger replacement. string
The project for the resource
Restrictions ApiKeyRestrictions
Key restrictions.
DisplayName string
Human-readable display name of this API key. Modifiable by user.
Name Changes to this property will trigger replacement. string
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
Project Changes to this property will trigger replacement. string
The project for the resource
Restrictions ApiKeyRestrictionsArgs
Key restrictions.
displayName String
Human-readable display name of this API key. Modifiable by user.
name Changes to this property will trigger replacement. String
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. String
The project for the resource
restrictions ApiKeyRestrictions
Key restrictions.
displayName string
Human-readable display name of this API key. Modifiable by user.
name Changes to this property will trigger replacement. string
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. string
The project for the resource
restrictions ApiKeyRestrictions
Key restrictions.
display_name str
Human-readable display name of this API key. Modifiable by user.
name Changes to this property will trigger replacement. str
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. str
The project for the resource
restrictions ApiKeyRestrictionsArgs
Key restrictions.
displayName String
Human-readable display name of this API key. Modifiable by user.
name Changes to this property will trigger replacement. String
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. String
The project for the resource
restrictions Property Map
Key restrictions.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
KeyString string
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
Uid string
Output only. Unique id in UUID4 format.
Id string
The provider-assigned unique ID for this managed resource.
KeyString string
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
Uid string
Output only. Unique id in UUID4 format.
id String
The provider-assigned unique ID for this managed resource.
keyString String
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
uid String
Output only. Unique id in UUID4 format.
id string
The provider-assigned unique ID for this managed resource.
keyString string
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
uid string
Output only. Unique id in UUID4 format.
id str
The provider-assigned unique ID for this managed resource.
key_string str
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
uid str
Output only. Unique id in UUID4 format.
id String
The provider-assigned unique ID for this managed resource.
keyString String
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
uid String
Output only. Unique id in UUID4 format.

Look up Existing ApiKey Resource

Get an existing ApiKey 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?: ApiKeyState, opts?: CustomResourceOptions): ApiKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        display_name: Optional[str] = None,
        key_string: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        restrictions: Optional[ApiKeyRestrictionsArgs] = None,
        uid: Optional[str] = None) -> ApiKey
func GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)
public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)
public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)
resources:  _:    type: gcp:projects:ApiKey    get:      id: ${id}
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:
DisplayName string
Human-readable display name of this API key. Modifiable by user.
KeyString string
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
Name Changes to this property will trigger replacement. string
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
Project Changes to this property will trigger replacement. string
The project for the resource
Restrictions ApiKeyRestrictions
Key restrictions.
Uid string
Output only. Unique id in UUID4 format.
DisplayName string
Human-readable display name of this API key. Modifiable by user.
KeyString string
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
Name Changes to this property will trigger replacement. string
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
Project Changes to this property will trigger replacement. string
The project for the resource
Restrictions ApiKeyRestrictionsArgs
Key restrictions.
Uid string
Output only. Unique id in UUID4 format.
displayName String
Human-readable display name of this API key. Modifiable by user.
keyString String
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
name Changes to this property will trigger replacement. String
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. String
The project for the resource
restrictions ApiKeyRestrictions
Key restrictions.
uid String
Output only. Unique id in UUID4 format.
displayName string
Human-readable display name of this API key. Modifiable by user.
keyString string
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
name Changes to this property will trigger replacement. string
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. string
The project for the resource
restrictions ApiKeyRestrictions
Key restrictions.
uid string
Output only. Unique id in UUID4 format.
display_name str
Human-readable display name of this API key. Modifiable by user.
key_string str
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
name Changes to this property will trigger replacement. str
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. str
The project for the resource
restrictions ApiKeyRestrictionsArgs
Key restrictions.
uid str
Output only. Unique id in UUID4 format.
displayName String
Human-readable display name of this API key. Modifiable by user.
keyString String
Output only. An encrypted and signed value held by this key. This field can be accessed only through the GetKeyString method.
name Changes to this property will trigger replacement. String
The resource name of the key. The name must be unique within the project, must conform with RFC-1034, is restricted to lower-cased letters, and has a maximum length of 63 characters. In another word, the name must match the regular expression: a-z?.
project Changes to this property will trigger replacement. String
The project for the resource
restrictions Property Map
Key restrictions.
uid String
Output only. Unique id in UUID4 format.

Supporting Types

ApiKeyRestrictions
, ApiKeyRestrictionsArgs

AndroidKeyRestrictions ApiKeyRestrictionsAndroidKeyRestrictions
The Android apps that are allowed to use the key.
ApiTargets List<ApiKeyRestrictionsApiTarget>
A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
BrowserKeyRestrictions ApiKeyRestrictionsBrowserKeyRestrictions
The HTTP referrers (websites) that are allowed to use the key.
IosKeyRestrictions ApiKeyRestrictionsIosKeyRestrictions
The iOS apps that are allowed to use the key.
ServerKeyRestrictions ApiKeyRestrictionsServerKeyRestrictions
The IP addresses of callers that are allowed to use the key.
AndroidKeyRestrictions ApiKeyRestrictionsAndroidKeyRestrictions
The Android apps that are allowed to use the key.
ApiTargets []ApiKeyRestrictionsApiTarget
A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
BrowserKeyRestrictions ApiKeyRestrictionsBrowserKeyRestrictions
The HTTP referrers (websites) that are allowed to use the key.
IosKeyRestrictions ApiKeyRestrictionsIosKeyRestrictions
The iOS apps that are allowed to use the key.
ServerKeyRestrictions ApiKeyRestrictionsServerKeyRestrictions
The IP addresses of callers that are allowed to use the key.
androidKeyRestrictions ApiKeyRestrictionsAndroidKeyRestrictions
The Android apps that are allowed to use the key.
apiTargets List<ApiKeyRestrictionsApiTarget>
A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
browserKeyRestrictions ApiKeyRestrictionsBrowserKeyRestrictions
The HTTP referrers (websites) that are allowed to use the key.
iosKeyRestrictions ApiKeyRestrictionsIosKeyRestrictions
The iOS apps that are allowed to use the key.
serverKeyRestrictions ApiKeyRestrictionsServerKeyRestrictions
The IP addresses of callers that are allowed to use the key.
androidKeyRestrictions ApiKeyRestrictionsAndroidKeyRestrictions
The Android apps that are allowed to use the key.
apiTargets ApiKeyRestrictionsApiTarget[]
A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
browserKeyRestrictions ApiKeyRestrictionsBrowserKeyRestrictions
The HTTP referrers (websites) that are allowed to use the key.
iosKeyRestrictions ApiKeyRestrictionsIosKeyRestrictions
The iOS apps that are allowed to use the key.
serverKeyRestrictions ApiKeyRestrictionsServerKeyRestrictions
The IP addresses of callers that are allowed to use the key.
android_key_restrictions ApiKeyRestrictionsAndroidKeyRestrictions
The Android apps that are allowed to use the key.
api_targets Sequence[ApiKeyRestrictionsApiTarget]
A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
browser_key_restrictions ApiKeyRestrictionsBrowserKeyRestrictions
The HTTP referrers (websites) that are allowed to use the key.
ios_key_restrictions ApiKeyRestrictionsIosKeyRestrictions
The iOS apps that are allowed to use the key.
server_key_restrictions ApiKeyRestrictionsServerKeyRestrictions
The IP addresses of callers that are allowed to use the key.
androidKeyRestrictions Property Map
The Android apps that are allowed to use the key.
apiTargets List<Property Map>
A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
browserKeyRestrictions Property Map
The HTTP referrers (websites) that are allowed to use the key.
iosKeyRestrictions Property Map
The iOS apps that are allowed to use the key.
serverKeyRestrictions Property Map
The IP addresses of callers that are allowed to use the key.

ApiKeyRestrictionsAndroidKeyRestrictions
, ApiKeyRestrictionsAndroidKeyRestrictionsArgs

AllowedApplications This property is required. List<ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplication>
A list of Android applications that are allowed to make API calls with this key.
AllowedApplications This property is required. []ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplication
A list of Android applications that are allowed to make API calls with this key.
allowedApplications This property is required. List<ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplication>
A list of Android applications that are allowed to make API calls with this key.
allowedApplications This property is required. ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplication[]
A list of Android applications that are allowed to make API calls with this key.
allowed_applications This property is required. Sequence[ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplication]
A list of Android applications that are allowed to make API calls with this key.
allowedApplications This property is required. List<Property Map>
A list of Android applications that are allowed to make API calls with this key.

ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplication
, ApiKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationArgs

PackageName This property is required. string
The package name of the application.
Sha1Fingerprint This property is required. string
The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.


PackageName This property is required. string
The package name of the application.
Sha1Fingerprint This property is required. string
The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.


packageName This property is required. String
The package name of the application.
sha1Fingerprint This property is required. String
The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.


packageName This property is required. string
The package name of the application.
sha1Fingerprint This property is required. string
The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.


package_name This property is required. str
The package name of the application.
sha1_fingerprint This property is required. str
The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.


packageName This property is required. String
The package name of the application.
sha1Fingerprint This property is required. String
The SHA1 fingerprint of the application. For example, both sha1 formats are acceptable : DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09 or DA39A3EE5E6B4B0D3255BFEF95601890AFD80709. Output format is the latter.


ApiKeyRestrictionsApiTarget
, ApiKeyRestrictionsApiTargetArgs

Service This property is required. string
The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
Methods List<string>
Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
Service This property is required. string
The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
Methods []string
Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
service This property is required. String
The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
methods List<String>
Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
service This property is required. string
The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
methods string[]
Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
service This property is required. str
The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
methods Sequence[str]
Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*
service This property is required. String
The service for this restriction. It should be the canonical service name, for example: translate.googleapis.com. You can use gcloud services list to get a list of services that are enabled in the project.
methods List<String>
Optional. List of one or more methods that can be called. If empty, all methods for the service are allowed. A wildcard (*) can be used as the last symbol. Valid examples: google.cloud.translate.v2.TranslateService.GetSupportedLanguage TranslateText Get* translate.googleapis.com.Get*

ApiKeyRestrictionsBrowserKeyRestrictions
, ApiKeyRestrictionsBrowserKeyRestrictionsArgs

AllowedReferrers This property is required. List<string>
A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
AllowedReferrers This property is required. []string
A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
allowedReferrers This property is required. List<String>
A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
allowedReferrers This property is required. string[]
A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
allowed_referrers This property is required. Sequence[str]
A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.
allowedReferrers This property is required. List<String>
A list of regular expressions for the referrer URLs that are allowed to make API calls with this key.

ApiKeyRestrictionsIosKeyRestrictions
, ApiKeyRestrictionsIosKeyRestrictionsArgs

AllowedBundleIds This property is required. List<string>
A list of bundle IDs that are allowed when making API calls with this key.
AllowedBundleIds This property is required. []string
A list of bundle IDs that are allowed when making API calls with this key.
allowedBundleIds This property is required. List<String>
A list of bundle IDs that are allowed when making API calls with this key.
allowedBundleIds This property is required. string[]
A list of bundle IDs that are allowed when making API calls with this key.
allowed_bundle_ids This property is required. Sequence[str]
A list of bundle IDs that are allowed when making API calls with this key.
allowedBundleIds This property is required. List<String>
A list of bundle IDs that are allowed when making API calls with this key.

ApiKeyRestrictionsServerKeyRestrictions
, ApiKeyRestrictionsServerKeyRestrictionsArgs

AllowedIps This property is required. List<string>
A list of the caller IP addresses that are allowed to make API calls with this key.
AllowedIps This property is required. []string
A list of the caller IP addresses that are allowed to make API calls with this key.
allowedIps This property is required. List<String>
A list of the caller IP addresses that are allowed to make API calls with this key.
allowedIps This property is required. string[]
A list of the caller IP addresses that are allowed to make API calls with this key.
allowed_ips This property is required. Sequence[str]
A list of the caller IP addresses that are allowed to make API calls with this key.
allowedIps This property is required. List<String>
A list of the caller IP addresses that are allowed to make API calls with this key.

Import

Key can be imported using any of these accepted formats:

  • projects/{{project}}/locations/global/keys/{{name}}

  • {{project}}/{{name}}

  • {{name}}

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

$ pulumi import gcp:projects/apiKey:ApiKey default projects/{{project}}/locations/global/keys/{{name}}
Copy
$ pulumi import gcp:projects/apiKey:ApiKey default {{project}}/{{name}}
Copy
$ pulumi import gcp:projects/apiKey:ApiKey default {{name}}
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.