object-storage-2

Create Role

Creates a service IAM role.

post/1.3/object-storage-2/{service-uuid}/roles

Request

  • Base URL: https://api.upcloud.com
  • URL: https://api.upcloud.com/1.3/object-storage-2/{service-uuid}/roles
  • Auth: HTTP bearer

Path parameters

service-uuidstring uuid required

The unique identifier for the service.

Example:01234567-89ab-cdef-0123-456789abcdef

Service UUID

Request body

namestring required
assume_role_policy_documentstring required

The policy document that grants an entity permission to assume the role.

descriptionstring

Description of the role.

max_session_durationinteger

Maximum session duration in seconds.

permissions_boundarystring

Policy name to set as the permissions boundary.

Example request

{
  "assume_role_policy_document": "{\"Version\": \"2012-10-17\",\"Statement\": [{\"Action\": \"sts:AssumeRole\",\"Principal\": {\"AWS\": [\"urn:ecs:iam::ns1:user/Demby\"]},\"Effect\": \"Allow\",\"Resource\": \"*\"}]}",
  "description": "A test role.",
  "max_session_duration": 3600,
  "name": "test-role",
  "permissions_boundary": "test-policy",
  "tags": [
    {
      "key": "department",
      "value": "Finance"
    },
    {
      "key": "school",
      "value": "University of Helsinki"
    }
  ]
}

Response

Created

arnstring
assume_role_policy_documentstring
created_atstring date-time
descriptionstring
max_session_durationinteger
namestring
permissions_boundarystring

Example response

{
  "arn": "urn:ecs:iam::12e8c7066c0445c284c1381f899bcee7:role/example",
  "assume_role_policy_document": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Principal\":{\"AWS\":[\"urn:ecs:iam::12442a2fbc06434889edb631be2d0968:user/user1\"]},\"Effect\":\"Allow\",\"Resource\":\"*\"}]}",
  "created_at": "2024-09-19T12:43:24Z",
  "description": "An example role",
  "inline_policies": [
    {
      "name": "InlinePolicy"
    }
  ],
  "max_session_duration": 36000,
  "name": "example",
  "permissions_boundary": "SamplePolicy",
  "policies": [
    {
      "arn": "urn:ecs:iam::12e8c7066c0445c284c1381f899bcee7:policy/SamplePolicy",
      "name": "SamplePolicy"
    }
  ],
  "tags": [
    {
      "key": "tag1",
      "value": "key1"
    },
    {
      "key": "tag2",
      "value": "key2"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.