Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
key.pub
24 changes: 24 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
Terraform Provider Heroku
=========================

[![Acceptance tests](https://github.com/heroku/terraform-provider-heroku/workflows/Acceptance/badge.svg)](https://github.com/heroku/terraform-provider-heroku/actions?query=workflow%3AAcceptance)

This provider is used to configure resources supported by the [Heroku Platform API](https://devcenter.heroku.com/articles/platform-api-reference).

See the [official documentation](https://www.terraform.io/docs/providers/heroku/index.html) to use this provider in a Terraform configuration.

<img src="https://cdn.rawgit.com/hashicorp/terraform-website/master/content/source/assets/images/logo-hashicorp.svg" width="600px">

Requirements
------------

- [Terraform](https://www.terraform.io/downloads.html) 0.12.x
- [Go](https://golang.org/doc/install) 1.15 (to build the provider plugin)

Usage
-----

For Terraform 0.11 compatibility, the configuration should specify version 3 or lower:

```hcl-terraform
provider "heroku" {
version = "~> 3.0"
}
```

Otherwise, the configuration should specify version 4 or higher:

```hcl-terraform
provider "heroku" {
version = "~> 4.0"
}
```

👓📚 For more usage info, see [Heroku Provider docs](https://www.terraform.io/docs/providers/heroku/index.html).

Development
-----------

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine
(version 1.15+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH),
as well as adding `$GOPATH/bin` to your `$PATH`.

### Clone the Provider

With Go language, the repository must be cloned to a specific path in `$GOPATH/src` that matches its module import path.

```sh
mkdir -p $GOPATH/src/github.com/heroku
cd $GOPATH/src/github.com/heroku
git clone git@github.com:heroku/terraform-provider-heroku
```

### Build the Provider

To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

```sh
$ make build
...
$ $GOPATH/bin/terraform-provider-heroku
...
```

### Using the Provider

To use the dev provider with local Terraform, copy the freshly built plugin into Terraform's local plugins directory:

```sh
cp $GOPATH/bin/terraform-provider-heroku ~/.terraform.d/plugins/
```

Set the Heroku provider without a version constraint:

```hcl-terraform
provider "heroku" {}
```

Then, initialize Terraform:

```sh
terraform init
```

### Testing

Please see the [TESTING](TESTING.md) guide for detailed instructions on running tests.

### Updating or adding dependencies

This project uses [Go Modules](https://github.com/golang/go/wiki/Modules) for dependency management.

Dependencies can be added or updated as follows:

```bash
$ GO111MODULE=on go get github.com/some/module@release-tag
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor
```

This example will fetch a module at the release tag and record it in your project's go.mod and go.sum files. It's a good idea to tidy up afterward and then copy the dependencies into vendor/.

If a module does not have release tags, then `module@master` can be used instead.

#### Removing dependencies

Remove all usage from your codebase and run:

```bash
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor
```
Binary file not shown.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ WORKDIR /
COPY Makefile $WORKDIR
COPY .Radicale.props.jq $WORKDIR

RUN make -e APPLICATION=radicale -e DOMAIN=ocw.mit.edu

CMD radicale --server-hosts 0.0.0.0:$PORT --config /config/config

20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
APPLICATION_ENVIRONMENT ?= test
HEROKU_APP ?= fixme
JQ = $(shell which jq)
COLLECTION_ROOT = $(APPLICATION)/data/collections/collection-root

%.plan: init
terraform plan -out $@

init:
terraform $@



default: extract

Expand All @@ -23,7 +32,16 @@ $(COLLECTION_ROOT)/user/%/.Radicale.props: $(COLLECTION_ROOT)


build:
docker build -t radicale:latest .
docker build -t radical:latest .

run: build
docker run --rm -p 5432:5432 radical:latest

.PHONY: image.pkr.hcl

image.pkr.hcl:
packer build $@


$(APPLICATION_ENVIRONMENT)/bookmarks-%.json:
@cat $@ | jq -rf bookmarks.jq
1 change: 1 addition & 0 deletions bookmarks.jq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.children[] | select(.root == "unfiledBookmarksFolder").children[].title
43 changes: 43 additions & 0 deletions heroku.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
terraform {
required_providers {
heroku = {
source = "heroku/heroku"
version = "4.0.0-beta"
}
}
}

provider "heroku" {
# Configuration options
}
variable "example_app_name" {
description = "Name of the Heroku app provisioned as an example"
}

resource "heroku_app" "example" {
name = var.example_app_name
region = "us"
}
# Build code & release to the app
resource "heroku_build" "example" {
app = "${heroku_app.example.name}"
buildpacks = ["https://github.com/mars/create-react-app-buildpack.git"]

source = {
url = "https://github.com/mars/cra-example-app/archive/v2.1.1.tar.gz"
version = "2.1.1"
}
}

# Launch the app's web process by scaling-up
resource "heroku_formation" "example" {
app = "${heroku_app.example.name}"
type = "web"
quantity = 1
size = "Standard-1x"
depends_on = ["heroku_build.example"]
}

output "example_app_url" {
value = "https://${heroku_app.example.name}.herokuapp.com"
}
3 changes: 3 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
web: Dockerfile
34 changes: 34 additions & 0 deletions image.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
variable "region" {
type = string
default = "us-east-1"
}

locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }

source "amazon-ebs" "example" {
ami_name = "page-${local.timestamp}"
instance_type = "t2.micro"
region = var.region
source_ami_filter {
filters = {
name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
ssh_username = "ubuntu"
}

build {
sources = ["source.amazon-ebs.example"]

provisioner "file" {
source = "./key.pub"
destination = "/tmp/key.pub"
}
provisioner "shell" {
script = "setup.sh"
}
}
27 changes: 27 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
variable "image_id" {
type = string
}

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
}

provider "aws" {
profile = "default"
region = "us-east-1"
}

resource "aws_instance" "example" {
ami = var.image_id
instance_type = "t2.micro"

tags = {
Name = "PAGE"
}
}

7 changes: 7 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Installing SSH key
sudo mkdir -p /home/ubuntu/.ssh
sudo chmod 700 /home/ubuntu/.ssh
sudo cp /tmp/key.pub /home/ubuntu/.ssh/authorized_keys
sudo chmod 600 /home/ubuntu/.ssh/authorized_keys
sudo chown -R ubuntu /home/ubuntu/.ssh
sudo usermod --shell /bin/bash ubuntu
8 changes: 8 additions & 0 deletions terraform.tfstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 4,
"terraform_version": "0.14.2",
"serial": 1,
"lineage": "efe63795-8bb9-9166-6a5e-be60fb76253c",
"outputs": {},
"resources": []
}
Binary file added test.plan
Binary file not shown.
1 change: 1 addition & 0 deletions test/bookmarks-2021-03-10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"guid":"root________","title":"","index":0,"dateAdded":1607127320353000,"lastModified":1615345569354000,"id":1,"typeCode":2,"type":"text/x-moz-place-container","root":"placesRoot","children":[{"guid":"menu________","title":"menu","index":0,"dateAdded":1607127320353000,"lastModified":1615343817218000,"id":2,"typeCode":2,"type":"text/x-moz-place-container","root":"bookmarksMenuFolder","children":[{"guid":"YZXuwRpaQEwG","title":"test","index":0,"dateAdded":1615343807301000,"lastModified":1615343817218000,"id":121,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"4Z1yCjvWch62","title":"follower_maze","index":0,"dateAdded":1613683187281000,"lastModified":1615343817218000,"id":28,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"javIwHeYU20H","title":"gRPC","index":0,"dateAdded":1613683175841000,"lastModified":1613683187310000,"id":27,"typeCode":1,"iconuri":"https://grpc.io/favicons/android-chrome-512x512.png","type":"text/x-moz-place","uri":"https://grpc.io/"},{"guid":"ScsGPRAOYCFt","title":"plantuml","index":1,"dateAdded":1613683219008000,"lastModified":1613683229303000,"id":29,"typeCode":1,"charset":"windows-1252","iconuri":"https://s.plantuml.com/favicon.ico","type":"text/x-moz-place","uri":"https://plantuml.com/preprocessing"},{"guid":"mjyueHy0iSau","title":"Language Guide  |  Protocol Buffers  |  Google Developers","index":2,"dateAdded":1613683275531000,"lastModified":1613683279673000,"id":30,"typeCode":1,"iconuri":"https://www.gstatic.com/devrel-devsite/prod/v4ff7513a940c844d7a200d0833ef676f25fef10662a3b57ca262bcf76cbd98e2/developers/images/touchicon-180.png","type":"text/x-moz-place","uri":"https://developers.google.com/protocol-buffers/docs/overview"},{"guid":"CNZGlEnmgGV0","title":"The C4 model for visualising software architecture","index":3,"dateAdded":1613692264123000,"lastModified":1613692269970000,"id":31,"typeCode":1,"type":"text/x-moz-place","uri":"https://c4model.com/"}]}]}]},{"guid":"toolbar_____","title":"toolbar","index":1,"dateAdded":1607127320353000,"lastModified":1613694411624000,"id":3,"typeCode":2,"type":"text/x-moz-place-container","root":"toolbarFolder"},{"guid":"unfiled_____","title":"unfiled","index":3,"dateAdded":1607127320353000,"lastModified":1615345569354000,"id":5,"typeCode":2,"type":"text/x-moz-place-container","root":"unfiledBookmarksFolder","children":[{"guid":"XouoYlv_BZXy","title":"models/EU-US/brexit","index":0,"dateAdded":1614589448270000,"lastModified":1614595889407000,"id":62,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"IBVQ9Ktgl9j0","title":"European Union - Wikipedia","index":0,"dateAdded":1614589550030000,"lastModified":1614589553611000,"id":63,"typeCode":1,"tags":"GeoSpatialGeomertry","iconuri":"https://en.wikipedia.org/static/apple-touch/wikipedia.png","type":"text/x-moz-place","uri":"https://en.wikipedia.org/wiki/European_Union"},{"guid":"skh7n9C5ZY51","title":"United States - Wikipedia","index":1,"dateAdded":1614589581257000,"lastModified":1614589581257000,"id":64,"typeCode":1,"tags":"Continent","iconuri":"https://en.wikipedia.org/static/apple-touch/wikipedia.png","type":"text/x-moz-place","uri":"https://en.wikipedia.org/wiki/United_States"},{"guid":"cq9rPz3dlhUo","title":"Brexit: What you need to know about the UK leaving the EU - BBC News","index":2,"dateAdded":1614589902003000,"lastModified":1614589902003000,"id":68,"typeCode":1,"tags":"GovernmentOrganization,FundingScheme","type":"text/x-moz-place","uri":"https://www.bbc.com/news/uk-politics-32810887"},{"guid":"2sv3CJoOjXN3","title":"http://localhost:4001/models/EU_US/brexit","index":3,"dateAdded":1614590457793000,"lastModified":1614590457793000,"id":75,"typeCode":1,"tags":"relatedQueries,interestByRegion,autoComplete,PresentationLogic","type":"text/x-moz-place","uri":"http://localhost:4001/models/EU_US/brexit","keyword":"list, of, keys, or a single one - perhaps better to feed in raw","postData":null}]},{"guid":"rJurCsoTVFhC","title":"analytics","index":1,"dateAdded":1614475078176000,"lastModified":1615262980034000,"id":32,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"BS03Rx2S4k7d","title":"Fiverr - Freelance Services Marketplace for Businesses","index":0,"dateAdded":1614475114795000,"lastModified":1614475122158000,"id":33,"typeCode":1,"tags":"Graphics,Design,Digital_Marketing,Writing,Translation,Video,Animation,Music,Audio,Programming,Tech","iconuri":"https://assetsv2.fiverrcdn.com/assets/v2_globals/apple-touch-icon-180x180-d5abd4cedbaf861091f2e039bfe10970.png","type":"text/x-moz-place","uri":"https://www.fiverr.com/"},{"guid":"PgYrofJd1beO","title":"Google Trends Categories · pat310/google-trends-api Wiki · GitHub","index":1,"dateAdded":1614475167130000,"lastModified":1614475167130000,"id":34,"typeCode":1,"iconuri":"https://github.githubassets.com/favicons/favicon.svg","type":"text/x-moz-place","uri":"https://github.com/pat310/google-trends-api/wiki/Google-Trends-Categories"},{"guid":"1WiCbwQPY2ap","title":"DuckDuckGo !Bang","index":2,"dateAdded":1614476867573000,"lastModified":1614476867573000,"id":57,"typeCode":1,"iconuri":"https://duckduckgo.com/assets/icons/meta/DDG-iOS-icon_152x152.png","type":"text/x-moz-place","uri":"https://duckduckgo.com/bang_lite.html"},{"guid":"a8OL8Dng-hMa","title":"Programmable Search Engine by Google","index":3,"dateAdded":1614478102719000,"lastModified":1614478102719000,"id":58,"typeCode":1,"iconuri":"https://www.google.com/favicon.ico","type":"text/x-moz-place","uri":"https://programmablesearchengine.google.com/about/"},{"guid":"2svXOFTQRutJ","title":"Schema.org - Schema.org","index":4,"dateAdded":1614499179731000,"lastModified":1614499179731000,"id":59,"typeCode":1,"charset":"windows-1252","iconuri":"https://www.schema.org/docs/favicon.ico","type":"text/x-moz-place","uri":"https://www.schema.org/"},{"guid":"3FVZ93mj3UmL","title":"The Linux man-pages project","index":5,"dateAdded":1614500917364000,"lastModified":1614500917364000,"id":60,"typeCode":1,"type":"text/x-moz-place","uri":"https://www.kernel.org/doc/man-pages/"},{"guid":"PjCZWmFhC8Uv","title":"GitHub - tldr-pages/tldr: 📚 Collaborative cheatsheets for console commands","index":6,"dateAdded":1614500938529000,"lastModified":1614500938529000,"id":61,"typeCode":1,"iconuri":"https://github.githubassets.com/favicons/favicon.svg","type":"text/x-moz-place","uri":"https://github.com/tldr-pages/tldr"}]},{"guid":"bktquLFHEGcj","title":"StackOverflowQuestions","index":2,"dateAdded":1614595555468000,"lastModified":1614595889407000,"id":106,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"ZYCEJWIUcCtO","title":"google-trends-api - npm","index":0,"dateAdded":1614595527254000,"lastModified":1614595570133000,"id":105,"typeCode":1,"tags":"RemoteCategory:Programming_&_Tech","iconuri":"https://static.npmjs.com/1996fcfdf7ca81ea795f67f093d7f449.png","type":"text/x-moz-place","uri":"https://www.npmjs.com/package/google-trends-api#interestbyregion","keyword":"does \"keyword\" argument violate comparing search term and topic?","postData":null}]},{"guid":"pkc5uNDJlEbm","title":"Translations","index":3,"dateAdded":1614593615106000,"lastModified":1614595889407000,"id":90,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"aQMsymimG5vB","title":"Hot Questions - Stack Exchange","index":0,"dateAdded":1614593523369000,"lastModified":1614593630317000,"id":86,"typeCode":1,"tags":"WebService,Historical","iconuri":"https://cdn.sstatic.net/Sites/stackexchange/Img/apple-touch-icon.png","type":"text/x-moz-place","uri":"https://stackexchange.com/"},{"guid":"sHVxITKIIXY6","title":"A place to share knowledge and better understand the world","index":1,"dateAdded":1614593548434000,"lastModified":1614593630317000,"id":87,"typeCode":1,"tags":"WebService,Language","iconuri":"https://qsf.fs.quoracdn.net/-4-images.favicon.ico-26-ebf6a9e7f7b4576d.ico","type":"text/x-moz-place","uri":"https://www.quora.com/","keyword":"german, expert","postData":null},{"guid":"NwkOEaG60rbh","title":"Twitter. It’s what’s happening / Twitter","index":2,"dateAdded":1614593562956000,"lastModified":1614593630317000,"id":88,"typeCode":1,"tags":"WebService,RealTime","iconuri":"https://abs.twimg.com/responsive-web/client-web/icon-ios.b1fc7275.png","type":"text/x-moz-place","uri":"https://twitter.com/?lang=en"},{"guid":"GQ0UFF84RF48","title":"http://localhost:4001/babel/data","index":3,"dateAdded":1614593602701000,"lastModified":1614593630317000,"id":89,"typeCode":1,"tags":"PresentationLogic","type":"text/x-moz-place","uri":"http://localhost:4001/babel/data","keyword":"build up representation in translations by asking questions about example translations and technical / historical knowledge informing translations | media is message","postData":null},{"guid":"210E2ycaCfDM","title":"tmux://translations.development - Google Search","index":4,"dateAdded":1614593720731000,"lastModified":1614593729053000,"id":91,"typeCode":1,"tags":"Schedule","type":"text/x-moz-place","uri":"https://www.google.com/search?client=firefox-b-d&q=tmux%3A%2F%2Ftranslations.development"}]},{"guid":"kUWALg__AfCl","title":"Tech","index":4,"dateAdded":1614595984991000,"lastModified":1614596002826000,"id":110,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"hZZjUZ2K51Nt","title":"Error | Trello","index":0,"dateAdded":1614595974669000,"lastModified":1614595985020000,"id":109,"typeCode":1,"iconuri":"https://a.trellocdn.com/prgb/dist/images/ios/apple-touch-icon-152x152-precomposed.0307bc39ec6c9ff499c8.png","type":"text/x-moz-place","uri":"https://trello.com/c/8OH3X5bl"}]},{"guid":"_e7qKcX0DPY3","title":"selbstandige","index":5,"dateAdded":1615254695822000,"lastModified":1615257112519000,"id":111,"typeCode":2,"type":"text/x-moz-place-container","children":[{"guid":"cNvDnq7rpZPn","title":"Technical","index":0,"dateAdded":1615255117656000,"lastModified":1615255127344000,"id":113,"typeCode":1,"type":"text/x-moz-place","uri":"https://trello.com/b/maSbEhFS/technical"},{"guid":"cIctfo--sjPQ","title":"Content","index":1,"dateAdded":1615255226865000,"lastModified":1615255235360000,"id":116,"typeCode":1,"type":"text/x-moz-place","uri":"https://trello.com/b/FFhUDhCU/content"},{"guid":"DgmnsI4eQv7h","title":"Product","index":2,"dateAdded":1615255183571000,"lastModified":1615255193303000,"id":115,"typeCode":1,"type":"text/x-moz-place","uri":"https://trello.com/b/1FURBshu/product"},{"guid":"f-sGwU17D1UR","title":"Business","index":3,"dateAdded":1615255157910000,"lastModified":1615255166159000,"id":114,"typeCode":1,"type":"text/x-moz-place","uri":"https://trello.com/b/42uqfRWq/business"},{"guid":"qVDOOQHjroaF","title":"Search API","index":4,"dateAdded":1615257112519000,"lastModified":1615257122469000,"id":117,"typeCode":1,"tags":"entrypoint","type":"text/x-moz-place","uri":"https://developer.atlassian.com/cloud/trello/rest/api-group-search/"},{"guid":"_KZO66RBm0Za","title":"Workspace","index":5,"dateAdded":1615254712581000,"lastModified":1615255135380000,"id":112,"typeCode":1,"type":"text/x-moz-place","uri":"https://trello.com/b/RxPvhmVt/workspace"}]}]},{"guid":"mobile______","title":"mobile","index":4,"dateAdded":1607127320361000,"lastModified":1607127320461000,"id":6,"typeCode":2,"type":"text/x-moz-place-container","root":"mobileFolder"}]}
65 changes: 65 additions & 0 deletions test/bookmarks.html

Large diffs are not rendered by default.

Loading