gcp.compute.BackendServiceSignedUrlKey
Explore with Pulumi AI
A key for signing Cloud CDN signed URLs for Backend Services.
To get more information about BackendServiceSignedUrlKey, see:
- API documentation
- How-to Guides
Example Usage
Backend Service Signed Url Key
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as random from "@pulumi/random";
const urlSignature = new random.RandomId("url_signature", {byteLength: 16});
const webserver = new gcp.compute.InstanceTemplate("webserver", {
name: "standard-webserver",
machineType: "e2-medium",
networkInterfaces: [{
network: "default",
}],
disks: [{
sourceImage: "debian-cloud/debian-11",
autoDelete: true,
boot: true,
}],
});
const webservers = new gcp.compute.InstanceGroupManager("webservers", {
name: "my-webservers",
versions: [{
instanceTemplate: webserver.id,
name: "primary",
}],
baseInstanceName: "webserver",
zone: "us-central1-f",
targetSize: 1,
});
const _default = new gcp.compute.HttpHealthCheck("default", {
name: "test",
requestPath: "/",
checkIntervalSec: 1,
timeoutSec: 1,
});
const exampleBackend = new gcp.compute.BackendService("example_backend", {
name: "my-backend-service",
description: "Our company website",
portName: "http",
protocol: "HTTP",
timeoutSec: 10,
enableCdn: true,
backends: [{
group: webservers.instanceGroup,
}],
healthChecks: _default.id,
});
const backendKey = new gcp.compute.BackendServiceSignedUrlKey("backend_key", {
name: "test-key",
keyValue: urlSignature.b64Url,
backendService: exampleBackend.name,
});
import pulumi
import pulumi_gcp as gcp
import pulumi_random as random
url_signature = random.RandomId("url_signature", byte_length=16)
webserver = gcp.compute.InstanceTemplate("webserver",
name="standard-webserver",
machine_type="e2-medium",
network_interfaces=[gcp.compute.InstanceTemplateNetworkInterfaceArgs(
network="default",
)],
disks=[gcp.compute.InstanceTemplateDiskArgs(
source_image="debian-cloud/debian-11",
auto_delete=True,
boot=True,
)])
webservers = gcp.compute.InstanceGroupManager("webservers",
name="my-webservers",
versions=[gcp.compute.InstanceGroupManagerVersionArgs(
instance_template=webserver.id,
name="primary",
)],
base_instance_name="webserver",
zone="us-central1-f",
target_size=1)
default = gcp.compute.HttpHealthCheck("default",
name="test",
request_path="/",
check_interval_sec=1,
timeout_sec=1)
example_backend = gcp.compute.BackendService("example_backend",
name="my-backend-service",
description="Our company website",
port_name="http",
protocol="HTTP",
timeout_sec=10,
enable_cdn=True,
backends=[gcp.compute.BackendServiceBackendArgs(
group=webservers.instance_group,
)],
health_checks=default.id)
backend_key = gcp.compute.BackendServiceSignedUrlKey("backend_key",
name="test-key",
key_value=url_signature.b64_url,
backend_service=example_backend.name)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
urlSignature, err := random.NewRandomId(ctx, "url_signature", &random.RandomIdArgs{
ByteLength: pulumi.Int(16),
})
if err != nil {
return err
}
webserver, err := compute.NewInstanceTemplate(ctx, "webserver", &compute.InstanceTemplateArgs{
Name: pulumi.String("standard-webserver"),
MachineType: pulumi.String("e2-medium"),
NetworkInterfaces: compute.InstanceTemplateNetworkInterfaceArray{
&compute.InstanceTemplateNetworkInterfaceArgs{
Network: pulumi.String("default"),
},
},
Disks: compute.InstanceTemplateDiskArray{
&compute.InstanceTemplateDiskArgs{
SourceImage: pulumi.String("debian-cloud/debian-11"),
AutoDelete: pulumi.Bool(true),
Boot: pulumi.Bool(true),
},
},
})
if err != nil {
return err
}
webservers, err := compute.NewInstanceGroupManager(ctx, "webservers", &compute.InstanceGroupManagerArgs{
Name: pulumi.String("my-webservers"),
Versions: compute.InstanceGroupManagerVersionArray{
&compute.InstanceGroupManagerVersionArgs{
InstanceTemplate: webserver.ID(),
Name: pulumi.String("primary"),
},
},
BaseInstanceName: pulumi.String("webserver"),
Zone: pulumi.String("us-central1-f"),
TargetSize: pulumi.Int(1),
})
if err != nil {
return err
}
_, err = compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
Name: pulumi.String("test"),
RequestPath: pulumi.String("/"),
CheckIntervalSec: pulumi.Int(1),
TimeoutSec: pulumi.Int(1),
})
if err != nil {
return err
}
exampleBackend, err := compute.NewBackendService(ctx, "example_backend", &compute.BackendServiceArgs{
Name: pulumi.String("my-backend-service"),
Description: pulumi.String("Our company website"),
PortName: pulumi.String("http"),
Protocol: pulumi.String("HTTP"),
TimeoutSec: pulumi.Int(10),
EnableCdn: pulumi.Bool(true),
Backends: compute.BackendServiceBackendArray{
&compute.BackendServiceBackendArgs{
Group: webservers.InstanceGroup,
},
},
HealthChecks: _default.ID(),
})
if err != nil {
return err
}
_, err = compute.NewBackendServiceSignedUrlKey(ctx, "backend_key", &compute.BackendServiceSignedUrlKeyArgs{
Name: pulumi.String("test-key"),
KeyValue: urlSignature.B64Url,
BackendService: exampleBackend.Name,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var urlSignature = new Random.RandomId("url_signature", new()
{
ByteLength = 16,
});
var webserver = new Gcp.Compute.InstanceTemplate("webserver", new()
{
Name = "standard-webserver",
MachineType = "e2-medium",
NetworkInterfaces = new[]
{
new Gcp.Compute.Inputs.InstanceTemplateNetworkInterfaceArgs
{
Network = "default",
},
},
Disks = new[]
{
new Gcp.Compute.Inputs.InstanceTemplateDiskArgs
{
SourceImage = "debian-cloud/debian-11",
AutoDelete = true,
Boot = true,
},
},
});
var webservers = new Gcp.Compute.InstanceGroupManager("webservers", new()
{
Name = "my-webservers",
Versions = new[]
{
new Gcp.Compute.Inputs.InstanceGroupManagerVersionArgs
{
InstanceTemplate = webserver.Id,
Name = "primary",
},
},
BaseInstanceName = "webserver",
Zone = "us-central1-f",
TargetSize = 1,
});
var @default = new Gcp.Compute.HttpHealthCheck("default", new()
{
Name = "test",
RequestPath = "/",
CheckIntervalSec = 1,
TimeoutSec = 1,
});
var exampleBackend = new Gcp.Compute.BackendService("example_backend", new()
{
Name = "my-backend-service",
Description = "Our company website",
PortName = "http",
Protocol = "HTTP",
TimeoutSec = 10,
EnableCdn = true,
Backends = new[]
{
new Gcp.Compute.Inputs.BackendServiceBackendArgs
{
Group = webservers.InstanceGroup,
},
},
HealthChecks = @default.Id,
});
var backendKey = new Gcp.Compute.BackendServiceSignedUrlKey("backend_key", new()
{
Name = "test-key",
KeyValue = urlSignature.B64Url,
BackendService = exampleBackend.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomId;
import com.pulumi.random.RandomIdArgs;
import com.pulumi.gcp.compute.InstanceTemplate;
import com.pulumi.gcp.compute.InstanceTemplateArgs;
import com.pulumi.gcp.compute.inputs.InstanceTemplateNetworkInterfaceArgs;
import com.pulumi.gcp.compute.inputs.InstanceTemplateDiskArgs;
import com.pulumi.gcp.compute.InstanceGroupManager;
import com.pulumi.gcp.compute.InstanceGroupManagerArgs;
import com.pulumi.gcp.compute.inputs.InstanceGroupManagerVersionArgs;
import com.pulumi.gcp.compute.HttpHealthCheck;
import com.pulumi.gcp.compute.HttpHealthCheckArgs;
import com.pulumi.gcp.compute.BackendService;
import com.pulumi.gcp.compute.BackendServiceArgs;
import com.pulumi.gcp.compute.inputs.BackendServiceBackendArgs;
import com.pulumi.gcp.compute.BackendServiceSignedUrlKey;
import com.pulumi.gcp.compute.BackendServiceSignedUrlKeyArgs;
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 urlSignature = new RandomId("urlSignature", RandomIdArgs.builder()
.byteLength(16)
.build());
var webserver = new InstanceTemplate("webserver", InstanceTemplateArgs.builder()
.name("standard-webserver")
.machineType("e2-medium")
.networkInterfaces(InstanceTemplateNetworkInterfaceArgs.builder()
.network("default")
.build())
.disks(InstanceTemplateDiskArgs.builder()
.sourceImage("debian-cloud/debian-11")
.autoDelete(true)
.boot(true)
.build())
.build());
var webservers = new InstanceGroupManager("webservers", InstanceGroupManagerArgs.builder()
.name("my-webservers")
.versions(InstanceGroupManagerVersionArgs.builder()
.instanceTemplate(webserver.id())
.name("primary")
.build())
.baseInstanceName("webserver")
.zone("us-central1-f")
.targetSize(1)
.build());
var default_ = new HttpHealthCheck("default", HttpHealthCheckArgs.builder()
.name("test")
.requestPath("/")
.checkIntervalSec(1)
.timeoutSec(1)
.build());
var exampleBackend = new BackendService("exampleBackend", BackendServiceArgs.builder()
.name("my-backend-service")
.description("Our company website")
.portName("http")
.protocol("HTTP")
.timeoutSec(10)
.enableCdn(true)
.backends(BackendServiceBackendArgs.builder()
.group(webservers.instanceGroup())
.build())
.healthChecks(default_.id())
.build());
var backendKey = new BackendServiceSignedUrlKey("backendKey", BackendServiceSignedUrlKeyArgs.builder()
.name("test-key")
.keyValue(urlSignature.b64Url())
.backendService(exampleBackend.name())
.build());
}
}
resources:
urlSignature:
type: random:RandomId
name: url_signature
properties:
byteLength: 16
backendKey:
type: gcp:compute:BackendServiceSignedUrlKey
name: backend_key
properties:
name: test-key
keyValue: ${urlSignature.b64Url}
backendService: ${exampleBackend.name}
exampleBackend:
type: gcp:compute:BackendService
name: example_backend
properties:
name: my-backend-service
description: Our company website
portName: http
protocol: HTTP
timeoutSec: 10
enableCdn: true
backends:
- group: ${webservers.instanceGroup}
healthChecks: ${default.id}
webservers:
type: gcp:compute:InstanceGroupManager
properties:
name: my-webservers
versions:
- instanceTemplate: ${webserver.id}
name: primary
baseInstanceName: webserver
zone: us-central1-f
targetSize: 1
webserver:
type: gcp:compute:InstanceTemplate
properties:
name: standard-webserver
machineType: e2-medium
networkInterfaces:
- network: default
disks:
- sourceImage: debian-cloud/debian-11
autoDelete: true
boot: true
default:
type: gcp:compute:HttpHealthCheck
properties:
name: test
requestPath: /
checkIntervalSec: 1
timeoutSec: 1
Create BackendServiceSignedUrlKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BackendServiceSignedUrlKey(name: string, args: BackendServiceSignedUrlKeyArgs, opts?: CustomResourceOptions);
@overload
def BackendServiceSignedUrlKey(resource_name: str,
args: BackendServiceSignedUrlKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BackendServiceSignedUrlKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
backend_service: Optional[str] = None,
key_value: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None)
func NewBackendServiceSignedUrlKey(ctx *Context, name string, args BackendServiceSignedUrlKeyArgs, opts ...ResourceOption) (*BackendServiceSignedUrlKey, error)
public BackendServiceSignedUrlKey(string name, BackendServiceSignedUrlKeyArgs args, CustomResourceOptions? opts = null)
public BackendServiceSignedUrlKey(String name, BackendServiceSignedUrlKeyArgs args)
public BackendServiceSignedUrlKey(String name, BackendServiceSignedUrlKeyArgs args, CustomResourceOptions options)
type: gcp:compute:BackendServiceSignedUrlKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BackendServiceSignedUrlKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args BackendServiceSignedUrlKeyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BackendServiceSignedUrlKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BackendServiceSignedUrlKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BackendServiceSignedUrlKeyArgs
- 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 backendServiceSignedUrlKeyResource = new Gcp.Compute.BackendServiceSignedUrlKey("backendServiceSignedUrlKeyResource", new()
{
BackendService = "string",
KeyValue = "string",
Name = "string",
Project = "string",
});
example, err := compute.NewBackendServiceSignedUrlKey(ctx, "backendServiceSignedUrlKeyResource", &compute.BackendServiceSignedUrlKeyArgs{
BackendService: pulumi.String("string"),
KeyValue: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
})
var backendServiceSignedUrlKeyResource = new BackendServiceSignedUrlKey("backendServiceSignedUrlKeyResource", BackendServiceSignedUrlKeyArgs.builder()
.backendService("string")
.keyValue("string")
.name("string")
.project("string")
.build());
backend_service_signed_url_key_resource = gcp.compute.BackendServiceSignedUrlKey("backendServiceSignedUrlKeyResource",
backend_service="string",
key_value="string",
name="string",
project="string")
const backendServiceSignedUrlKeyResource = new gcp.compute.BackendServiceSignedUrlKey("backendServiceSignedUrlKeyResource", {
backendService: "string",
keyValue: "string",
name: "string",
project: "string",
});
type: gcp:compute:BackendServiceSignedUrlKey
properties:
backendService: string
keyValue: string
name: string
project: string
BackendServiceSignedUrlKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The BackendServiceSignedUrlKey resource accepts the following input properties:
- Backend
Service string - The backend service this signed URL key belongs.
- Key
Value string - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- Name string
- Name of the signed URL key.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Backend
Service string - The backend service this signed URL key belongs.
- Key
Value string - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- Name string
- Name of the signed URL key.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend
Service String - The backend service this signed URL key belongs.
- key
Value String - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name String
- Name of the signed URL key.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend
Service string - The backend service this signed URL key belongs.
- key
Value string - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name string
- Name of the signed URL key.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend_
service str - The backend service this signed URL key belongs.
- key_
value str - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name str
- Name of the signed URL key.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend
Service String - The backend service this signed URL key belongs.
- key
Value String - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name String
- Name of the signed URL key.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the BackendServiceSignedUrlKey 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 BackendServiceSignedUrlKey Resource
Get an existing BackendServiceSignedUrlKey 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?: BackendServiceSignedUrlKeyState, opts?: CustomResourceOptions): BackendServiceSignedUrlKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backend_service: Optional[str] = None,
key_value: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None) -> BackendServiceSignedUrlKey
func GetBackendServiceSignedUrlKey(ctx *Context, name string, id IDInput, state *BackendServiceSignedUrlKeyState, opts ...ResourceOption) (*BackendServiceSignedUrlKey, error)
public static BackendServiceSignedUrlKey Get(string name, Input<string> id, BackendServiceSignedUrlKeyState? state, CustomResourceOptions? opts = null)
public static BackendServiceSignedUrlKey get(String name, Output<String> id, BackendServiceSignedUrlKeyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Backend
Service string - The backend service this signed URL key belongs.
- Key
Value string - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- Name string
- Name of the signed URL key.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Backend
Service string - The backend service this signed URL key belongs.
- Key
Value string - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- Name string
- Name of the signed URL key.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend
Service String - The backend service this signed URL key belongs.
- key
Value String - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name String
- Name of the signed URL key.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend
Service string - The backend service this signed URL key belongs.
- key
Value string - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name string
- Name of the signed URL key.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend_
service str - The backend service this signed URL key belongs.
- key_
value str - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name str
- Name of the signed URL key.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- backend
Service String - The backend service this signed URL key belongs.
- key
Value String - 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. Note: This property is sensitive and will not be displayed in the plan.
- name String
- Name of the signed URL key.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Import
This resource does not support import.
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.