-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for API Gateway #18
Comments
Note: that cloudformation cannot update #!/bin/bash
REST_API_ID=$(aws cloudformation describe-stack-resource --region $AWS_REGION --stack-name $STACK_NAME --logical-resource-id ApiGatewayRestApi | jq --raw-output .StackResourceDetail.PhysicalResourceId)
echo "Ensure tracing is enabled for api gateway stage: $REST_API_ID / $STAGE"
TRACING_ENABLED=$(aws apigateway get-stage --region $AWS_REGION --rest-api-id $REST_API_ID --stage-name $STAGE | jq --raw-output .tracingEnabled)
if [ "$TRACING_ENABLED" == 'false' ]; then
aws apigateway update-stage --region $AWS_REGION --rest-api-id $REST_API_ID --stage-name $STAGE --patch-operations op=replace,path=/tracingEnabled,value=true
fi
LAMBDA_IDS=$(aws cloudformation describe-stack-resources --region $AWS_REGION --stack-name $STACK_NAME | jq --raw-output -c '.StackResources | map(select( .ResourceType | contains("AWS::Lambda::Function"))) | map(.PhysicalResourceId) | .[]')
while IFS= read -r LAMBDA_ID; do
echo "Ensure tracing is enabled for lambda function: $LAMBDA_ID"
TRACING_MODE=$(aws lambda get-function-configuration --region $AWS_REGION --function-name $LAMBDA_ID | jq --raw-output .TracingConfig.Mode)
if [ "$TRACING_MODE" == 'PassThrough' ]; then
aws lambda update-function-configuration --region $AWS_REGION --function-name $LAMBDA_ID --tracing-config Mode=Active
fi
done <<< "$LAMBDA_IDS"
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AWS supports X-Ray for API Gateways: https://aws.amazon.com/de/blogs/aws/apigateway-xray/
It would be great to configure the stage property via this serverless plugin.
I could not find any hints if cloudformation supports it yet. At least it is not documented.
The text was updated successfully, but these errors were encountered: