<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kay Sawada</title>
    <description>The latest articles on Forem by Kay Sawada (@kaysawada).</description>
    <link>https://forem.com/kaysawada</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2746632%2F4147e324-0337-4908-bdda-16b4fc088421.jpg</url>
      <title>Forem: Kay Sawada</title>
      <link>https://forem.com/kaysawada</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kaysawada"/>
    <language>en</language>
    <item>
      <title>Building an actually secure MCP Server with Fastly Compute</title>
      <dc:creator>Kay Sawada</dc:creator>
      <pubDate>Wed, 28 May 2025 03:56:39 +0000</pubDate>
      <link>https://forem.com/fastly/building-an-actually-secure-mcp-server-with-fastly-compute-33go</link>
      <guid>https://forem.com/fastly/building-an-actually-secure-mcp-server-with-fastly-compute-33go</guid>
      <description>&lt;p&gt;We all know LLMs can do amazing things by now, but deploying them in the real world can mean running into real problems. For example, MCP (Model Context Protocol) is justifiably getting a lot of attention right now for the incredibly creative scenarios it can enable. But the security vulnerabilities MCP can expose should be a genuine nightmare for any organization, not to mention other major concerns like scaling or managing an MCP endpoint over time. But hey, good news: security, scaling, resiliency, and manageability is what we do! So we're going to show you how to use Fastly Compute to make an MCP Server that's ready for the real world — secure, scalable, and reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MCP?
&lt;/h2&gt;

&lt;p&gt;The Model Context Protocol (MCP) is an open protocol designed to standardize how applications provide essential context to Large Language Models (LLMs). MCP acts as a universal interface, enabling AI applications to seamlessly connect with diverse data sources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9x30vmt63t6hwol0vqo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9x30vmt63t6hwol0vqo.jpg" alt="MCP architecture diagram" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MCP also provides the flexibility to switch between LLM providers and prioritizes data security within a user's infrastructure by employing a client-server architecture where applications (MCP Hosts) connect to data sources (Local Data Sources and Remote Services) through lightweight MCP Servers and Clients. This unified approach offers pre-built integrations, allowing developers to quickly leverage various data sources. &lt;/p&gt;

&lt;p&gt;We'll cover how to build an MCP server using Fastly Compute, but if you're interested in accessing Fastly's platform API through MCP, the &lt;a href="https://www.npmjs.com/package/fastly-mcp-server" rel="noopener noreferrer"&gt;fastly-mcp-server package&lt;/a&gt; can help, and we'll be talking more about that in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Fastly’s platform makes MCP run better
&lt;/h2&gt;

&lt;p&gt;As an enterprise serverless architect, I often find myself advising customers on the best approach for their workloads, specifically whether they could benefit from edge computing. There are several factors I consider, such as the expected level of concurrency and potential spikes in the workload, and the need for low latency in user-facing applications. And, as you might have guessed, MCP, which we’ll delve into further in this article, is a really good example of a workload that benefits significantly from the unique design of Fastly’s platform and Fastly Compute. The following is a demonstration of the MCP Client in action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqsqdpf5gshzl31y5pnz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqsqdpf5gshzl31y5pnz.gif" alt="Demo of running mcp server connecting to Fastly REST API endpoints" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll notice that the LLM agent is performing multiple concurrent calls to MCP tools, such as "GetHistoricalStats" and "GetServiceDetail." If you were responsible for running this MCP server, how much load would you estimate and how would you provision the server infrastructure? For a relatively new environment like MCP, having a massive and complex infrastructure isn't ideal. While serverless is convenient for starting small, you naturally need to avoid common issues like cold starts (without much hassle, of course). Given the possibility of spikes, where multiple users might simultaneously call the MCP tools, it's crucial to choose a scalable environment. Additionally, because communication often occurs via chat, it’s critical to keep response latency as low as possible. &lt;/p&gt;

&lt;p&gt;A noteworthy advantage of using Fastly Compute for cases like this is that its &lt;a href="https://bytecodealliance.org/articles/wasmtime-1-0-fast-safe-and-production-ready" rel="noopener noreferrer"&gt;WebAssembly-based runtime leverages isolation sandbox technology&lt;/a&gt;, enabling safer execution of code both locally and remotely. This means your MCP server is safer running on Fastly. As we’ve seen, Fastly Compute’s design addresses many of MCP’s inherent architectural weaknesses. In the following sections, I'll walk you through the specific process of deploying a remote MCP server using this platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to build a remote MCP server with Fastly Compute
&lt;/h2&gt;

