melodic-farmer-82535
09/15/2025, 4:43 PMflaky-plumber-70709
09/15/2025, 5:25 PMflaky-plumber-70709
09/15/2025, 5:27 PMflaky-plumber-70709
09/15/2025, 5:30 PMflaky-plumber-70709
09/15/2025, 5:34 PMmelodic-farmer-82535
09/15/2025, 7:59 PMmelodic-farmer-82535
09/15/2025, 8:00 PMmelodic-farmer-82535
09/15/2025, 8:01 PMflaky-plumber-70709
09/15/2025, 8:14 PMflaky-plumber-70709
09/15/2025, 8:16 PMflaky-plumber-70709
09/15/2025, 8:17 PMflaky-plumber-70709
09/15/2025, 8:18 PMflaky-plumber-70709
09/15/2025, 8:20 PMflaky-plumber-70709
09/15/2025, 8:25 PMexecute-api:Invoke , but that is not idealflaky-plumber-70709
09/15/2025, 8:26 PMmelodic-farmer-82535
09/15/2025, 8:30 PMflaky-plumber-70709
09/15/2025, 8:32 PMflaky-plumber-70709
09/15/2025, 8:32 PMflaky-plumber-70709
09/15/2025, 8:33 PMmelodic-farmer-82535
09/15/2025, 8:47 PMflaky-plumber-70709
09/15/2025, 9:11 PMflaky-plumber-70709
09/15/2025, 9:12 PMflaky-plumber-70709
09/15/2025, 9:12 PMflaky-plumber-70709
09/15/2025, 9:12 PMmelodic-farmer-82535
09/15/2025, 9:17 PMmelodic-farmer-82535
09/15/2025, 9:18 PMflaky-plumber-70709
09/15/2025, 9:22 PMflaky-plumber-70709
09/15/2025, 9:25 PMmelodic-farmer-82535
09/15/2025, 9:29 PMmelodic-farmer-82535
09/15/2025, 10:09 PMflaky-plumber-70709
09/15/2025, 10:11 PMflaky-plumber-70709
09/15/2025, 10:12 PMmelodic-farmer-82535
09/15/2025, 10:13 PMmelodic-farmer-82535
09/15/2025, 10:13 PMflaky-plumber-70709
09/15/2025, 10:13 PMmelodic-farmer-82535
09/15/2025, 10:15 PMflaky-plumber-70709
09/15/2025, 10:16 PMflaky-plumber-70709
09/15/2025, 10:17 PMmelodic-farmer-82535
09/15/2025, 10:17 PMmelodic-farmer-82535
09/15/2025, 10:25 PMflaky-plumber-70709
09/15/2025, 10:35 PMflaky-plumber-70709
09/15/2025, 10:36 PMflaky-plumber-70709
09/15/2025, 10:36 PMflaky-plumber-70709
09/15/2025, 10:40 PMflaky-plumber-70709
09/15/2025, 10:47 PMfrom aws_cdk import aws_apigateway as apigw
from aws_cdk import aws_iam as iam
api = apigw.RestApi(self, "MetaflowApi",
rest_api_name="metaflow-service"
)
# method with IAM auth
resource = api.root.add_resource("myresource")
resource.add_method("GET",
authorization_type=apigw.AuthorizationType.IAM
# api_key_required is ignored when using IAM
)
# grant invoke permissions to a role
role = iam.Role(self, "ApiInvokerRole", ...)
api.grant_invoke(role)flaky-plumber-70709
09/15/2025, 10:48 PMflaky-plumber-70709
09/15/2025, 10:49 PMmelodic-farmer-82535
09/15/2025, 10:54 PMflaky-plumber-70709
09/15/2025, 11:31 PM1. added `APIAuthorizationType` parameter can be NONE or AWS_IAM. When AWS_IAM you need sigv4 signing (issue you've been seeing for days)
2. updated apigw methods from AWS_IAM to ref of the parameter, before it was hardcoded so even if you added api key it would do nothing
3. output clarified on metaflow URL, `METAFLOW_SERVICE_URL` you can skip auth for api gateway and hit the nlb direct likeflaky-plumber-70709
09/15/2025, 11:32 PMmelodic-farmer-82535
09/16/2025, 6:59 AMmelodic-farmer-82535
09/16/2025, 5:52 PMmelodic-farmer-82535
09/16/2025, 5:52 PMflaky-plumber-70709
09/16/2025, 5:54 PMMETAFLOW_SERVICE_URL setflaky-plumber-70709
09/16/2025, 6:02 PMmelodic-farmer-82535
09/16/2025, 6:06 PMflaky-plumber-70709
09/16/2025, 6:12 PMflaky-plumber-70709
09/16/2025, 7:50 PMMETAFLOW_SERVICE_URL to its dns is if you ( the client) is if the request was within the network, so like from a sagemaker notebook. So its kind of a hack and doesn't work for your usecase unless you are using metaflow from within the vpc.
The root of this problem is that IAM setting, its expecting your requests to be signed with aws sigv4, which I don't think the metaflow client is setup for, so I am pretty sure that this will not work period w that unless the client is updated (not 100% here, firing from the hip on this one).
Is this apigw IAM auth thing an absolute requirement here? it can just forward traffic to the nlb, IAM over the basic auth doesn't really harden things and there isn't anything a malicious actor could do other than interact with the metadata apimelodic-farmer-82535
09/17/2025, 8:00 AMload balancer will on enterprise , it should be routable and have alias dns name to reach from our network and cross account VPC subnets routable