Skip to content

Instantly share code, notes, and snippets.

View aossey's full-sized avatar

Michael Aossey aossey

  • Amazon Web Services
  • Orange County, CA
View GitHub Profile
@aossey
aossey / aws-sdk-user-agent-header-example-dotnet-ec2config-override.cs
Created July 10, 2021 00:50
AWS SDK (.NET) Example of Adding Custom User-Agent Value by Extending the AmazonEC2Config Class and Overriding the UserAgent Get Method
using System;
using Amazon.EC2;
namespace aws_sdk_user_agent_header_examples_dotnet
{
class Program
{
static void Main(string[] args)
{
var uaconfig = new UaEC2Config("test-ua-header");
@aossey
aossey / aws-sdk-user-agent-header-example-java2-s3-putobject.java
Created May 18, 2021 22:54
AWS SDK (Java 2) Example of Adding Custom User-Agent Value on S3 PutObject
import java.text.MessageFormat;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.PutObjectRequest;
import software.amazon.awssdk.services.s3.model.S3Exception;