Edge Cache Origin Args
EdgeCacheOrigin represents a HTTP-reachable backend for an EdgeCacheService. To get more information about EdgeCacheOrigin, see:
Example Usage
Network Services Edge Cache Origin Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networkservices.EdgeCacheOrigin;
import com.pulumi.gcp.networkservices.EdgeCacheOriginArgs;
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 default_ = new EdgeCacheOrigin("default", EdgeCacheOriginArgs.builder()
.description("The default bucket for media edge test")
.originAddress("gs://media-edge-default")
.build());
}
}
Network Services Edge Cache Origin Advanced
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networkservices.EdgeCacheOrigin;
import com.pulumi.gcp.networkservices.EdgeCacheOriginArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheOriginTimeoutArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheOriginOriginOverrideActionArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheOriginOriginOverrideActionUrlRewriteArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheOriginOriginOverrideActionHeaderActionArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheOriginOriginRedirectArgs;
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 fallback = new EdgeCacheOrigin("fallback", EdgeCacheOriginArgs.builder()
.originAddress("fallback.example.com")
.description("The default bucket for media edge test")
.maxAttempts(3)
.protocol("HTTP")
.port(80)
.retryConditions(
"CONNECT_FAILURE",
"NOT_FOUND",
"HTTP_5XX",
"FORBIDDEN")
.timeout(EdgeCacheOriginTimeoutArgs.builder()
.connectTimeout("10s")
.maxAttemptsTimeout("20s")
.responseTimeout("60s")
.readTimeout("5s")
.build())
.originOverrideAction(EdgeCacheOriginOriginOverrideActionArgs.builder()
.urlRewrite(EdgeCacheOriginOriginOverrideActionUrlRewriteArgs.builder()
.hostRewrite("example.com")
.build())
.headerAction(EdgeCacheOriginOriginOverrideActionHeaderActionArgs.builder()
.requestHeadersToAdds(EdgeCacheOriginOriginOverrideActionHeaderActionRequestHeadersToAddArgs.builder()
.headerName("x-header")
.headerValue("value")
.replace(true)
.build())
.build())
.build())
.originRedirect(EdgeCacheOriginOriginRedirectArgs.builder()
.redirectConditions(
"MOVED_PERMANENTLY",
"FOUND",
"SEE_OTHER",
"TEMPORARY_REDIRECT",
"PERMANENT_REDIRECT")
.build())
.build());
var default_ = new EdgeCacheOrigin("default", EdgeCacheOriginArgs.builder()
.originAddress("gs://media-edge-default")
.failoverOrigin(fallback.id())
.description("The default bucket for media edge test")
.maxAttempts(2)
.labels(Map.of("a", "b"))
.timeout(EdgeCacheOriginTimeoutArgs.builder()
.connectTimeout("10s")
.build())
.build());
}
}
Network Services Edge Cache Origin V4auth
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.Secret;
import com.pulumi.gcp.secretmanager.SecretArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
import com.pulumi.gcp.secretmanager.SecretVersion;
import com.pulumi.gcp.secretmanager.SecretVersionArgs;
import com.pulumi.gcp.networkservices.EdgeCacheOrigin;
import com.pulumi.gcp.networkservices.EdgeCacheOriginArgs;
import com.pulumi.gcp.networkservices.inputs.EdgeCacheOriginAwsV4AuthenticationArgs;
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 secret_basic = new Secret("secret-basic", SecretArgs.builder()
.secretId("secret-name")
.replication(SecretReplicationArgs.builder()
.auto()
.build())
.build());
var secret_version_basic = new SecretVersion("secret-version-basic", SecretVersionArgs.builder()
.secret(secret_basic.id())
.secretData("secret-data")
.build());
var default_ = new EdgeCacheOrigin("default", EdgeCacheOriginArgs.builder()
.originAddress("gs://media-edge-default")
.description("The default bucket for V4 authentication")
.awsV4Authentication(EdgeCacheOriginAwsV4AuthenticationArgs.builder()
.accessKeyId("ACCESSKEYID")
.secretAccessKeyVersion(secret_version_basic.id())
.originRegion("auto")
.build())
.build());
}
}
Import
EdgeCacheOrigin can be imported using any of these accepted formats
$ pulumi import gcp:networkservices/edgeCacheOrigin:EdgeCacheOrigin default projects/{{project}}/locations/global/edgeCacheOrigins/{{name}}
$ pulumi import gcp:networkservices/edgeCacheOrigin:EdgeCacheOrigin default {{project}}/{{name}}
$ pulumi import gcp:networkservices/edgeCacheOrigin:EdgeCacheOrigin default {{name}}
Constructors
Properties
Enable AWS Signature Version 4 origin authentication. Structure is documented below.
A human-readable description of the resource.
The Origin resource to try when the current origin cannot be reached. After maxAttempts is reached, the configured failoverOrigin will be used to fulfil the request. The value of timeout.maxAttemptsTimeout dictates the timeout across all origins. A reference to a Topic resource.
The maximum number of attempts to cache fill from this origin. Another attempt is made when a cache fill fails with one of the retryConditions. Once maxAttempts to this origin have failed the failoverOrigin will be used, if one is specified. That failoverOrigin may specify its own maxAttempts, retryConditions and failoverOrigin to control its own cache fill failures. The total number of allowed attempts to cache fill across this and failover origins is limited to four. The total time allowed for cache fill attempts across this and failover origins can be controlled with maxAttemptsTimeout. The last valid, non-retried response from all origins will be returned to the client. If no origin returns a valid response, an HTTP 502 will be returned to the client. Defaults to 1. Must be a value greater than 0 and less than 4.
Name of the resource; provided by the client when the resource is created. The name must be 1-64 characters long, and match the regular expression a-zA-Z0-9_-* which means the first character must be a letter, and all following characters must be a dash, underscore, letter or digit.
A fully qualified domain name (FQDN) or IP address reachable over the public Internet, or the address of a Google Cloud Storage bucket. This address will be used as the origin for cache requests - e.g. FQDN: media-backend.example.com, IPv4: 35.218.1.1, IPv6: 2607:f8b0:4012:809::200e, Cloud Storage: gs://bucketname When providing an FQDN (hostname), it must be publicly resolvable (e.g. via Google public DNS) and IP addresses must be publicly routable. It must not contain a protocol (e.g., https://) and it must not contain any slashes. If a Cloud Storage bucket is provided, it must be in the canonical "gs://bucketname" format. Other forms, such as "storage.googleapis.com", will be rejected.
The override actions, including url rewrites and header additions, for requests that use this origin. Structure is documented below.
Follow redirects from this origin. Structure is documented below.
The protocol to use to connect to the configured origin. Defaults to HTTP2, and it is strongly recommended that users use HTTP2 for both security & performance. When using HTTP2 or HTTPS as the protocol, a valid, publicly-signed, unexpired TLS (SSL) certificate must be presented by the origin server. Possible values are: HTTP2
, HTTPS
, HTTP
.
Specifies one or more retry conditions for the configured origin. If the failure mode during a connection attempt to the origin matches the configured retryCondition(s), the origin request will be retried up to maxAttempts times. The failoverOrigin, if configured, will then be used to satisfy the request. The default retryCondition is "CONNECT_FAILURE". retryConditions apply to this origin, and not subsequent failoverOrigin(s), which may specify their own retryConditions and maxAttempts. Valid values are:
The connection and HTTP timeout configuration for this origin. Structure is documented below.