Class Stage
Provides an API Gateway Stage.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var testRestApi = new Aws.ApiGateway.RestApi("testRestApi", new Aws.ApiGateway.RestApiArgs
{
Description = "This is my API for demonstration purposes",
});
var testDeployment = new Aws.ApiGateway.Deployment("testDeployment", new Aws.ApiGateway.DeploymentArgs
{
RestApi = testRestApi.Id,
StageName = "dev",
});
var testStage = new Aws.ApiGateway.Stage("testStage", new Aws.ApiGateway.StageArgs
{
Deployment = testDeployment.Id,
RestApi = testRestApi.Id,
StageName = "prod",
});
var testResource = new Aws.ApiGateway.Resource("testResource", new Aws.ApiGateway.ResourceArgs
{
ParentId = testRestApi.RootResourceId,
PathPart = "mytestresource",
RestApi = testRestApi.Id,
});
var testMethod = new Aws.ApiGateway.Method("testMethod", new Aws.ApiGateway.MethodArgs
{
Authorization = "NONE",
HttpMethod = "GET",
ResourceId = testResource.Id,
RestApi = testRestApi.Id,
});
var methodSettings = new Aws.ApiGateway.MethodSettings("methodSettings", new Aws.ApiGateway.MethodSettingsArgs
{
MethodPath = Output.Tuple(testResource.PathPart, testMethod.HttpMethod).Apply(values =>
{
var pathPart = values.Item1;
var httpMethod = values.Item2;
return $"{pathPart}/{httpMethod}";
}),
RestApi = testRestApi.Id,
Settings = new Aws.ApiGateway.Inputs.MethodSettingsSettingsArgs
{
LoggingLevel = "INFO",
MetricsEnabled = true,
},
StageName = testStage.StageName,
});
var testIntegration = new Aws.ApiGateway.Integration("testIntegration", new Aws.ApiGateway.IntegrationArgs
{
HttpMethod = testMethod.HttpMethod,
ResourceId = testResource.Id,
RestApi = testRestApi.Id,
Type = "MOCK",
});
}
}
Inherited Members
Namespace: Pulumi.Aws.ApiGateway
Assembly: Pulumi.Aws.dll
Syntax
public class Stage : CustomResource
Constructors
View SourceStage(String, StageArgs, CustomResourceOptions)
Create a Stage resource with the given unique name, arguments, and options.
Declaration
public Stage(string name, StageArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| StageArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAccessLogSettings
Enables access logs for the API stage. Detailed below.
Declaration
public Output<StageAccessLogSettings> AccessLogSettings { get; }
Property Value
| Type | Description |
|---|---|
| Output<StageAccessLogSettings> |
Arn
Amazon Resource Name (ARN)
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CacheClusterEnabled
Specifies whether a cache cluster is enabled for the stage
Declaration
public Output<bool?> CacheClusterEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
CacheClusterSize
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 and 237.
Declaration
public Output<string> CacheClusterSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ClientCertificateId
The identifier of a client certificate for the stage.
Declaration
public Output<string> ClientCertificateId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Deployment
The ID of the deployment that the stage points to
Declaration
public Output<string> Deployment { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
The description of the stage
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DocumentationVersion
The version of the associated API documentation
Declaration
public Output<string> DocumentationVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ExecutionArn
The execution ARN to be used in lambda_permission's source_arn
when allowing API Gateway to invoke a Lambda function,
e.g. arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
Declaration
public Output<string> ExecutionArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InvokeUrl
The URL to invoke the API pointing to the stage,
e.g. https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
Declaration
public Output<string> InvokeUrl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RestApi
The ID of the associated REST API
Declaration
public Output<string> RestApi { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
StageName
The name of the stage
Declaration
public Output<string> StageName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
A map of tags to assign to the resource.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Variables
A map that defines the stage variables
Declaration
public Output<ImmutableDictionary<string, object>> Variables { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
XrayTracingEnabled
Whether active tracing with X-ray is enabled. Defaults to false.
Declaration
public Output<bool?> XrayTracingEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Methods
View SourceGet(String, Input<String>, StageState, CustomResourceOptions)
Get an existing Stage resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Stage Get(string name, Input<string> id, StageState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| StageState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Stage |