{"id":24041873,"url":"https://github.com/virtuslab/besom","last_synced_at":"2025-04-05T01:05:26.235Z","repository":{"id":193572272,"uuid":"503650029","full_name":"VirtusLab/besom","owner":"VirtusLab","description":"Besom - a Pulumi SDK for Scala. Also, incidentally, a broom made of twigs tied round a stick. Brooms and besoms are used for protection, to ward off evil spirits, and cleansing of ritual spaces.","archived":false,"fork":false,"pushed_at":"2025-03-25T11:01:57.000Z","size":26202,"stargazers_count":142,"open_issues_count":101,"forks_count":8,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-01T16:00:05.148Z","etag":null,"topics":["infrastructure-as-code","pulumi","scala"],"latest_commit_sha":null,"homepage":"https://virtuslab.github.io/besom/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VirtusLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-15T06:53:29.000Z","updated_at":"2025-03-31T06:37:12.000Z","dependencies_parsed_at":"2023-09-08T20:29:59.296Z","dependency_job_id":"c45fe4a4-1bf8-48e6-bad7-415e669873df","html_url":"https://github.com/VirtusLab/besom","commit_stats":null,"previous_names":["virtuslab/besom"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirtusLab%2Fbesom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirtusLab%2Fbesom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirtusLab%2Fbesom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirtusLab%2Fbesom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VirtusLab","download_url":"https://codeload.github.com/VirtusLab/besom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271525,"owners_count":20911587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["infrastructure-as-code","pulumi","scala"],"created_at":"2025-01-08T22:13:36.336Z","updated_at":"2025-04-05T01:05:26.218Z","avatar_url":"https://github.com/VirtusLab.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Besom\n**Besom** - a broom made of twigs tied around a stick. \nBrooms and besoms are used for protection, to ward off evil spirits, and cleansing of ritual spaces. \nAlso, Besom is Scala SDK that allows you to write Pulumi programs in Scala, incidentally.\n\n![Besom logo](./website/static/img/Besom_logo_full_color.png)\n\n**Besom Scala SDK for Pulumi** lets you leverage the full power of [Pulumi Infrastructure as Code Platform](https://pulumi.com) \nusing the Scala programming language. Scala support is currently in **Public Beta**.\n\n**Pulumi** is a registered trademark of [Pulumi Corporation](https://pulumi.com).\n\n## Welcome\n\n* **[Get Started with Besom](#getting-started)**: Deploy a simple application in AWS, Azure, Google Cloud or Kubernetes using Besom to describe the desired infrastructure using Scala.\n\n* **[Besom Docs](https://virtuslab.github.io/besom/)**: Learn about Besom concepts, follow user-guides, and consult the reference documentation.\n\n* **[Examples](https://github.com/VirtusLab/besom/tree/v0.3.2/examples)**: Browse Scala examples across many clouds and scenarios including containers, serverless,\n  and infrastructure.\n\n## \u003ca name=\"getting-started\"\u003e\u003c/a\u003eGetting Started\n\n1. **Install Pulumi CLI**:\n\n   To install the latest Pulumi release, run the following (see full\n   [installation instructions](https://www.pulumi.com/docs/reference/install/) for additional installation options):\n\n    ```bash\n    curl -fsSL https://get.pulumi.com/ | sh\n    ```\n\n2. **Install Scala CLI**:\n\n   To install the latest Scala CLI release, run the following (see \n   [installation instructions](https://scala-cli.virtuslab.org/install) for additional installation options):\n\n    ```bash\n    curl -sSLf https://scala-cli.virtuslab.org/get | sh\n    ```\n\n3. **Install Scala Language Plugin in Pulumi**:\n\n    To install the latest Scala Language Plugin release, run the following:\n\n    ```bash\n    pulumi plugin install language scala 0.3.2 --server github://api.github.com/VirtusLab/besom\n    ```\n\n4. **Create a new project**:\n\n   You can start writing your Besom code at this point, but to help you set up\n   Besom comes with [Pulumi templates](./templates).\n   \n   You can get started with the `pulumi new` command:\n\n    ```bash\n    mkdir besom-demo \u0026\u0026 cd besom-demo\n    ```\n    ```bash\n    pulumi new https://github.com/VirtusLab/besom/tree/v0.3.2/templates/aws\n    ```\n\n5. **Deploy to the Cloud**:\n\n   Run `pulumi up` to get your code to the cloud:\n\n    ```bash\n    pulumi up\n    ```\n\n   This makes all cloud resources declared in your code. Simply make\n   edits to your project, and subsequent `pulumi up`s will compute\n   the minimal diff to deploy your changes.\n\n6. **Use Your Program**:\n\n   Now that your code is deployed, you can interact with it. In the\n   above example, we can find the name of the newly provisioned S3\n   bucket:\n\n    ```bash\n    pulumi stack output bucketName\n    ```\n\n7. **Destroy your Resources**:\n\n   After you're done, you can remove all resources created by your program:\n\n    ```bash\n    pulumi destroy -y\n    ```\n\nTo learn more, head over to \n[virtuslab.github.io/besom](https://virtuslab.github.io/besom/) for much more information, including\n[tutorial](https://virtuslab.github.io/besom/docs/tutorial),\n[examples](https://github.com/VirtusLab/besom/tree/v0.3.2/examples),\nand [architecture and programming model concepts](https://virtuslab.github.io/besom/docs/architecture).\n\n## Explaining the project structure\n`Pulumi.yaml` is your main Pulumi file, explained [here](https://www.pulumi.com/docs/concepts/projects/project-file/). \n\n`project.scala` is the file containing your dependencies for [Scala-CLI](https://scala-cli.virtuslab.org).\n\n`Main.scala` is the entry point for your Infrastructure as Code. \n\nResources created in `Pulumi.run { ... }` block will be created by Pulumi.\n\nA simple example using Scala CLI:\n```scala\n//\u003e using scala \"3.3.1\"\n//\u003e using plugin \"org.virtuslab::besom-compiler-plugin:0.3.2\"\n//\u003e using dep \"org.virtuslab::besom-core:0.3.2\"\n//\u003e using dep \"org.virtuslab::besom-aws:6.31.0-core.0.3\"\n\nimport besom.*\nimport besom.api.aws\n\n@main def run = Pulumi.run {\n   val bucket = aws.s3.Bucket(\"my-bucket\")\n\n   Stack.exports(\n      bucketName = bucket.bucket\n   )\n}\n```\n\n\u003e [!NOTE]\n\u003e Please pay attention to your dependencies, **only use `org.virtuslab::besom-*`** and not `com.pulumi:*`.\n\u003e Besom **does NOT depend on Pulumi Java SDK**, it is a completely separate implementation.\n\n## Tips\n- Resources are initialized lazily. To make them appear in your physical infrastructure make sure \ntheir evaluation is triggered directly or transitively (by referencing them or resources that depend on them) by \nincluding them in the final `Stack` structure of your program.\n- Use whatever Scala concepts you are familiar with, infrastructure as code in Besom is still a Scala program, \nso you have the full potential of the language to work with.\n- Pay attention to the types. You will be instantiating case classes to pass parameters, note their package of origin.\n- Some Pulumi functions that allow you to access the metadata of the current stack require access to the `Context`. \n`Context` is available as a given (implicitly) in the `Pulumi.run` block, but you can also require it explicitly \nin any of your functions with `(using Context)`.\n\n## Requirements\n\n- JDK 11 or higher is required\n- Scala 3.3.1 or higher is required\n\nScala CLI is the recommended build tool, other tools are also\nsupported. Besom will recognize Scala CLI and SBT programs \nand automatically recompile them without any further configuration. \nThe supported versions are:\n\n- Scala CLI 1.0.4 or higher\n- SBT 1.9.6 or higher\n- Apache Maven 3.8.4 or higher\n- Gradle Build Tool 7.4 or higher\n\nOther build tools are supported via the `runtime.options.binary`\nconfiguration option that can point to a pre-built jar in\n`Pulumi.yaml`, e.g.:\n\n```yaml\nname: myproject\nruntime:\n  name: scala\n  options:\n    binary: target/myproject-1.0-SNAPSHOT-jar-with-dependencies.jar\n```\n\n## Choice of build tool and IDE\n\nBesom uses [Scala-CLI](https://scala-cli.virtuslab.org/) for project compilation and execution.\n\nTo set up IDE support for an infrastructural project using Besom execute this command \ninside the directory in which Besom project files exist:\n```bash\nscala-cli setup-ide .\n```\nAs a result of this command, a `.bsp` directory will be created inside the project directory.\n\nWhen opened, both [Intellij IDEA](https://www.jetbrains.com/idea/) \nand [Metals](https://scalameta.org/metals/) should automatically recognize \nthe project and set up the IDE accordingly.\n\n[sbt](https://www.scala-sbt.org/), [gradle](https://gradle.org/) and [maven](https://maven.apache.org/) are also supported out-of-the-box,\nbut are **not recommended** due to slower iteration speed. \nUse of `sbt`, `gradle` or `mvn` support is suggested for situations where managed infrastructure\nis being added to an already existing project that uses sbt as the main build tool.\n\nIDE setup for `sbt`, `gradle` or `mvn` works automatically with both Intellij IDEA and Metals.\n\n[Mill](https://mill-build.com/) is not yet supported.\n\n## Contributing\n\nVisit [CONTRIBUTING.md](CONTRIBUTING.md) for information on building Besom from source or contributing improvements.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuslab%2Fbesom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirtuslab%2Fbesom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuslab%2Fbesom/lists"}