Skip to content

Instantly share code, notes, and snippets.

View rssnyder's full-sized avatar
🥨
limitless servers in a serverless world

Riley Snyder rssnyder

🥨
limitless servers in a serverless world
View GitHub Profile
  1. For each ld project:

    a. Make an API call to get flag definitions:

     i. Be sure to use the summary=0 parameter
    
     ii. https://apidocs.launchdarkly.com/tag/Feature-flags/#operation/getFeatureFlags
    

    b. Make an API call for every ld project to get segment definitions:

@rssnyder
rssnyder / aws.tf
Created March 13, 2024 18:39
create a harness aws ccm connector for your master payer with terraform
terraform {
required_providers {
harness = {
source = "harness/harness"
}
}
}
provider "harness" {}
@rssnyder
rssnyder / azure.tf
Created March 13, 2024 18:20
create harness azure ccm connectors for every subscription in your azure tenant
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.0.0"
}
harness = {
source = "harness/harness"
}
}
@rssnyder
rssnyder / gcp.tf
Last active March 8, 2024 16:54
create harness ccm connectors for gcp projects and assign access to gcp projects with tf
locals {
# pull in accounts csv
projects_raw = csvdecode(file("./projects.csv"))
# only get linked account (ignore masters)
projects = [for account in local.projects_raw : account if account["Type"] == "Linked Account"]
}
variable "harness_gcp_sa" {
type = string
}
@rssnyder
rssnyder / gcp.tf
Last active March 8, 2024 16:47
apply harness sa permissions to a gcp project
variable "harness_gcp_sa" {
type = string
}
data "google_project" "project" {}
# for view access
resource "google_project_iam_member" "viewer" {
project = data.google_project.project.project_id
role = "roles/viewer"
@rssnyder
rssnyder / accounts.csv
Last active March 5, 2024 20:03
creating member account connectors with terraform
Linked account name Linked account Type
000000000001 aws-account-one Linked Account
000000000002 aws-account-two Linked Account
000000000003 aws-account-three Linked Account
@rssnyder
rssnyder / readme.md
Created February 29, 2024 15:03
python code to warm up an autostopping rule

environment vars

  • HARNESS_ACCOUNT_ID: your harness account id
  • HARNESS_PLATFORM_API_KEY: a harness api key with autostopping:read access at the all acccount level resources level

rule_id: the id of the autostopping rule image

warm_up_min: minutes to keep the instance up

@rssnyder
rssnyder / ff.tf
Created February 28, 2024 19:58
terraform for harness ff demo env
terraform {
required_providers {
harness = {
source = "harness/harness"
}
}
}
data "harness_platform_current_account" "this" {}
@rssnyder
rssnyder / 0.README.md
Last active February 22, 2024 14:38
create a k8s service account for use with a harness k8s connector

to get a connection into a k8s cluster without deploying a delegate, we need to create a service account with the correct permissions and generate a token for it.

first, we create the service account:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: harness
  namespace: default
@rssnyder
rssnyder / stress1.service
Created January 26, 2024 23:44
stress systemd
[Unit]
Description=stress
[Service]
SyslogIdentifier=stress
StandardOutput=journal
StandardError=journal
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/bin/stress -c 1
Restart=always