Skip to content

paws.common-v0.7.0

Compare
Choose a tag to compare
@DyfanJones DyfanJones released this 09 Jan 10:40
· 368 commits to main since this release
f3a64ae

New Features: 💡

  • support sse md5 (#718). Thanks to @odysseu for raising issue.

Example of how to use SSECustomerKey and SSECustomerAlgorithm

library(paws)

KEY <- openssl::rand_bytes(32)
BUCKET <- 'mybucket'

client <- s3()
resp1 <- client$put_object(
  Bucket=BUCKET,
  Key='encrypt-key-1',
  Body=charToRaw('foobar'),
  SSECustomerKey= KEY,
  SSECustomerAlgorithm='AES256'
)

resp2 <- client$get_object(
  Bucket=BUCKET,
  Key='encrypt-key-1',
  SSECustomerKey=KEY,
  SSECustomerAlgorithm='AES256'
)
resp2$Body |> rawToChar()
#> [1] "foobar"

# saving key to file for later use:
temp_file <- tempfile()
writeBin(KEY, temp_file)

resp3 <- client$put_object(
  Bucket=BUCKET,
  Key='encrypt-key-2',
  Body=charToRaw('did it work?'),
  SSECustomerKey=readBin(temp_file, "raw", n = file.size(temp_file)),
  SSECustomerAlgorithm='AES256'
)

resp4 <- client$get_object(
  Bucket=BUCKET,
  Key='encrypt-key-2',
  SSECustomerKey=readBin(temp_file, "raw", n = file.size(temp_file)),
  SSECustomerAlgorithm='AES256'
)
resp4$Body |> rawToChar()
#> [1] "did it work?"

Created on 2024-01-09 with reprex v2.0.2

Example:

library(paws)

client = cloudwatchlogs()

pages <- paws.common::paginate(
  client$get_log_events(
    logGroupName = "/aws/sagemaker/NotebookInstances",
    logStreamName = "paws-demo/jupyter.log",
    startFromHead = TRUE
  ),
  StopOnSameToken = TRUE
)
length(pages)
#> [1] 9

Created on 2024-01-09 with reprex v2.0.2

  • support AWS_CONTAINER_CREDENTIALS_FULL_URI environmental variable. This supports services like sagemaker serverless endpoints (#737). Thanks to @ncullen93 for raising issue and testing.

Bug Fix: 🐞

  • fix aws-global region when resolving endpoint (#730). Thanks to @atheriel for identifying the issue.
  • fix default region for service s3 (#730). Thanks to @atheriel for identifying the issue.

Internal: ⚙️

  • tidy up internal function jmespath_index