Giter VIP home page Giter VIP logo

terraform-provider-soracom's Introduction

test release

Terraform provider for SORACOM

Please note: We take Terraform's security and our users' trust very seriously. If you believe you have found a security issue in the Terraform provider for SORACOM, please responsibly disclose it by contacting us at [email protected].

Documentation

Documentation is available on the Terraform website: https://registry.terraform.io/providers/ks6088ts/soracom/latest/docs

Get started

  1. See SORACOM CLI Getting Started Guide to create configuration profiles for SORACOM CLI. By default, the SORACOM CLI configuration file will be stored in ~/.soracom/myprofile.json on macOS/Linux or C:\Users\<username>\.soracom\myprofile.json on Windows.

  2. Create following usage example.

# Specify the version of the SORACOM Provider to use
terraform {
  required_providers {
    soracom = {
      source = "ks6088ts/soracom"
      version = "=0.0.2"
    }
  }
}

# Configure the SORACOM Provider
provider "soracom" {
  # set your own profile
  profile = "myprofile"
}

# Create resources (e.g. Create SIM group named as "my_sim_group")
resource "soracom_group" "group" {
  tags = {
    name = "my_sim_group"
    team = "soracom"
  }
}
  1. run the following commands to manage resources
# Initialize a new or existing Terraform working directory
terraform init

# Creates or updates infrastructure according to Terraform configuration files in the current directory.
terraform apply

# Confirm SIM group is created via SORACOM CLI
soracom groups list
[
	{
		"configuration": {},
		"createdAt": 1666314306643,
		"createdTime": 1666314306643,
		"groupId": "3d3cc5f7-9924-41d6-bc5f-f5b73e6ffe05",
		"lastModifiedAt": 1666314306643,
		"lastModifiedTime": 1666314306643,
		"operatorId": "OP0076153716",
		"tags": {
			"name": "my_sim_group",
			"team": "soracom"
		}
	}
]

# Destroy Terraform-managed infrastructure.
terraform destroy

# Confirm SIM group is deleted via SORACOM CLI
soracom groups list
[]

Contributing

Prerequisites

Build

Run the following from repository root to generate SORACOM provider in plugins directory.

make build

Test

All the tests are done on GitHub Actions. Please see details here: .github/workflows/test.yml.

Provider

To run tasks related to provider, see Makefile for details. For example, you can run all the tests for provider by the following command.

make ci-test

Examples

To run tasks related to HCL examples, see terraform.mk for details. For example, you can run all the tests for examples by the following command.

make -f terraform.mk ci-test-examples

Documents

To run tasks related to documents, see terraform.mk for details. For example, you can run all the tests for documents by the following command.

make -f terraform.mk ci-test-docs

References

terraform-provider-soracom's People

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

yuuu

terraform-provider-soracom's Issues

release to Terraform Registry

What would you like to be added?

release terraform provider for SORACOM to Terraform Registry

Why is this needed?

for anyone to install the provider

Differences of `soracom_eventhandler_handlers` resource cannot be detected correctly

System Informations

  • OS: macOS Monterey 12.4

Expected Behavior

No differences are to be detected.

Current Behavior

Differences are detected even though they are the same.

Steps to Reproduce

  1. run terraform apply to examples/eventhandler to create resources
  2. run terraform plan to check differences

Logs

