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
@rssnyder
rssnyder / oracle-cloud-free-tier-guide.md
Last active May 7, 2024 14:59
oracle-cloud-free-tier-guide

how to leverage oracle's temping offers

free tier limits

The limits of the free tier say that you can create up to 4 instances.

  • x2 x86 instances (2core/1g)
  • x2 ampere instances (with 4core/24g spread between them)
  • 200GB total boot volume space across all intances (minimum of 50G per instance)

create your account

@rssnyder
rssnyder / oidc.tf
Last active April 30, 2024 20:20
Harness AWS OIDC Role Creation with Terraform
data "aws_caller_identity" "this" {}
data "harness_platform_current_account" "this" {}
# create the identity provider
resource "aws_iam_openid_connect_provider" "this" {
url = "https://app.harness.io/ng/api/oidc/account/${data.harness_platform_current_account.this.id}"
client_id_list = [
"sts.amazonaws.com",
]
@rssnyder
rssnyder / readme.md
Last active April 29, 2024 00:53
ai answers in the terminal

open ended ai prompts

insprired by https://nickherrig.com/posts/streaming-requests

type a question into your terminal, get an ai respose

write pretty much the same code as the source blog, just using the entire source command+args to craft our input

question = " ".join(argv)
  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