Skip to content
v2.278.0

StageAttributes Struct ​

The attributes of an imported Stage.

Example ​

ts
declare const restApi: apigateway.IRestApi;
const importedStage = apigateway.Stage.fromStageAttributes(this, 'imported-stage', {
  stageName: 'myStageName',
  restApi,
});

importedStage.addApiKey('MyApiKey');
python
# rest_api: apigateway.IRestApi

imported_stage = apigateway.Stage.from_stage_attributes(self, "imported-stage",
    stage_name="myStageName",
    rest_api=rest_api
)

imported_stage.add_api_key("MyApiKey")
java
IRestApi restApi;

IStage importedStage = Stage.fromStageAttributes(this, "imported-stage", StageAttributes.builder()
        .stageName("myStageName")
        .restApi(restApi)
        .build());

importedStage.addApiKey("MyApiKey");
csharp
// Install: dotnet add package Amazon.CDK.Lib
IRestApi restApi;

var importedStage = Stage.FromStageAttributes(this, "imported-stage", new StageAttributes {
    StageName = "myStageName",
    RestApi = restApi
});

importedStage.AddApiKey("MyApiKey");
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var restApi IRestApi

importedStage := apigateway.Stage_FromStageAttributes(this, jsii.String("imported-stage"), &StageAttributes{
	StageName: jsii.String("myStageName"),
	RestApi: RestApi,
})

importedStage.AddApiKey(jsii.String("MyApiKey"))

Properties ​

restApiIRestApirest_apiIRestApirestApiIRestApiRestApiIRestApiRestApiIRestApi required #
The RestApi that the stage belongs to.
stageNamestringstage_namestrstageNameStringStageNamestringStageName*string required #
The name of the stage.