❯ terraform plan
soracom_eventhandler_handlers.handlers: Refreshing state... [id=a46a56bb-6f58-4307-ace1-ceebd88bc991]

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # soracom_eventhandler_handlers.handlers has changed
  ~ resource "soracom_eventhandler_handlers" "handlers" {
        id                 = "a46a56bb-6f58-4307-ace1-ceebd88bc991"
        name               = "terraform-provider-soracom"
        # (3 unchanged attributes hidden)

      + action_config_list {
          + type = "ChangeSpeedClassAction"

          + properties {
              + execution_date_time_const = "BEGINNING_OF_NEXT_MONTH"
              + headers                   = {}
              + speed_class               = "s1.standard"
            }
        }
      - action_config_list {
          - type = "ChangeSpeedClassAction" -> null

          - properties {
              - execution_date_time_const = "BEGINNING_OF_NEXT_MONTH" -> null
              - speed_class               = "s1.standard" -> null
            }
        }
      + action_config_list {
          + type = "SendMailToOperatorAction"

          + properties {
              + execution_date_time_const = "BEGINNING_OF_NEXT_MONTH"
              + execution_offset_minutes  = "1"
              + headers                   = {}
              + message                   = <<-EOT
                    対象 IoT SIM: imsi

                    速度制限期間が終了したため、通信速度が "si.standard" に設定されました。
                EOT
              + title                     = "速度制限解除のお知らせ"
            }
        }
      - action_config_list {
          - type = "SendMailToOperatorAction" -> null

          - properties {
              - execution_date_time_const = "BEGINNING_OF_NEXT_MONTH" -> null
              - execution_offset_minutes  = "1" -> null
              - message                   = <<-EOT
                    対象 IoT SIM: imsi

                    速度制限期間が終了したため、通信速度が "si.standard" に設定されました。
                EOT -> null
              - title                     = "速度制限解除のお知らせ" -> null
            }
        }
      + action_config_list {
          + type = "ChangeSpeedClassAction"

          + properties {
              + execution_date_time_const = "IMMEDIATELY"
              + headers                   = {}
              + speed_class               = "s1.minimum"
            }
        }
      - action_config_list {
          - type = "ChangeSpeedClassAction" -> null

          - properties {
              - execution_date_time_const = "IMMEDIATELY" -> null
              - speed_class               = "s1.minimum" -> null
            }
        }
      + action_config_list {
          + type = "SendMailToOperatorAction"

          + properties {
              + execution_date_time_const = "IMMEDIATELY"
              + execution_offset_minutes  = "1"
              + headers                   = {}
              + message                   = <<-EOT
                    対象 IoT SIM: imsi

                    IoT SIMの月次データ通信量が 1024 MiBに到達したため、通信速度が "s1.minimum" に制限されました。
                EOT
              + title                     = "速度制限のお知らせ"
            }
        }
      - action_config_list {
          - type = "SendMailToOperatorAction" -> null

          - properties {
              - execution_date_time_const = "IMMEDIATELY" -> null
              - execution_offset_minutes  = "1" -> null
              - message                   = <<-EOT
                    対象 IoT SIM: imsi

                    IoT SIMの月次データ通信量が 1024 MiBに到達したため、通信速度が "s1.minimum" に制限されました。
                EOT -> null
              - title                     = "速度制限のお知らせ" -> null
            }
        }
      + action_config_list {
          + type = "ExecuteWebRequestAction"

          + properties {
              + content_type              = "application/json"
              + execution_date_time_const = "IMMEDIATELY"
              + execution_offset_minutes  = "1"
              + headers                   = {}
              + http_method               = "GET"
              + url                       = "https://yoursite.com"
            }
        }
      - action_config_list {
          - type = "ExecuteWebRequestAction" -> null

          - properties {
              - content_type              = "application/json" -> null
              - execution_date_time_const = "IMMEDIATELY" -> null
              - execution_offset_minutes  = "1" -> null
              - http_method               = "GET" -> null
              - url                       = "https://yoursite.com" -> null
            }
        }

        # (1 unchanged block hidden)
    }


Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to
undo or respond to these changes.

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Changes to Outputs:
  ~ handlers = {
      ~ action_config_list = [
          + {
              + properties = [
                  + {
                      + access_key                = ""
                      + body                      = ""
                      + content_type              = ""
                      + endpoint                  = ""
                      + execution_date_time_const = "BEGINNING_OF_NEXT_MONTH"
                      + execution_offset_minutes  = ""
                      + function_name             = ""
                      + headers                   = {}
                      + http_method               = ""
                      + message                   = ""
                      + parameter1                = ""
                      + parameter2                = ""
                      + parameter3                = ""
                      + parameter4                = ""
                      + parameter5                = ""
                      + secret_access_key         = ""
                      + speed_class               = "s1.standard"
                      + title                     = ""
                      + to                        = ""
                      + url                       = ""
                    },
                ]
              + type       = "ChangeSpeedClassAction"
            },
          - {
              - properties = [
                  - {
                      - access_key                = ""
                      - body                      = ""
                      - content_type              = ""
                      - endpoint                  = ""
                      - execution_date_time_const = "BEGINNING_OF_NEXT_MONTH"
                      - execution_offset_minutes  = ""
                      - function_name             = ""
                      - headers                   = null
                      - http_method               = ""
                      - message                   = ""
                      - parameter1                = ""
                      - parameter2                = ""
                      - parameter3                = ""
                      - parameter4                = ""
                      - parameter5                = ""
                      - secret_access_key         = ""
                      - speed_class               = "s1.standard"
                      - title                     = ""
                      - to                        = ""
                      - url                       = ""
                    },
                ]
              - type       = "ChangeSpeedClassAction"
            },
          + {
              + properties = [
                  + {
                      + access_key                = ""
                      + body                      = ""
                      + content_type              = ""
                      + endpoint                  = ""
                      + execution_date_time_const = "BEGINNING_OF_NEXT_MONTH"
                      + execution_offset_minutes  = "1"
                      + function_name             = ""
                      + headers                   = {}
                      + http_method               = ""
                      + message                   = <<-EOT
                            対象 IoT SIM: imsi

                            速度制限期間が終了したため、通信速度が "si.standard" に設定されました。
                        EOT
                      + parameter1                = ""
                      + parameter2                = ""
                      + parameter3                = ""
                      + parameter4                = ""
                      + parameter5                = ""
                      + secret_access_key         = ""
                      + speed_class               = ""
                      + title                     = "速度制限解除のお知らせ"
                      + to                        = ""
                      + url                       = ""
                    },
                ]
              + type       = "SendMailToOperatorAction"
            },
          - {
              - properties = [
                  - {
                      - access_key                = ""
                      - body                      = ""
                      - content_type              = ""
                      - endpoint                  = ""
                      - execution_date_time_const = "BEGINNING_OF_NEXT_MONTH"
                      - execution_offset_minutes  = "1"
                      - function_name             = ""
                      - headers                   = null
                      - http_method               = ""
                      - message                   = <<-EOT
                            対象 IoT SIM: imsi

                            速度制限期間が終了したため、通信速度が "si.standard" に設定されました。
                        EOT
                      - parameter1                = ""
                      - parameter2                = ""
                      - parameter3                = ""
                      - parameter4                = ""
                      - parameter5                = ""
                      - secret_access_key         = ""
                      - speed_class               = ""
                      - title                     = "速度制限解除のお知らせ"
                      - to                        = ""
                      - url                       = ""
                    },
                ]
              - type       = "SendMailToOperatorAction"
            },
          + {
              + properties = [
                  + {
                      + access_key                = ""
                      + body                      = ""
                      + content_type              = ""
                      + endpoint                  = ""
                      + execution_date_time_const = "IMMEDIATELY"
                      + execution_offset_minutes  = ""
                      + function_name             = ""
                      + headers                   = {}
                      + http_method               = ""
                      + message                   = ""
                      + parameter1                = ""
                      + parameter2                = ""
                      + parameter3                = ""
                      + parameter4                = ""
                      + parameter5                = ""
                      + secret_access_key         = ""
                      + speed_class               = "s1.minimum"
                      + title                     = ""
                      + to                        = ""
                      + url                       = ""
                    },
                ]
              + type       = "ChangeSpeedClassAction"
            },
          - {
              - properties = [
                  - {
                      - access_key                = ""
                      - body                      = ""
                      - content_type              = ""
                      - endpoint                  = ""
                      - execution_date_time_const = "IMMEDIATELY"
                      - execution_offset_minutes  = ""
                      - function_name             = ""
                      - headers                   = null
                      - http_method               = ""
                      - message                   = ""
                      - parameter1                = ""
                      - parameter2                = ""
                      - parameter3                = ""
                      - parameter4                = ""
                      - parameter5                = ""
                      - secret_access_key         = ""
                      - speed_class               = "s1.minimum"
                      - title                     = ""
                      - to                        = ""
                      - url                       = ""
                    },
                ]
              - type       = "ChangeSpeedClassAction"
            },
          + {
              + properties = [
                  + {
                      + access_key                = ""
                      + body                      = ""
                      + content_type              = ""
                      + endpoint                  = ""
                      + execution_date_time_const = "IMMEDIATELY"
                      + execution_offset_minutes  = "1"
                      + function_name             = ""
                      + headers                   = {}
                      + http_method               = ""
                      + message                   = <<-EOT
                            対象 IoT SIM: imsi

                            IoT SIMの月次データ通信量が 1024 MiBに到達したため、通信速度が "s1.minimum" に制限されました。
                        EOT
                      + parameter1                = ""
                      + parameter2                = ""
                      + parameter3                = ""
                      + parameter4                = ""
                      + parameter5                = ""
                      + secret_access_key         = ""
                      + speed_class               = ""
                      + title                     = "速度制限のお知らせ"
                      + to                        = ""
                      + url                       = ""
                    },
                ]
              + type       = "SendMailToOperatorAction"
            },
          - {
              - properties = [
                  - {
                      - access_key                = ""
                      - body                      = ""
                      - content_type              = ""
                      - endpoint                  = ""
                      - execution_date_time_const = "IMMEDIATELY"
                      - execution_offset_minutes  = "1"
                      - function_name             = ""
                      - headers                   = null
                      - http_method               = ""
                      - message                   = <<-EOT
                            対象 IoT SIM: imsi

                            IoT SIMの月次データ通信量が 1024 MiBに到達したため、通信速度が "s1.minimum" に制限されました。
                        EOT
                      - parameter1                = ""
                      - parameter2                = ""
                      - parameter3                = ""
                      - parameter4                = ""
                      - parameter5                = ""
                      - secret_access_key         = ""
                      - speed_class               = ""
                      - title                     = "速度制限のお知らせ"
                      - to                        = ""
                      - url                       = ""
                    },
                ]
              - type       = "SendMailToOperatorAction"
            },
          + {
              + properties = [
                  + {
                      + access_key                = ""
                      + body                      = ""
                      + content_type              = "application/json"
                      + endpoint                  = ""
                      + execution_date_time_const = "IMMEDIATELY"
                      + execution_offset_minutes  = "1"
                      + function_name             = ""
                      + headers                   = {}
                      + http_method               = "GET"
                      + message                   = ""
                      + parameter1                = ""
                      + parameter2                = ""
                      + parameter3                = ""
                      + parameter4                = ""
                      + parameter5                = ""
                      + secret_access_key         = ""
                      + speed_class               = ""
                      + title                     = ""
                      + to                        = ""
                      + url                       = "https://yoursite.com"
                    },
                ]
              + type       = "ExecuteWebRequestAction"
            },
          - {
              - properties = [
                  - {
                      - access_key                = ""
                      - body                      = ""
                      - content_type              = "application/json"
                      - endpoint                  = ""
                      - execution_date_time_const = "IMMEDIATELY"
                      - execution_offset_minutes  = "1"
                      - function_name             = ""
                      - headers                   = null
                      - http_method               = "GET"
                      - message                   = ""
                      - parameter1                = ""
                      - parameter2                = ""
                      - parameter3                = ""
                      - parameter4                = ""
                      - parameter5                = ""
                      - secret_access_key         = ""
                      - speed_class               = ""
                      - title                     = ""
                      - to                        = ""
                      - url                       = "https://yoursite.com"
                    },
                ]
              - type       = "ExecuteWebRequestAction"
            },
        ]
        id                 = "a46a56bb-6f58-4307-ace1-ceebd88bc991"
        name               = "terraform-provider-soracom"
        # (7 unchanged elements hidden)
    }