&lt;p&gt;We'll start by deploying a Streamable HTTP endpoint that doesn't include legacy SSE endpoints. This can be easily accomplished using the following steps. Please note that you need to replace the API token in two places within the main.go file before publishing. (For information on obtaining your API token, refer to &lt;a href="https://www.fastly.com/documentation/solutions/tutorials/introduction-to-compute/2-getting-started-with-compute/#creating-a-new-api-token-for-compute" rel="noopener noreferrer"&gt;this guide document&lt;/a&gt;.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone https://gist.github.com/d829a6a58ce359b1aa99ecae12ba79f1.git fastly-compute-mcp-server
$ cd fastly-compute-mcp-server
$ vi main.go # Replace __PUT_YOUR_FASTLY_API_TOKEN__ with your own TOKEN
$ fastly compute publish 
...
✓ Activating service (version 1)

Manage this service at:
    https://manage.fastly.com/configure/services/mMnYw4qeGq81xga89Mq8O0

View this service at:
    https://highly-proper-orange.edgecompute.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During the publishing process, you'll be asked several questions. Answer "yes" to any y/n prompts, and for all other items, you can simply press “Enter” key to accept the default (empty) values. After a short while, you'll see a message indicating that your service is now available, as shown above. &lt;/p&gt;

&lt;p&gt;Next, let's use the &lt;code&gt;npx&lt;/code&gt; command to launch the MCP inspector verification tool and check if our deployed server is functioning correctly. Once the &lt;code&gt;npx @modelcontextprotocol/inspector&lt;/code&gt; command completes successfully, access &lt;code&gt;http://127.0.0.1:6274&lt;/code&gt; to open the official tester interface. From the left sidebar, select "streamable http" as the connection type and enter the service address (&lt;code&gt;https://*.edgecompute.app&lt;/code&gt;) shown as a result from the publish command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqy70hde2ypfaksqcfby.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyqy70hde2ypfaksqcfby.gif" alt="Demo screen recording of how mcp inspector works" width="1280" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you see "Connected" below the Connect button in the left sidebar, it means the connection was successful. In the control pane on the right, click on the Tools tab and try actions like List Tools to test the functionality. This means you've successfully operated a remote MCP server that communicates using non-SSE Streamable-HTTP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding support for legacy clients with SSE
&lt;/h2&gt;

&lt;p&gt;As of this writing in May 2025, many MCP clients still do not support Streamable HTTP, and some remote servers only offer SSE transport. To ensure backward compatibility with these clients, we’ll take the MCP server we’ve created a step further by adding SSE support. (Note that in this sample, we will use &lt;a href="https://www.fastly.com/documentation/guides/concepts/real-time-messaging/fanout/" rel="noopener noreferrer"&gt;Fanout&lt;/a&gt; for establishing SSE connections. This is a Fastly push messaging service that requires its own signup.)&lt;/p&gt;

&lt;p&gt;First, create a new service following the same steps as before. However, this time when publishing, create two backends at the following stage of the screen. For the first backend, specify the address of &lt;code&gt;*.edgecompute.app&lt;/code&gt; in the Domain field and name it "self". For the second backend, register &lt;code&gt;api.fastly.com&lt;/code&gt; with the name "fastly" as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✓ Creating service

Domain: [put-your-favorite-name-here.edgecompute.app] 

Backend (hostname or IP address, or leave blank to stop adding backends): put-your-favorite-name-here.edgecompute.app
Backend port number: [443] 
Backend name: [backend_1] self

Backend (hostname or IP address, or leave blank to stop adding backends): api.fastly.com
Backend port number: [443] 
Backend name: [backend_2] fastly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you've published successfully, execute the command shown below as an additional step to enable Fanout. When you see the SUCCESS notification, your setup is ready to use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ fastly products --enable=fanout
SUCCESS: Successfully enabled product 'fanout'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, configure your MCP client (like &lt;a href="https://claude.ai/download" rel="noopener noreferrer"&gt;Claude Desktop&lt;/a&gt; or &lt;a href="https://www.cursor.com/" rel="noopener noreferrer"&gt;Cursor&lt;/a&gt;) to check functionality. For clients that natively support SSE, there's little difficulty—just follow the app's configuration instructions. In this case, we’ll set up LibreChat, an MCP client that only supports STDIO, as an example. (The following is an example of YAML configuration for LibreChat, but the method of executing the npx command is consistent for any client. Don't forget to use your edgecompute.app service URL when you configure "mcp-remote" command).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mcpServers:
  fastly-mcp-server:
    command: npx
    args:
      - -y
      - "mcp-remote"
      - https://highly-adequate-adder.edgecompute.app/sse
      - --transport
      - sse-only
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As of May 2025, the mcp-remote package defaults to Streamable-HTTP connections unless you use the &lt;code&gt;--transport sse-only&lt;/code&gt; option. To ensure a connection via SSE, you need to include this option.&lt;/p&gt;

&lt;p&gt;When you launch LibreChat with this configuration, you'll see a screen like the one below. This completes the setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmfqof38lra3kprepr77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxmfqof38lra3kprepr77.png" alt="The screenshot of the LibreChat UI showing fastly-mcp-server as an available remote MCP server" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This sample shows an MCP tool that downloads the VCL from a Fastly VCL Service, but you can easily extend it with additional features. It’s important to note that &lt;a href="https://www.fastly.com/documentation/guides/concepts/real-time-messaging/fanout/#limits" rel="noopener noreferrer"&gt;Fanout's specification limits message size to about 64KB&lt;/a&gt;. So, when supporting legacy SSE, make sure the result messages from MCP tool calls don't become too large.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: What’s next?
&lt;/h2&gt;

&lt;p&gt;In this article, we've introduced how the flexible and efficient development environment of Fastly Compute simplifies the process of setting up a high-performance MCP server quickly. As a next step, I plan to explore building a more advanced server based on the OAuth specification. Stay tuned!&lt;/p&gt;

&lt;p&gt;We would also love to hear how your organization is leveraging LLMs and AI, and how you are addressing the associated challenges. Please share your thoughts and join the &lt;a href="https://community.fastly.com/?_gl=1*n401xr*_gcl_au*ODgwMjI2NDMuMTc0NTQ3NjU3Mw.." rel="noopener noreferrer"&gt;community&lt;/a&gt; discussions. We welcome all kinds of feedback.&lt;/p&gt;

</description>
      <category>webassembly</category>
      <category>mcp</category>
      <category>ai</category>
      <category>llm</category>
    </item>
    <item>
      <title>Go Beyond the Basics: Connecting Compute to Object Storage with the Official S3 Clients</title>
      <dc:creator>Kay Sawada</dc:creator>
      <pubDate>Fri, 24 Jan 2025 21:42:24 +0000</pubDate>
      <link>https://forem.com/fastly/go-beyond-the-basics-connecting-compute-to-object-storage-with-the-official-s3-clients-4l9p</link>
      <guid>https://forem.com/fastly/go-beyond-the-basics-connecting-compute-to-object-storage-with-the-official-s3-clients-4l9p</guid>
      <description>&lt;p&gt;Fastly Compute has consistently supported developers through its SDK with strong APIs for persistence needs, such as Config, Secret, and KV Store. Recently, we introduced Fastly Object Storage, an S3-compatible storage solution, which further streamlines the process of building systems on Fastly's Edge Network. With these advancements, the question arises: how best to connect Compute to Fastly Object Storage, particularly in terms of the most efficient connection methods? Fastly Object Storage is designed for S3-compatible API access, making it possible to connect from Compute via REST api call. But what's the most efficient way to do this?&lt;/p&gt;

&lt;p&gt;In this article, I will guide you through using the official AWS SDKs to provide straightforward and intuitive access to Fastly Object Storage's API-compatible storage from Compute.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the official AWS SDK with Fastly Compute
&lt;/h2&gt;

&lt;p&gt;Let's dive into some concrete code examples. In this first example, we're using the Compute Go SDK, which launched &lt;a href="https://www.fastly.com/blog/announcing-standard-go-support-for-fastly-compute" rel="noopener noreferrer"&gt;its official support in the summer of last year&lt;/a&gt;, along with AWS's official SDK(&lt;a href="https://github.com/aws/aws-sdk-go-v2" rel="noopener noreferrer"&gt;aws/aws-sdk-go-v2&lt;/a&gt;) to connect with Fastly Object Storage. What makes this approach particularly effective is its use of AWS's widely-adopted standard SDK, which enables intuitive handling of S3 objects. Developers familiar with this library can quickly access it with only a few lines of code, and even those new to the SDK will find it more efficient compared to directly handling the REST API. This efficiency is due to the well-developed documentation and the type hint and suggestions offered by the SDK. Additionally, &lt;a href="https://github.com/aws/aws-sdk-go-v2" rel="noopener noreferrer"&gt;aws/aws-sdk-go-v2&lt;/a&gt; is particularly convenient because it supports interfaces for other AWS services beyond S3, such as RDS and Bedrock, which means this code can be adapted for use with other AWS services, too.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="s"&gt;"context"&lt;/span&gt;
   &lt;span class="s"&gt;"fmt"&lt;/span&gt;
   &lt;span class="s"&gt;"net/http"&lt;/span&gt;
   &lt;span class="s"&gt;"github.com/aws/aws-sdk-go-v2/aws"&lt;/span&gt;
   &lt;span class="s"&gt;"github.com/aws/aws-sdk-go-v2/credentials"&lt;/span&gt;
   &lt;span class="s"&gt;"github.com/aws/aws-sdk-go-v2/service/s3"&lt;/span&gt;
   &lt;span class="s"&gt;"github.com/fastly/compute-sdk-go/fsthttp"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="n"&gt;BUCKET_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"YOUR_BUCKET_NAME"&lt;/span&gt;
   &lt;span class="n"&gt;ACCESS_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"YOUR_ACCESS_KEY"&lt;/span&gt;
   &lt;span class="n"&gt;SECRET_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"YOUR_SECRET_KEY"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="n"&gt;fsthttp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ServeFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;fsthttp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;fsthttp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="c"&gt;// connect to s3&lt;/span&gt;
     &lt;span class="n"&gt;customClient&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="n"&gt;Transport&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fsthttp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewTransport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"origin_0"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Options&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="n"&gt;Region&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;       &lt;span class="s"&gt;"us-east"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="n"&gt;BaseEndpoint&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://us-east.object.fastlystorage.app"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
       &lt;span class="n"&gt;Credentials&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewCredentialsCache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewStaticCredentialsProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ACCESS_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SECRET_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
       &lt;span class="n"&gt;UsePathStyle&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="n"&gt;HTTPClient&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="n"&gt;customClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="p"&gt;})&lt;/span&gt;
     &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewListObjectsV2Paginator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListObjectsV2Input&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Bucket&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BUCKET_NAME&lt;/span&gt;&lt;span class="p"&gt;)})&lt;/span&gt;

     &lt;span class="c"&gt;// generate response html&lt;/span&gt;
     &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Header&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"text/html; charset=utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;ul&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HasMorePages&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NextPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TODO&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
       &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Contents&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;li&amp;gt;Object:%s&amp;lt;/li&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;/ul&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Secret Sauce
