Skip to main content

No project description provided

Project description

pulumi-miniflux

A multi-language Pulumi component builder for Miniflux, the excellent open-source RSS server.

What does this repository do?

I use this repository to build and publish a Pulumi package that deploys a Miniflux server on AWS. The package wraps a component written in Go that handles declaring all of the AWS infrastructure, network rules, policies, etc., to deploy a container on AWS Fargate and a managed PostgreSQL database on Amazon RDS in an easy-to-use API that you can consume in any language Pulumi supports. Just configure the passwords (as encrypted Pulumi secrets) that you want to use for your Miniflux admin and PostgreSQL users, then run pulumi up and let Pulumi handle the rest.

image

Components are published to the usual package managers:

Component API

TypeScript/JavaScript

const config = new pulumi.Config();
const adminPassword = config.requireSecret("adminPassword");
const dbPassword = config.requireSecret("adminPassword");

const service = new miniflux.MinifluxService("service", {
    adminPassword,
    dbPassword,
});

Python

config = pulumi.Config();
admin_password = config.get_secret("adminPassword")
db_password = config.get_secret("dbPassword")

service = miniflux_service.MinifluxService("service",
        admin_password = admin_password,
        db_password = db_password
    )

Go

conf := config.New(ctx, "")
adminPassword := conf.RequireSecret("adminPassword")
dbPassword := conf.RequireSecret("dbPassword")

service, err := miniflux.NewMinifluxService(ctx, "service", &miniflux.MinifluxServiceArgs{
    AdminPassword: adminPassword,
    DbPassword:    dbPassword,
})

C#

var config = new Pulumi.Config();
var adminPassword = config.RequireSecret("adminPassword");
var dbPassword = config.RequireSecret("dbPassword");

var service = new Pulumi.Miniflux.MinifluxService("service", new Pulumi.Miniflux.MinifluxServiceArgs{
    AdminPassword = adminPassword,
    DbPassword = dbPassword,
});

See below for more detailed instructions. Complete programs are available at ./examples.

Using published components

All components require Pulumi, of course. Then, assuming you've configured Pulumi and AWS, you can follow the instructions below to use the component in your language of choice.

TypeScript/JavaScript

On the command line:

$ pulumi new typescript
$ npm install --save @pulumi/aws-miniflux
$ pulumi config set --secret adminPassword "some-secret-password"
$ pulumi config set --secret dbPassword "some-other-secret-password"

In index.ts:

import * as pulumi from "@pulumi/pulumi";
import * as miniflux from "@pulumi/aws-miniflux";

const config = new pulumi.Config();
const adminPassword = config.requireSecret("adminPassword");
const dbPassword = config.requireSecret("adminPassword");

// Create a new Miniflux service.
const service = new miniflux.MinifluxService("service", {
    adminPassword,
    dbPassword,
});

// Export the URL of the service.
export const endpoint = pulumi.interpolate`http://${service.endpoint}`;

Python

On the command line:

$ pulumi new python
$ pip install pulumi_miniflux
$ pulumi config set --secret adminPassword "some-secret-password"
$ pulumi config set --secret dbPassword "some-other-secret-password"

In __main.py__:

import pulumi
from pulumi_aws import s3
from pulumi_aws_miniflux import miniflux_service

config = pulumi.Config();
admin_password = config.get_secret("adminPassword")
db_password = config.get_secret("dbPassword")

# Create a new Miniflux service.
service = miniflux_service.MinifluxService("service",
        admin_password = admin_password,
        db_password = db_password
    )

# Export the URL of the service.
pulumi.export("endpoint", service.endpoint)

Go

On the command line:

$ pulumi new go
$ go get github.com/pulumi/pulumi-aws-miniflux/sdk/go/miniflux
$ pulumi config set --secret adminPassword "some-secret-password"
$ pulumi config set --secret dbPassword "some-other-secret-password"

In main.go:

package main

import (
	"github.com/pulumi/pulumi-aws-miniflux/sdk/go/miniflux"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {

		conf := config.New(ctx, "")
		adminPassword := conf.RequireSecret("adminPassword")
		dbPassword := conf.RequireSecret("dbPassword")

		// Create a new Miniflux service.
		service, err := miniflux.NewMinifluxService(ctx, "service", &miniflux.MinifluxServiceArgs{
			AdminPassword: adminPassword,
			DbPassword:    dbPassword,
		})
		if err != nil {
			return nil
		}

		// Export the URL of the service.
		ctx.Export("endpoint", pulumi.Sprintf("http://%s", service.Endpoint))
		return nil
	})
}

C#

On the command line:

$ pulumi new csharp
$ dotnet add package Pulumi.AwsMiniflux
$ pulumi config set --secret adminPassword "some-secret-password"
$ pulumi config set --secret dbPassword "some-other-secret-password"

In MyStack.cs:

using Pulumi;
using Pulumi.Aws.S3;
using Pulumi.AwsMiniflux;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Pulumi.Config();
        var adminPassword = config.RequireSecret("adminPassword");
        var dbPassword = config.RequireSecret("dbPassword");

        // Create a new Miniflux service.
        var service = new Pulumi.AwsMiniflux.MinifluxService("service", new Pulumi.AwsMiniflux.MinifluxServiceArgs{
            AdminPassword = adminPassword,
            DbPassword = dbPassword,
        });

        // Export the URL of the service.
        this.Endpoint = Output.Format($"http://{service.Endpoint}");
    }

    [Output]
    public Output<string> Endpoint { get; set; }
}

More on how all this stuff works

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulumi_aws_miniflux-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

File details

Details for the file pulumi_aws_miniflux-0.1.0.tar.gz.

File metadata

  • Download URL: pulumi_aws_miniflux-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pulumi_aws_miniflux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 14c98823ce4290f65804aa0c5684f9396d6eaebe9058b25a206973dac78efc94
MD5 ccddf2c3d975022f66d112c6ff9b290b
BLAKE2b-256 83276bb2fad8eecd07bf06cdf22b19980862e52a1a9d46eb6db8272ba0dfc708

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page