AWS Classic
Stage
Manages an API Gateway Stage. A stage is a named reference to a deployment, which can be done via the aws.apigateway.Deployment
resource. Stages can be optionally managed further with the aws.apigateway.BasePathMapping
resource, aws.apigateway.DomainName
resource, and aws_api_method_settings
resource. For more information, see the API Gateway Developer Guide.
Example Usage
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
private static string ComputeSHA1(string input) {
return BitConverter.ToString(
SHA1.Create().ComputeHash(Encoding.UTF8.GetBytes(input))
).Replace("-","").ToLowerInvariant());
}
public MyStack()
{
var exampleRestApi = new Aws.ApiGateway.RestApi("exampleRestApi", new Aws.ApiGateway.RestApiArgs
{
Body = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "openapi", "3.0.1" },
{ "info", new Dictionary<string, object?>
{
{ "title", "example" },
{ "version", "1.0" },
} },
{ "paths", new Dictionary<string, object?>
{
{ "/path1", new Dictionary<string, object?>
{
{ "get", new Dictionary<string, object?>
{
{ "x-amazon-apigateway-integration", new Dictionary<string, object?>
{
{ "httpMethod", "GET" },
{ "payloadFormatVersion", "1.0" },
{ "type", "HTTP_PROXY" },
{ "uri", "https://ip-ranges.amazonaws.com/ip-ranges.json" },
} },
} },
} },
} },
}),
});
var exampleDeployment = new Aws.ApiGateway.Deployment("exampleDeployment", new Aws.ApiGateway.DeploymentArgs
{
RestApi = exampleRestApi.Id,
Triggers =
{
{ "redeployment", exampleRestApi.Body.Apply(body => JsonSerializer.Serialize(body)).Apply(toJSON => ComputeSHA1(toJSON)) },
},
});
var exampleStage = new Aws.ApiGateway.Stage("exampleStage", new Aws.ApiGateway.StageArgs
{
Deployment = exampleDeployment.Id,
RestApi = exampleRestApi.Id,
StageName = "example",
});
var exampleMethodSettings = new Aws.ApiGateway.MethodSettings("exampleMethodSettings", new Aws.ApiGateway.MethodSettingsArgs
{
RestApi = exampleRestApi.Id,
StageName = exampleStage.StageName,
MethodPath = "*/*",
Settings = new Aws.ApiGateway.Inputs.MethodSettingsSettingsArgs
{
MetricsEnabled = true,
LoggingLevel = "INFO",
},
});
}
}
package main
import (
"crypto/sha1"
"encoding/json"
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func sha1Hash(input string) string {
hash := sha1.Sum([]byte(input))
return hex.EncodeToString(hash[:])
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"openapi": "3.0.1",
"info": map[string]interface{}{
"title": "example",
"version": "1.0",
},
"paths": map[string]interface{}{
"/path1": map[string]interface{}{
"get": map[string]interface{}{
"x-amazon-apigateway-integration": map[string]interface{}{
"httpMethod": "GET",
"payloadFormatVersion": "1.0",
"type": "HTTP_PROXY",
"uri": "https://ip-ranges.amazonaws.com/ip-ranges.json",
},
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
exampleRestApi, err := apigateway.NewRestApi(ctx, "exampleRestApi", &apigateway.RestApiArgs{
Body: pulumi.String(json0),
})
if err != nil {
return err
}
exampleDeployment, err := apigateway.NewDeployment(ctx, "exampleDeployment", &apigateway.DeploymentArgs{
RestApi: exampleRestApi.ID(),
Triggers: pulumi.StringMap{
"redeployment": exampleRestApi.Body.ApplyT(func(body string) (pulumi.String, error) {
var _zero pulumi.String
tmpJSON1, err := json.Marshal(body)
if err != nil {
return _zero, err
}
json1 := string(tmpJSON1)
return json1, nil
}).(pulumi.StringOutput).ApplyT(func(toJSON string) (pulumi.String, error) {
return sha1Hash(toJSON), nil
}).(pulumi.StringOutput),
},
})
if err != nil {
return err
}
exampleStage, err := apigateway.NewStage(ctx, "exampleStage", &apigateway.StageArgs{
Deployment: exampleDeployment.ID(),
RestApi: exampleRestApi.ID(),
StageName: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = apigateway.NewMethodSettings(ctx, "exampleMethodSettings", &apigateway.MethodSettingsArgs{
RestApi: exampleRestApi.ID(),
StageName: exampleStage.StageName,
MethodPath: pulumi.String("*/*"),
Settings: &apigateway.MethodSettingsSettingsArgs{
MetricsEnabled: pulumi.Bool(true),
LoggingLevel: pulumi.String("INFO"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import static com.pulumi.codegen.internal.Serialization.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleRestApi = new RestApi("exampleRestApi", RestApiArgs.builder()
.body(serializeJson(
jsonObject(
jsonProperty("openapi", "3.0.1"),
jsonProperty("info", jsonObject(
jsonProperty("title", "example"),
jsonProperty("version", "1.0")
)),
jsonProperty("paths", jsonObject(
jsonProperty("/path1", jsonObject(
jsonProperty("get", jsonObject(
jsonProperty("x-amazon-apigateway-integration", jsonObject(
jsonProperty("httpMethod", "GET"),
jsonProperty("payloadFormatVersion", "1.0"),
jsonProperty("type", "HTTP_PROXY"),
jsonProperty("uri", "https://ip-ranges.amazonaws.com/ip-ranges.json")
))
))
))
))
)))
.build());
var exampleDeployment = new Deployment("exampleDeployment", DeploymentArgs.builder()
.restApi(exampleRestApi.getId())
.triggers(Map.of("redeployment", exampleRestApi.getBody().apply(body -> serializeJson(
body)).apply(toJSON -> computeSHA1(toJSON))))
.build());
var exampleStage = new Stage("exampleStage", StageArgs.builder()
.deployment(exampleDeployment.getId())
.restApi(exampleRestApi.getId())
.stageName("example")
.build());
var exampleMethodSettings = new MethodSettings("exampleMethodSettings", MethodSettingsArgs.builder()
.restApi(exampleRestApi.getId())
.stageName(exampleStage.getStageName())
.methodPath("*/*")
.settings(MethodSettingsSettings.builder()
.metricsEnabled(true)
.loggingLevel("INFO")
.build())
.build());
}
}
import pulumi
import hashlib
import json
import pulumi_aws as aws
example_rest_api = aws.apigateway.RestApi("exampleRestApi", body=json.dumps({
"openapi": "3.0.1",
"info": {
"title": "example",
"version": "1.0",
},
"paths": {
"/path1": {
"get": {
"x-amazon-apigateway-integration": {
"httpMethod": "GET",
"payloadFormatVersion": "1.0",
"type": "HTTP_PROXY",
"uri": "https://ip-ranges.amazonaws.com/ip-ranges.json",
},
},
},
},
}))
example_deployment = aws.apigateway.Deployment("exampleDeployment",
rest_api=example_rest_api.id,
triggers={
"redeployment": example_rest_api.body.apply(lambda body: json.dumps(body)).apply(lambda to_json: hashlib.sha1(to_json.encode()).hexdigest()),
})
example_stage = aws.apigateway.Stage("exampleStage",
deployment=example_deployment.id,
rest_api=example_rest_api.id,
stage_name="example")
example_method_settings = aws.apigateway.MethodSettings("exampleMethodSettings",
rest_api=example_rest_api.id,
stage_name=example_stage.stage_name,
method_path="*/*",
settings=aws.apigateway.MethodSettingsSettingsArgs(
metrics_enabled=True,
logging_level="INFO",
))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as crypto from "crypto";
const exampleRestApi = new aws.apigateway.RestApi("exampleRestApi", {body: JSON.stringify({
openapi: "3.0.1",
info: {
title: "example",
version: "1.0",
},
paths: {
"/path1": {
get: {
"x-amazon-apigateway-integration": {
httpMethod: "GET",
payloadFormatVersion: "1.0",
type: "HTTP_PROXY",
uri: "https://ip-ranges.amazonaws.com/ip-ranges.json",
},
},
},
},
})});
const exampleDeployment = new aws.apigateway.Deployment("exampleDeployment", {
restApi: exampleRestApi.id,
triggers: {
redeployment: exampleRestApi.body.apply(body => JSON.stringify(body)).apply(toJSON => crypto.createHash('sha1').update(toJSON).digest('hex')),
},
});
const exampleStage = new aws.apigateway.Stage("exampleStage", {
deployment: exampleDeployment.id,
restApi: exampleRestApi.id,
stageName: "example",
});
const exampleMethodSettings = new aws.apigateway.MethodSettings("exampleMethodSettings", {
restApi: exampleRestApi.id,
stageName: exampleStage.stageName,
methodPath: "*/*",
settings: {
metricsEnabled: true,
loggingLevel: "INFO",
},
});
Coming soon!
Managing the API Logging CloudWatch Log Group
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var stageName = config.Get("stageName") ?? "example";
var exampleRestApi = new Aws.ApiGateway.RestApi("exampleRestApi", new Aws.ApiGateway.RestApiArgs
{
});
// ... other configuration ...
var exampleLogGroup = new Aws.CloudWatch.LogGroup("exampleLogGroup", new Aws.CloudWatch.LogGroupArgs
{
RetentionInDays = 7,
});
// ... potentially other configuration ...
var exampleStage = new Aws.ApiGateway.Stage("exampleStage", new Aws.ApiGateway.StageArgs
{
StageName = stageName,
}, new CustomResourceOptions
{
DependsOn =
{
exampleLogGroup,
},
});
// ... other configuration ...
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/apigateway"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudwatch"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
stageName := "example"
if param := cfg.Get("stageName"); param != "" {
stageName = param
}
_, err := apigateway.NewRestApi(ctx, "exampleRestApi", nil)
if err != nil {
return err
}
exampleLogGroup, err := cloudwatch.NewLogGroup(ctx, "exampleLogGroup", &cloudwatch.LogGroupArgs{
RetentionInDays: pulumi.Int(7),
})
if err != nil {
return err
}
_, err = apigateway.NewStage(ctx, "exampleStage", &apigateway.StageArgs{
StageName: pulumi.String(stageName),
}, pulumi.DependsOn([]pulumi.Resource{
exampleLogGroup,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = Config.of();
final var stageName = config.get("stageName").orElse("example");
var exampleRestApi = new RestApi("exampleRestApi");
var exampleLogGroup = new LogGroup("exampleLogGroup", LogGroupArgs.builder()
.retentionInDays(7)
.build());
var exampleStage = new Stage("exampleStage", StageArgs.builder()
.stageName(stageName)
.build());
}
}
import pulumi
import pulumi_aws as aws
config = pulumi.Config()
stage_name = config.get("stageName")
if stage_name is None:
stage_name = "example"
example_rest_api = aws.apigateway.RestApi("exampleRestApi")
# ... other configuration ...
example_log_group = aws.cloudwatch.LogGroup("exampleLogGroup", retention_in_days=7)
# ... potentially other configuration ...
example_stage = aws.apigateway.Stage("exampleStage", stage_name=stage_name,
opts=pulumi.ResourceOptions(depends_on=[example_log_group]))
# ... other configuration ...
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const config = new pulumi.Config();
const stageName = config.get("stageName") || "example";
const exampleRestApi = new aws.apigateway.RestApi("exampleRestApi", {});
// ... other configuration ...
const exampleLogGroup = new aws.cloudwatch.LogGroup("exampleLogGroup", {retentionInDays: 7});
// ... potentially other configuration ...
const exampleStage = new aws.apigateway.Stage("exampleStage", {stageName: stageName}, {
dependsOn: [exampleLogGroup],
});
// ... other configuration ...
configuration:
stageName:
type: string
default: example
resources:
exampleRestApi:
type: aws:apigateway:RestApi
exampleStage:
type: aws:apigateway:Stage
properties:
stageName: ${stageName}
options:
dependson:
- ${exampleLogGroup}
exampleLogGroup:
type: aws:cloudwatch:LogGroup
properties:
retentionInDays: 7
Create a Stage Resource
new Stage(name: string, args: StageArgs, opts?: CustomResourceOptions);
@overload
def Stage(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_log_settings: Optional[StageAccessLogSettingsArgs] = None,
cache_cluster_enabled: Optional[bool] = None,
cache_cluster_size: Optional[str] = None,
canary_settings: Optional[StageCanarySettingsArgs] = None,
client_certificate_id: Optional[str] = None,
deployment: Optional[str] = None,
description: Optional[str] = None,
documentation_version: Optional[str] = None,
rest_api: Optional[str] = None,
stage_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
variables: Optional[Mapping[str, str]] = None,
xray_tracing_enabled: Optional[bool] = None)
@overload
def Stage(resource_name: str,
args: StageArgs,
opts: Optional[ResourceOptions] = None)
func NewStage(ctx *Context, name string, args StageArgs, opts ...ResourceOption) (*Stage, error)
public Stage(string name, StageArgs args, CustomResourceOptions? opts = null)
type: aws:apigateway:Stage
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StageArgs
- 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 StageArgs
- 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 StageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args StageArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Stage 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 Stage resource accepts the following input properties:
- Deployment string | string
The ID of the deployment that the stage points to
- Rest
Api string | string The ID of the associated REST API
- Stage
Name string The name of the stage
- Access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- Cache
Cluster boolEnabled Specifies whether a cache cluster is enabled for the stage
- Cache
Cluster stringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- Canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- Client
Certificate stringId The identifier of a client certificate for the stage.
- Description string
The description of the stage.
- Documentation
Version string The version of the associated API documentation
- Dictionary<string, string>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Variables Dictionary<string, string>
A map that defines the stage variables
- Xray
Tracing boolEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- Deployment string | string
The ID of the deployment that the stage points to
- Rest
Api string | string The ID of the associated REST API
- Stage
Name string The name of the stage
- Access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- Cache
Cluster boolEnabled Specifies whether a cache cluster is enabled for the stage
- Cache
Cluster stringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- Canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- Client
Certificate stringId The identifier of a client certificate for the stage.
- Description string
The description of the stage.
- Documentation
Version string The version of the associated API documentation
- map[string]string
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Variables map[string]string
A map that defines the stage variables
- Xray
Tracing boolEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- deployment String | String
The ID of the deployment that the stage points to
- rest
Api String | String The ID of the associated REST API
- stage
Name String The name of the stage
- access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- cache
Cluster BooleanEnabled Specifies whether a cache cluster is enabled for the stage
- cache
Cluster StringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- client
Certificate StringId The identifier of a client certificate for the stage.
- description String
The description of the stage.
- documentation
Version String The version of the associated API documentation
- Map
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- variables
Map
A map that defines the stage variables
- xray
Tracing BooleanEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- deployment string | Deployment
The ID of the deployment that the stage points to
- rest
Api string | RestApi The ID of the associated REST API
- stage
Name string The name of the stage
- access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- cache
Cluster booleanEnabled Specifies whether a cache cluster is enabled for the stage
- cache
Cluster stringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- client
Certificate stringId The identifier of a client certificate for the stage.
- description string
The description of the stage.
- documentation
Version string The version of the associated API documentation
- {[key: string]: string}
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- variables {[key: string]: string}
A map that defines the stage variables
- xray
Tracing booleanEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- deployment str | str
The ID of the deployment that the stage points to
- rest_
api str | str The ID of the associated REST API
- stage_
name str The name of the stage
- access_
log_ Stagesettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- cache_
cluster_ boolenabled Specifies whether a cache cluster is enabled for the stage
- cache_
cluster_ strsize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary_
settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- client_
certificate_ strid The identifier of a client certificate for the stage.
- description str
The description of the stage.
- documentation_
version str The version of the associated API documentation
- Mapping[str, str]
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- variables Mapping[str, str]
A map that defines the stage variables
- xray_
tracing_ boolenabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- deployment String |
The ID of the deployment that the stage points to
- rest
Api String | The ID of the associated REST API
- stage
Name String The name of the stage
- access
Log Property MapSettings Enables access logs for the API stage. See Access Log Settings below.
- cache
Cluster BooleanEnabled Specifies whether a cache cluster is enabled for the stage
- cache
Cluster StringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary
Settings Property Map Configuration settings of a canary deployment. See Canary Settings below.
- client
Certificate StringId The identifier of a client certificate for the stage.
- description String
The description of the stage.
- documentation
Version String The version of the associated API documentation
- Map
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- variables
Map
A map that defines the stage variables
- xray
Tracing BooleanEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Stage resource produces the following output properties:
- Arn string
Amazon Resource Name (ARN)
- Execution
Arn string The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- Id string
The provider-assigned unique ID for this managed resource.
- Invoke
Url string The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Web
Acl stringArn The ARN of the WebAcl associated with the Stage.
- Arn string
Amazon Resource Name (ARN)
- Execution
Arn string The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- Id string
The provider-assigned unique ID for this managed resource.
- Invoke
Url string The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Web
Acl stringArn The ARN of the WebAcl associated with the Stage.
- arn String
Amazon Resource Name (ARN)
- execution
Arn String The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- id String
The provider-assigned unique ID for this managed resource.
- invoke
Url String The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- Map
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- web
Acl StringArn The ARN of the WebAcl associated with the Stage.
- arn string
Amazon Resource Name (ARN)
- execution
Arn string The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- id string
The provider-assigned unique ID for this managed resource.
- invoke
Url string The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- web
Acl stringArn The ARN of the WebAcl associated with the Stage.
- arn str
Amazon Resource Name (ARN)
- execution_
arn str The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- id str
The provider-assigned unique ID for this managed resource.
- invoke_
url str The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- web_
acl_ strarn The ARN of the WebAcl associated with the Stage.
- arn String
Amazon Resource Name (ARN)
- execution
Arn String The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- id String
The provider-assigned unique ID for this managed resource.
- invoke
Url String The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- Map
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- web
Acl StringArn The ARN of the WebAcl associated with the Stage.
Look up an Existing Stage Resource
Get an existing Stage 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?: StageState, opts?: CustomResourceOptions): Stage
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_log_settings: Optional[StageAccessLogSettingsArgs] = None,
arn: Optional[str] = None,
cache_cluster_enabled: Optional[bool] = None,
cache_cluster_size: Optional[str] = None,
canary_settings: Optional[StageCanarySettingsArgs] = None,
client_certificate_id: Optional[str] = None,
deployment: Optional[str] = None,
description: Optional[str] = None,
documentation_version: Optional[str] = None,
execution_arn: Optional[str] = None,
invoke_url: Optional[str] = None,
rest_api: Optional[str] = None,
stage_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
variables: Optional[Mapping[str, str]] = None,
web_acl_arn: Optional[str] = None,
xray_tracing_enabled: Optional[bool] = None) -> Stage
func GetStage(ctx *Context, name string, id IDInput, state *StageState, opts ...ResourceOption) (*Stage, error)
public static Stage Get(string name, Input<string> id, StageState? state, CustomResourceOptions? opts = null)
public static Stage get(String name, Output<String> id, StageState 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.
- Access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- Arn string
Amazon Resource Name (ARN)
- Cache
Cluster boolEnabled Specifies whether a cache cluster is enabled for the stage
- Cache
Cluster stringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- Canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- Client
Certificate stringId The identifier of a client certificate for the stage.
- Deployment string | string
The ID of the deployment that the stage points to
- Description string
The description of the stage.
- Documentation
Version string The version of the associated API documentation
- Execution
Arn string The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- Invoke
Url string The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- Rest
Api string | string The ID of the associated REST API
- Stage
Name string The name of the stage
- Dictionary<string, string>
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Variables Dictionary<string, string>
A map that defines the stage variables
- Web
Acl stringArn The ARN of the WebAcl associated with the Stage.
- Xray
Tracing boolEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- Access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- Arn string
Amazon Resource Name (ARN)
- Cache
Cluster boolEnabled Specifies whether a cache cluster is enabled for the stage
- Cache
Cluster stringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- Canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- Client
Certificate stringId The identifier of a client certificate for the stage.
- Deployment string | string
The ID of the deployment that the stage points to
- Description string
The description of the stage.
- Documentation
Version string The version of the associated API documentation
- Execution
Arn string The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- Invoke
Url string The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- Rest
Api string | string The ID of the associated REST API
- Stage
Name string The name of the stage
- map[string]string
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Variables map[string]string
A map that defines the stage variables
- Web
Acl stringArn The ARN of the WebAcl associated with the Stage.
- Xray
Tracing boolEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- arn String
Amazon Resource Name (ARN)
- cache
Cluster BooleanEnabled Specifies whether a cache cluster is enabled for the stage
- cache
Cluster StringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- client
Certificate StringId The identifier of a client certificate for the stage.
- deployment String | String
The ID of the deployment that the stage points to
- description String
The description of the stage.
- documentation
Version String The version of the associated API documentation
- execution
Arn String The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- invoke
Url String The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- rest
Api String | String The ID of the associated REST API
- stage
Name String The name of the stage
- Map
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- variables
Map
A map that defines the stage variables
- web
Acl StringArn The ARN of the WebAcl associated with the Stage.
- xray
Tracing BooleanEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- access
Log StageSettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- arn string
Amazon Resource Name (ARN)
- cache
Cluster booleanEnabled Specifies whether a cache cluster is enabled for the stage
- cache
Cluster stringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary
Settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- client
Certificate stringId The identifier of a client certificate for the stage.
- deployment string | Deployment
The ID of the deployment that the stage points to
- description string
The description of the stage.
- documentation
Version string The version of the associated API documentation
- execution
Arn string The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- invoke
Url string The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- rest
Api string | RestApi The ID of the associated REST API
- stage
Name string The name of the stage
- {[key: string]: string}
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- variables {[key: string]: string}
A map that defines the stage variables
- web
Acl stringArn The ARN of the WebAcl associated with the Stage.
- xray
Tracing booleanEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- access_
log_ Stagesettings Access Log Settings Args Enables access logs for the API stage. See Access Log Settings below.
- arn str
Amazon Resource Name (ARN)
- cache_
cluster_ boolenabled Specifies whether a cache cluster is enabled for the stage
- cache_
cluster_ strsize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary_
settings StageCanary Settings Args Configuration settings of a canary deployment. See Canary Settings below.
- client_
certificate_ strid The identifier of a client certificate for the stage.
- deployment str | str
The ID of the deployment that the stage points to
- description str
The description of the stage.
- documentation_
version str The version of the associated API documentation
- execution_
arn str The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- invoke_
url str The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- rest_
api str | str The ID of the associated REST API
- stage_
name str The name of the stage
- Mapping[str, str]
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- variables Mapping[str, str]
A map that defines the stage variables
- web_
acl_ strarn The ARN of the WebAcl associated with the Stage.
- xray_
tracing_ boolenabled Whether active tracing with X-ray is enabled. Defaults to
false
.
- access
Log Property MapSettings Enables access logs for the API stage. See Access Log Settings below.
- arn String
Amazon Resource Name (ARN)
- cache
Cluster BooleanEnabled Specifies whether a cache cluster is enabled for the stage
- cache
Cluster StringSize The size of the cache cluster for the stage, if enabled. Allowed values include
0.5
,1.6
,6.1
,13.5
,28.4
,58.2
,118
and237
.- canary
Settings Property Map Configuration settings of a canary deployment. See Canary Settings below.
- client
Certificate StringId The identifier of a client certificate for the stage.
- deployment String |
The ID of the deployment that the stage points to
- description String
The description of the stage.
- documentation
Version String The version of the associated API documentation
- execution
Arn String The execution ARN to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
- invoke
Url String The URL to invoke the API pointing to the stage, e.g.,
https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
- rest
Api String | The ID of the associated REST API
- stage
Name String The name of the stage
- Map
A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- variables
Map
A map that defines the stage variables
- web
Acl StringArn The ARN of the WebAcl associated with the Stage.
- xray
Tracing BooleanEnabled Whether active tracing with X-ray is enabled. Defaults to
false
.
Supporting Types
StageAccessLogSettings
- Destination
Arn string The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with
amazon-apigateway-
. Automatically removes trailing:*
if present.- Format string
The formatting and values recorded in the logs. For more information on configuring the log format rules visit the AWS documentation
- Destination
Arn string The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with
amazon-apigateway-
. Automatically removes trailing:*
if present.- Format string
The formatting and values recorded in the logs. For more information on configuring the log format rules visit the AWS documentation
- destination
Arn String The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with
amazon-apigateway-
. Automatically removes trailing:*
if present.- format String
The formatting and values recorded in the logs. For more information on configuring the log format rules visit the AWS documentation
- destination
Arn string The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with
amazon-apigateway-
. Automatically removes trailing:*
if present.- format string
The formatting and values recorded in the logs. For more information on configuring the log format rules visit the AWS documentation
- destination_
arn str The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with
amazon-apigateway-
. Automatically removes trailing:*
if present.- format str
The formatting and values recorded in the logs. For more information on configuring the log format rules visit the AWS documentation
- destination
Arn String The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with
amazon-apigateway-
. Automatically removes trailing:*
if present.- format String
The formatting and values recorded in the logs. For more information on configuring the log format rules visit the AWS documentation
StageCanarySettings
- Percent
Traffic double The percent
0.0
-100.0
of traffic to divert to the canary deployment.- Stage
Variable Dictionary<string, object>Overrides A map of overridden stage
variables
(including new variables) for the canary deployment.- Use
Stage boolCache Whether the canary deployment uses the stage cache. Defaults to false.
- Percent
Traffic float64 The percent
0.0
-100.0
of traffic to divert to the canary deployment.- Stage
Variable map[string]interface{}Overrides A map of overridden stage
variables
(including new variables) for the canary deployment.- Use
Stage boolCache Whether the canary deployment uses the stage cache. Defaults to false.
- percent
Traffic Double The percent
0.0
-100.0
of traffic to divert to the canary deployment.- stage
Variable MapOverrides A map of overridden stage
variables
(including new variables) for the canary deployment.- use
Stage BooleanCache Whether the canary deployment uses the stage cache. Defaults to false.
- percent
Traffic number The percent
0.0
-100.0
of traffic to divert to the canary deployment.- stage
Variable {[key: string]: any}Overrides A map of overridden stage
variables
(including new variables) for the canary deployment.- use
Stage booleanCache Whether the canary deployment uses the stage cache. Defaults to false.
- percent_
traffic float The percent
0.0
-100.0
of traffic to divert to the canary deployment.- stage_
variable_ Mapping[str, Any]overrides A map of overridden stage
variables
(including new variables) for the canary deployment.- use_
stage_ boolcache Whether the canary deployment uses the stage cache. Defaults to false.
- percent
Traffic Number The percent
0.0
-100.0
of traffic to divert to the canary deployment.- stage
Variable MapOverrides A map of overridden stage
variables
(including new variables) for the canary deployment.- use
Stage BooleanCache Whether the canary deployment uses the stage cache. Defaults to false.
Import
aws_api_gateway_stage
can be imported using REST-API-ID/STAGE-NAME
, e.g.,
$ pulumi import aws:apigateway/stage:Stage example 12345abcde/example
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.