diff --git a/lib/aws/idl/apigateway/stage.go b/lib/aws/idl/apigateway/stage.go index 6a3b354e7..68461d776 100644 --- a/lib/aws/idl/apigateway/stage.go +++ b/lib/aws/idl/apigateway/stage.go @@ -48,4 +48,8 @@ type Stage struct { CreatedDate string `lumi:"createdDate,out"` // The timestamp when the stage last updated. LastUpdatedDate string `lumi:"lastUpdatedDate,out"` + // The URL to invoke the HTTP endpoint for this API stage. + URL string `lumi:"url,out"` + // The execution ARN needed to pass to Lambda to give this API stage permission. + ExecutionARN string `lumi:"executionARN,out"` } diff --git a/lib/aws/pack/apigateway/stage.ts b/lib/aws/pack/apigateway/stage.ts index 3169b0e05..f3652b89c 100644 --- a/lib/aws/pack/apigateway/stage.ts +++ b/lib/aws/pack/apigateway/stage.ts @@ -21,6 +21,8 @@ export class Stage extends lumi.Resource implements StageArgs { public variables?: {[key: string]: string}; public createdDate: string; public lastUpdatedDate: string; + public url: string; + public executionARN: string; constructor(name: string, args: StageArgs) { super(); diff --git a/lib/aws/provider/apigateway/stage.go b/lib/aws/provider/apigateway/stage.go index 10dfa72b0..dcc725a55 100644 --- a/lib/aws/provider/apigateway/stage.go +++ b/lib/aws/provider/apigateway/stage.go @@ -106,6 +106,9 @@ func (p *stageProvider) Get(ctx context.Context, id resource.ID) (*apigateway.St } variables := aws.StringValueMap(resp.Variables) + url := "https://" + restAPIID + ".execute-api." + p.ctx.Region() + ".amazonaws.com/" + stageName + executionARN := "arn:aws:execute-api:" + p.ctx.Region() + ":" + p.ctx.AccountID() + ":" + restAPIID + "/" + stageName + return &apigateway.Stage{ RestAPI: NewRestAPIID(p.ctx.Region(), restAPIID), Deployment: NewDeploymentID(p.ctx.Region(), restAPIID, aws.StringValue(resp.DeploymentId)), @@ -116,6 +119,8 @@ func (p *stageProvider) Get(ctx context.Context, id resource.ID) (*apigateway.St Description: resp.Description, CreatedDate: resp.CreatedDate.String(), LastUpdatedDate: resp.LastUpdatedDate.String(), + URL: url, + ExecutionARN: executionARN, }, nil } diff --git a/lib/aws/rpc/apigateway/stage.go b/lib/aws/rpc/apigateway/stage.go index 7a42e08a3..949576c43 100644 --- a/lib/aws/rpc/apigateway/stage.go +++ b/lib/aws/rpc/apigateway/stage.go @@ -190,6 +190,8 @@ type Stage struct { Variables *map[string]string `lumi:"variables,optional"` CreatedDate string `lumi:"createdDate,optional"` LastUpdatedDate string `lumi:"lastUpdatedDate,optional"` + URL string `lumi:"url,optional"` + ExecutionARN string `lumi:"executionARN,optional"` } // Stage's properties have constants to make dealing with diffs and property bags easier. @@ -206,6 +208,8 @@ const ( Stage_Variables = "variables" Stage_CreatedDate = "createdDate" Stage_LastUpdatedDate = "lastUpdatedDate" + Stage_URL = "url" + Stage_ExecutionARN = "executionARN" )