former2 icon indicating copy to clipboard operation
former2 copied to clipboard

terraform output missing resources

Open rorourke-iot opened this issue 1 year ago • 0 comments

While going through clean-up related matching absolute ids with references to resources, I discovered the output for terraform did not include a couple resources. The output had

resource "aws_api_gateway_usage_plan_key" "ApiGatewayUsagePlanKey" {
    key_id = "7gjdytmbq9"
    key_type = "API_KEY"
    usage_plan_id = "oSIW8USqUwbSMO7VsZEz2Lea3nnPit37fc0ovzi5"
}

but did not have generated output for resources aws_api_gateway_usage_plan and aws_api_gateway_api_key.

Expected output should look something like

resource "aws_api_gateway_usage_plan" "ApiGetwayUsagePlan" {
    name = "my-usage-plan-XXX"

    api_stages {
        api_id = aws_api_gateway_rest_api.ApiGatewayRestApi.id
        stage  = aws_api_gateway_stage.ApiGatewayStage.stage_name
    }
}

resource "aws_api_gateway_api_key" "ApiGetwayApiKey" {
    name = "my-api-key-YYY"
}

resource "aws_api_gateway_usage_plan_key" "ApiGatewayUsagePlanKey" {
    key_id = aws_api_gateway_api_key.ApiGetwayApiKey.id
    key_type = "API_KEY"
    usage_plan_id = aws_api_gateway_usage_plan.ApiGetwayUsagePlan.id
}

rorourke-iot avatar May 17 '23 14:05 rorourke-iot