Sunday, January 28, 2024

How to Access Amazon S3 Bucket Objects From OIC Integrations

 We connect to many different boundary systems from our OIC inegrations.

One such is Amazon S3 buckets.

In this blog we will see how we can create connection in OIC for S3, list object from S3, get object etc.

resource "aws_iam_policy" "s3-xyz-oracle-rw" {
  name        = "s3.xyz-oracle-.rw"
  path        = "/"
  description = ""
  policy      = data.aws_iam_policy_document.s3-xyz-oracle-rw-policy.json
}
resource "aws_iam_policy_attachment" "s3-xyz-oracle-rw-policy-attachment" {
  name       = "s3.xyz-oracle-.rw-policy-attachment"
  policy_arn = aws_iam_policy.s3-xyz-oracle-rw.arn
  groups     = []
  users      = ["oracle_user"]
  roles      = []
}
data "aws_iam_policy_document" "s3-xyz-oracle-rw-policy" {
  statement {
    effect = "Allow"
    actions = [
      "s3:DeleteObject",
      "s3:GetObject",
      "s3:GetObjectMetaData",
      "s3:ListMultipartUploadParts",
      "s3:GetBucketLocation",
      "s3:GetObjectAcl",
      "s3:PutObject",
      "s3:ListBucket",
      "s3:GetObjects",
      "s3:ListObjects",
    ]
    resources = [
      "arn:aws:s3:::xyz-finance-internal-only/inbound_to_workday/*",
      "arn:aws:s3:::xyz-finance-internal-only/oracle_to_hive/*",
    ]
  }
}


No comments:

Post a Comment