IronPDF はじめに AWSへのデプロイ How to Run & Deploy IronPDF .NET on AWS Lambda Curtis Chau 更新日:6月 10, 2025 Download IronPDF NuGet Download テキストの検索と置換 テキストと画像のスタンプ Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article This article was translated from English: Does it need improvement? Translated View the article in English class="container-fluid"> class="row"> class="col-md-2"> 1. コンテナテンプレートでAWS Lambdaを作成する (.NET 5) AWSによるこの公式ドキュメントの最初の部分を参照してください:.NET 5 AWS Lambdaコンテナイメージサポート。 2. パッケージ依存関係の追加 これらの依存関係は、このAWS環境でのChromeのために必要です。 これらの指示に従ってDockerファイルを変更してください: .NET 5を使用したAWS Lambda AWS Lambda with .NET 7 AWS Lambda with .NET 8 3. Add the IronPDF (Linux) NuGet package Install IronPdf.Linux In Solution Explorer, right-click References, Manage NuGet Packages. Select Browse and search IronPdf.Linux. Select the package and install. 4. Modify FunctionHandler code This example will create a PDF file from a webpage https://ironpdf.com/ and save it to /tmp. To view this PDF, you must upload it to another service such as S3. It is necessary to configure the temporary folder when using IronPDF on AWS Lambda. Please use the TempFolderPath and CustomDeploymentDirectory properties to do this. public Casing FunctionHandler(string input, ILambdaContext context) { try { context.Logger.LogLine($"START FunctionHandler RequestId: {context.AwsRequestId} Input: {input}"); var awsTmpPath = @"/tmp/"; // AWS temporary storage location // [Optional] Enable logging for debugging // Uncomment these lines if you encounter issues // IronPdf.Logging.Logger.EnableDebugging = true; // IronPdf.Logging.Logger.LogFilePath = awsTmpPath; // IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All; // Set your IronPDF license key IronPdf.License.LicenseKey = "YOUR_LICENSE_KEY"; // Disable GPU for Chrome rendering in headless environments IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled; // Configure IronPDF to use the AWS temporary directory IronPdf.Installation.TempFolderPath = awsTmpPath; IronPdf.Installation.CustomDeploymentDirectory = awsTmpPath; // Automatically configure Linux and Docker dependencies IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = true; context.Logger.LogLine($"Creating IronPdf.ChromePdfRenderer"); var Renderer = new IronPdf.ChromePdfRenderer(); context.Logger.LogLine($"Rendering PDF"); using var pdfDoc = Renderer.RenderUrlAsPdf("https://ironpdf.com/"); var guid = Guid.NewGuid(); var fileName = $"/tmp/{input}_{guid}.pdf"; // Save file to /tmp context.Logger.LogLine($"Saving PDF with name: {fileName}"); pdfDoc.SaveAs(fileName); // Place for future code to upload the PDF file to a service like AWS S3. context.Logger.LogLine($"COMPLETE!"); } catch (Exception e) { context.Logger.LogLine($"[ERROR] FunctionHandler : {e.Message}"); } return new Casing(input?.ToLower(), input?.ToUpper()); } public Casing FunctionHandler(string input, ILambdaContext context) { try { context.Logger.LogLine($"START FunctionHandler RequestId: {context.AwsRequestId} Input: {input}"); var awsTmpPath = @"/tmp/"; // AWS temporary storage location // [Optional] Enable logging for debugging // Uncomment these lines if you encounter issues // IronPdf.Logging.Logger.EnableDebugging = true; // IronPdf.Logging.Logger.LogFilePath = awsTmpPath; // IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All; // Set your IronPDF license key IronPdf.License.LicenseKey = "YOUR_LICENSE_KEY"; // Disable GPU for Chrome rendering in headless environments IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled; // Configure IronPDF to use the AWS temporary directory IronPdf.Installation.TempFolderPath = awsTmpPath; IronPdf.Installation.CustomDeploymentDirectory = awsTmpPath; // Automatically configure Linux and Docker dependencies IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = true; context.Logger.LogLine($"Creating IronPdf.ChromePdfRenderer"); var Renderer = new IronPdf.ChromePdfRenderer(); context.Logger.LogLine($"Rendering PDF"); using var pdfDoc = Renderer.RenderUrlAsPdf("https://ironpdf.com/"); var guid = Guid.NewGuid(); var fileName = $"/tmp/{input}_{guid}.pdf"; // Save file to /tmp context.Logger.LogLine($"Saving PDF with name: {fileName}"); pdfDoc.SaveAs(fileName); // Place for future code to upload the PDF file to a service like AWS S3. context.Logger.LogLine($"COMPLETE!"); } catch (Exception e) { context.Logger.LogLine($"[ERROR] FunctionHandler : {e.Message}"); } return new Casing(input?.ToLower(), input?.ToUpper()); } Public Function FunctionHandler(ByVal input As String, ByVal context As ILambdaContext) As Casing Try context.Logger.LogLine($"START FunctionHandler RequestId: {context.AwsRequestId} Input: {input}") Dim awsTmpPath = "/tmp/" ' AWS temporary storage location ' [Optional] Enable logging for debugging ' Uncomment these lines if you encounter issues ' IronPdf.Logging.Logger.EnableDebugging = true; ' IronPdf.Logging.Logger.LogFilePath = awsTmpPath; ' IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All; ' Set your IronPDF license key IronPdf.License.LicenseKey = "YOUR_LICENSE_KEY" ' Disable GPU for Chrome rendering in headless environments IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled ' Configure IronPDF to use the AWS temporary directory IronPdf.Installation.TempFolderPath = awsTmpPath IronPdf.Installation.CustomDeploymentDirectory = awsTmpPath ' Automatically configure Linux and Docker dependencies IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = True context.Logger.LogLine($"Creating IronPdf.ChromePdfRenderer") Dim Renderer = New IronPdf.ChromePdfRenderer() context.Logger.LogLine($"Rendering PDF") Dim pdfDoc = Renderer.RenderUrlAsPdf("https://ironpdf.com/") Dim guid As System.Guid = System.Guid.NewGuid() Dim fileName = $"/tmp/{input}_{guid}.pdf" ' Save file to /tmp context.Logger.LogLine($"Saving PDF with name: {fileName}") pdfDoc.SaveAs(fileName) ' Place for future code to upload the PDF file to a service like AWS S3. context.Logger.LogLine($"COMPLETE!") Catch e As Exception context.Logger.LogLine($"[ERROR] FunctionHandler : {e.Message}") End Try Return New Casing(input?.ToLower(), input?.ToUpper()) End Function $vbLabelText $csharpLabel 5. Increase Memory and Timeout IronPDF requires more time and memory than the default value of Lambda. You can configure it in aws-lambda-tools-defaults.json. Please adjust this to match your function. In this example, we will set it to 512 (MB) and 330 (seconds). { "function-memory-size": 512, "function-timeout": 330 } You also can update this configuration using the Lambda console. Navigate to the Configuring AWS Lambda functions article for more information. 6. Publish Please follow the instructions in the latter part of the '.NET 5 AWS Lambda Support with Container Images' document to publish and test your Lambda function. 7. Try it out! You can activate the Lambda function using the Lambda console or via Visual Studio by using the AWS Toolkit for Visual Studio. よくある質問 .NET AWS Lambda関数を使用してURLからPDFを作成するにはどうすればよいですか? .NET AWS Lambda関数でURLからPDFを作成するには、IronPDFのChromePdfRenderer.RenderUrlAsPdfメソッドを使用します。TempFolderPathとCustomDeploymentDirectoryプロパティを使用して一時フォルダーを構成してください。 AWS LambdaでIronPDFを設定するためにどのような手順を取るべきですか? AWS LambdaでIronPDFを設定するには、TempFolderPathとCustomDeploymentDirectoryを使用して一時フォルダーパスを設定し、ChromeGpuModes.DisabledでGPUを無効にし、LinuxAndDockerDependenciesAutoConfigをtrueに設定してLinuxおよびDockerの依存関係を自動構成するようにします。 AWS Lambdaのメモリとタイムアウト設定を調整することが重要なのはなぜですか? AWS Lambdaのメモリとタイムアウト設定を調整することは、IronPDFがデフォルト設定よりも多くのリソースを必要とするため重要です。これはaws-lambda-tools-defaults.jsonで構成するか、AWS Lambdaコンソールを通じて行うことができます。 AWS Lambda のために Chrome の依存関係が正しくインストールされていることを確認するにはどうすればよいですか? 記事に示されたあなたの.NETバージョンに特有の指示に従ってDockerfileを修正することで、AWS環境でChromeに必要なLinuxパッケージをインストールすることを含め、Chrome依存関係が正しくインストールされていることを確認します。 Visual Studio を使用して AWS Lambda 関数をアクティブ化してテストできますか? はい、Visual StudioのAWS Toolkitを使用して、シームレスにIDEから直接デプロイとテストを実行することにより、AWS Lambda関数を有効にし、テストすることができます。 .NET 5のAWS Lambda用コンテナテンプレートを使用する意義は何ですか? .NET 5のAWS Lambda用コンテナテンプレートを使用することは、IronPDFなどの依存関係とともにアプリケーションをデプロイすることを容易にし、環境間の一貫性を確保するため重要です。 AWS Lambda関数でIronPDFを使用して例外をどのように処理しますか? IronPDF操作をtry-catchブロックで囲み、context.Logger.LogLineを使用してエラーを記録してデバッグおよびトラブルシューティングすることで、AWS Lambda関数で例外を処理します。 Curtis Chau 今すぐエンジニアリングチームとチャット テクニカルライター Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。 準備はいいですか? Nuget ダウンロード 16,154,058 | バージョン: 2025.11 ただ今リリースされました 試用ライセンスキーがメールで送信されました。 総ダウンロード数: 16,154,058 ライセンスを見る