You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.

enable local installation of the provider for development

What would you like to be added?

Enable local installation of the provider for development, instead of downloading from terraform registry.

Why is this needed?

When running terraform init, provider plugins are downloaded from terraform registry.
For developing the provider itself, developers need to refer to a provider under development.

support sandbox api

What would you like to be added?

support sandbox api

Why is this needed?

mainly for testing

use `name` for SIM group name instead of `tags.name`

What would you like to be added?

use name for SIM group name instead of tags.name

Why is this needed?

It seems a bit awkward to set the SIM group name via tags.name.
Setting it via name simply would be better for users to understand how to set its name.
Moreover, this is a good manner for users to set name as an external specifications.
It should be noted that this fix includes breaking changes.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/labeler.yml
  • actions/labeler v4
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v5
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-go v3
  • crazy-max/ghaction-import-gpg v5
  • goreleaser/goreleaser-action v4.2.0
.github/workflows/test.yml
  • actions/checkout v3
  • actions/setup-go v3
  • hashicorp/setup-terraform v2
gomod
go.mod
  • go 1.19
  • github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0
  • github.com/ks6088ts/soracom-sdk-go v0.0.3
  • github.com/soracom/soracom-sdk-go v0.1.1-0.20221108005606-229c35a0e8ca@229c35a0e8ca

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.