# aws


09/30/2022, 8:31 AM
Hi, I was looking into how to configure the LogGroup used under-the-hood by API Gateway, and I fell over this in the documentation: Is there some magic happening here with the dependsOn? From my understanding it isn't possible to configure the LogGroup API Gateway uses, and it goes by the convention:
, so I'm not sure what the dependsOn is supposed to achieve except creating a LogGroup prior to the stage? 🤔


09/30/2022, 4:13 PM
i don't think the dependsOn is necessary. i just checked my usage and I'm not using it. here's some boilerplate you might find helpful:
Copy code
const ApiGwStageAccessLogFmt = "$context.identity.sourceIp - - [$context.requestTime] \"$context.httpMethod $context.routeKey $context.protocol\" sts:$context.status len:$context.responseLength reqId:$context.requestId lambdasts:$context.integrationStatus integErr:$context.integrationErrorMessage errMsg:$context.error.message"

       accessLogGroup, err := cw.NewLogGroup(ctx, "myproject-apigw-acccess-logs",
        if err != nil {
                return err

        accessLogArgs := &gateway2.StageAccessLogSettingsArgs{
                DestinationArn: accessLogGroup.Arn,
                Format:         pulumi.String(ApiGwStageAccessLogFmt),

        stageArgs := &gateway2.StageArgs{
                AccessLogSettings: accessLogArgs,
                ApiId:             apiGw.ID(),
                AutoDeploy:        pulumi.Bool(true),
                Description:       pulumi.Sprintf("prod stage for MyProject"),
                Name:              pulumi.String("prod"),

        stage, err := gateway2.NewStage(ctx, "myproject-apigw-stage", stageArgs)
        if err != nil {
                return err