objectscale_iam_policy (Resource)

This resource manages an Dell ObjectScale IAM policy.

Example Usage

/*
Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved.

Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://mozilla.org/MPL/2.0/


Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
resource "objectscale_iam_policy" "testacc_policy" {
  name        = "testacc_policy"
  namespace   = "ns1"
  description = "An example policy"
  policy_document = jsonencode({

    "Version" : "2012-10-17",

    "Statement" : [

      {

        "Action" : [

          "s3:ListBucket",

          "iam:GetUserPolicy"

        ],

        "Resource" : "*",

        "Effect" : "Allow",

        "Sid" : "VisualEditor0"

      }

    ]

  })
}

Schema

Required

  • name (String) The name of the IAM Policy.
  • namespace (String) The namespace in which to create the IAM Policy.
  • policy_document (String) The Policy Document defining the IAM Policy versions in JSON format.

Optional

  • description (String) The description of the IAM Policy.

Read-Only

  • arn (String) The Amazon Resource Name (ARN) of the IAM Policy.
  • create_date (String) The creation date of the IAM Policy.
  • version_id (String) The ID of the default policy document version.

Unless specified otherwise, all fields of this resource can be updated.

Import

Import is supported using the following syntax:

# Copyright (c) 2025 Dell Inc., or its subsidiaries. All Rights Reserved.

# Licensed under the Mozilla Public License Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://mozilla.org/MPL/2.0/


# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# The command is
# terraform import oobjectscale_iam_policy.testacc_policy <policy_arn#namespace>
# Example:
terraform import objectscale_iam_policy.testacc_policy urn:ecs:iam::ns1:policy/testacc_policy#ns1
# after running this command, populate the name field and other required parameters in the config file to start managing this resource.
# Note: running "terraform show" after importing shows the current config/state of the resource. You can copy/paste that config to make it easier to manage the resource.