Skip to content

Export suggest Policy Document for Mobius3 to work #5

@sodre

Description

@sodre

Have a question? Please checkout our Slack Community or visit our Slack Archive.

Slack Community

Describe the Feature

In order for Mobius3 to work, the task needs a policy attached for it to work. I would like to have that value as an output.

Expected Behavior

output "policy" {
  value = data.aws_iam_policy_document.task_policy
}

data "aws_iam_policy_document" "task_policy" {
  statement {
    sid = "ListAndGetBucketLocations"
    actions = [
      "s3:ListAllMyBuckets",
      "s3:GetBucketLocation"
    ]
    resources = ["*"]
  }
  statement {
    sid = "AllowListBucketAndGetBucketLocation"
    actions = [
      "s3:ListBucket",
      "s3:ListBucketMultipartUploads"
    ]
    resources = [
      var.bucket_arn
    ]
  }
  statement {
    sid = "AllowAllS3OnMobius3Path"
    actions = [
      "s3:AbortMultipartUpload",
      "s3:DeleteObject",
      "s3:GetObject",
      "s3:ListMultipartUploadParts",
      "s3:PutObject",
      "s3:ListObjectsV2"
    ]
    resources = [
      var.bucket_arn,
      "${var.bucket_arn}/${var.bucket_key_prefix}*"
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions