@@ -66,18 +66,10 @@ $ awslocal lambda create-function \
66
66
--handler index.handler \
67
67
--role arn:aws:iam::000000000000: role /lambda-role \
68
68
--tags '{"_ custom_id_ ":"my-custom-subdomain"}'
69
- $ awslocal lambda create-function-url-config \
70
- --function-name localstack-lambda-url-example \
71
- --auth-type NONE
72
- {
73
- "FunctionUrl": "http://my-custom-subdomain.lambda-url .<region >...",
74
- ....
75
- }
76
69
{{< / command >}}
77
- You must specify the ` _custom_id_ ` tag ** before** using the ` create-function-url-config ` command .
70
+ You must specify the ` _custom_id_ ` tag ** before** < a href = " # create-a- function-url" >creating a Function URL</ a > .
78
71
After the URL configuration is set up, any modifications to the tag will not affect it.
79
- At present, custom IDs can be assigned only to the ` $LATEST ` version of the function.
80
- LocalStack does not yet support custom IDs for function version aliases.
72
+ LocalStack supports assigning custom IDs to both the ` $LATEST ` version of the function or to an existing version alias.
81
73
{{< /callout >}}
82
74
83
75
{{< callout >}}
@@ -124,6 +116,33 @@ $ awslocal lambda create-function-url-config \
124
116
This will generate a HTTP URL that can be used to invoke the Lambda function.
125
117
The URL will be in the format ` http://<XXXXXXXX>.lambda-url.us-east-1.localhost.localstack.cloud:4566 ` .
126
118
119
+ {{< callout "note">}}
120
+ As previously mentioned, when a Lambda Function has a ` _custom_id_ ` tag, LocalStack sets this tag's value as the subdomain in the Function's URL.
121
+
122
+ {{< command >}}
123
+ $ awslocal lambda create-function-url-config \
124
+ --function-name localstack-lambda-url-example \
125
+ --auth-type NONE
126
+ {
127
+ "FunctionUrl": "http://my-custom-subdomain.lambda-url .<region >...",
128
+ ....
129
+ }
130
+ {{< / command >}}
131
+
132
+ In addition, if you pass an an existing version alias as a ` Qualifier ` to the request, the created URL will combine the custom ID and the alias in the form ` <custom-id>-<alias> ` .
133
+
134
+ {{< command >}}
135
+ $ awslocal lambda create-function-url-config \
136
+ --function-name localstack-lambda-url-example \
137
+ --auth-type NONE
138
+ --qualifier test-alias
139
+ {
140
+ "FunctionUrl": "http://my-custom-subdomain-test-alias.lambda-url .<region >...",
141
+ ....
142
+ }
143
+ {{< / command >}}
144
+ {{< /callout >}}
145
+
127
146
### Trigger the Lambda function URL
128
147
129
148
You can now trigger the Lambda function by sending a HTTP POST request to the URL using [ curl] ( https://curl.se/ ) or your REST HTTP client:
0 commit comments