&lt;/h2&gt;

&lt;p&gt;There's one crucial implementation detail worth highlighting in our example: we're injecting a custom client as the http.Client used by the AWS SDK, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;       &lt;span class="n"&gt;customClient&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="n"&gt;Transport&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fsthttp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewTransport&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"origin_0"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
       &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Options&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="o"&gt;...&lt;/span&gt;
           &lt;span class="n"&gt;HTTPClient&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="n"&gt;customClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When using external libraries within Fastly Compute, securing access to external system resources, such as file I/O or network operations, sometimes presents a challenge. For this scenario, the critical aspect is determining how to enable network communication. Thanks to Go's excellent abstraction in the &lt;a href="https://pkg.go.dev/net/http" rel="noopener noreferrer"&gt;net/http standard library&lt;/a&gt;, particularly the RoundTripper interface, it's relatively straightforward to ensure compatibility with external network resources. In fact, many libraries in Go are designed to allow the injection of a custom http.Client, which is advantageous in WebAssembly (WASI) environments, offering significant potential to leverage existing code assets. This adaptability is a notable strength of Go's Wasm target.&lt;/p&gt;

&lt;p&gt;Note: To run the code demonstrated here, you'll need to configure a backend named “origin_0” with an endpoint URL in the format &lt;code&gt;https://us-east.object.fastlystorage.app/&lt;/code&gt; (No host override configuration is required).&lt;/p&gt;

&lt;h2&gt;
  
  
  What about JavaScript and Rust?
&lt;/h2&gt;

&lt;p&gt;Of course we can connect with them, too! For JavaScript, in fact it’s much easier than the Go code above. All you need is to install &lt;a href="https://github.com/aws/aws-sdk-js-v3" rel="noopener noreferrer"&gt;the official AWS JS SDK&lt;/a&gt; by &lt;code&gt;npm install @aws-sdk/client-s3&lt;/code&gt; and add the following import statement at the top of the script;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;paginateListBuckets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;S3Client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;S3ServiceException&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@aws-sdk/client-s3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Followed by some s3 operation like below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;S3Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
     &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;us-east&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://us-east.object.fastlystorage.app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="na"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="na"&gt;accessKeyId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_ACCESS_KEY&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;secretAccessKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_SECRET_KEY&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="p"&gt;},&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buckets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
   &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nf"&gt;paginateListBuckets&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{}))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;buckets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Buckets&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buckets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lastly, in case of Rust, just like we did with Go SDK, we need a custom http client to inject to &lt;a href="https://github.com/awslabs/aws-sdk-rust" rel="noopener noreferrer"&gt;the AWS SDK for Rust&lt;/a&gt; to make its network layer functional with wasm32-wasi compilation target. A critical consideration for this work (the most challenging aspect) would be that the AWS SDK for Rust has &lt;a href="https://docs.aws.amazon.com/sdk-for-rust/latest/dg/fundamentals.html" rel="noopener noreferrer"&gt;a dependency on Tokio&lt;/a&gt;, which requires developers not only to implement asynchronous coding patterns but also to handle dependencies carefully.&lt;/p&gt;

&lt;p&gt;For easier adoption of this SDK, I’d recommend you to visit this awesome repository(&lt;a href="http://github.com/tidal-music/aws-fastly-http-client" rel="noopener noreferrer"&gt;github.com/tidal-music/aws-fastly-http-client&lt;/a&gt;) created by Tidal Music, which enables you to have the AWS Rust SDK connect with backend servers through custom http client instantiated from FastlyHttpClient with ease. Simply git clone the project, and add your code and dependencies needed for your project - the final code should look something like below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="nd"&gt;#[tokio::main(flavor&lt;/span&gt; &lt;span class="nd"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"current_thread"&lt;/span&gt;&lt;span class="nd"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;custom_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;lib&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;FastlyHttpClient&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"origin_0"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;aws_sdk_s3&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;Config&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
     &lt;span class="nf"&gt;.region&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;Region&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"us-east"&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
     &lt;span class="nf"&gt;.endpoint_url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://us-east.object.fastlystorage.app/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="nf"&gt;.stalled_stream_protection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;StalledStreamProtectionConfig&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;disabled&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
     &lt;span class="nf"&gt;.identity_cache&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;IdentityCache&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;no_cache&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
     &lt;span class="nf"&gt;.credentials_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nn"&gt;aws_sdk_s3&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;config&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;Credentials&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;access_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secret_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
     &lt;span class="nf"&gt;.http_client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;custom_client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="nf"&gt;.behavior_version&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;BehaviorVersion&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;v2024_03_28&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
     &lt;span class="nf"&gt;.force_path_style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="nf"&gt;.build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

   &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;aws_sdk_s3&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_conf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;
     &lt;span class="nf"&gt;.list_buckets&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
     &lt;span class="nf"&gt;.send&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
     &lt;span class="k"&gt;.await&lt;/span&gt;
     &lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"unable to list buckets"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;bucket&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="nf"&gt;.buckets&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;bucket_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bucket&lt;/span&gt;&lt;span class="nf"&gt;.name&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"no bucket name"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"bucket_name:{}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bucket_name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nn"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;StatusCode&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;OK&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.send_to_client&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Side note; There's a caveat with this Rust solution - you need to use fastly crate version 0.9.x alongside Rust compiler version 1.79.0. If you upgrade the Fastly crate version, you'll encounter compilation errors (e.g. type mismatch etc), as of writing this.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;The approach we've demonstrated using these AWS SDKs is just one way to connect Fastly Compute to Fastly Object Storage. The flexibility of S3 client options, combined with the injection pattern of custom http clients, opens up a world of possibilities for leveraging existing code assets and achieving intuitive development at the edge.&lt;/p&gt;

&lt;p&gt;I encourage you to take advantage of these SDKs and libraries to enable smooth integration with Fastly Object Storage and other services, and set the stage for your next wave of innovation. Also, don’t forget to visit &lt;a href="https://community.fastly.com/c/object-storage/23" rel="noopener noreferrer"&gt;the forum&lt;/a&gt; and stay informed about the latest advancements of Fastly Object Storage. We welcome your contributions and look forward to seeing the innovative solutions you develop!&lt;/p&gt;

</description>
      <category>fastly</category>
      <category>serverless</category>
      <category>webassembly</category>
      <category>s3</category>
    </item>
  </channel>
</rss>
