Skip to content

Commit f00f882

Browse files
authored
Merge pull request #2 from Worklytics/s146-improve-init
improve initialization, update to 0.4.18
2 parents cfb4dfc + 4896159 commit f00f882

File tree

6 files changed

+34
-69
lines changed

6 files changed

+34
-69
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ You'll need:
1717
- a Bash-like shell environment on Linux, MacOS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install).
1818
- [`git` installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), although it
1919
is usually included on those platforms (check with `git --version`).
20+
- an AWS account and credentials, as described in [Psoxy's AWS - Getting Started docs](https://github.com/Worklytics/psoxy/blob/v0.4.18/docs/aws/getting-started.md)
21+
- the [prerequisites for Psoxy](https://github.com/Worklytics/psoxy/blob/v0.4.18/README.md#prerequisites)
22+
itself, although this example will attempt to help you check those
2023

2124
### Setup
2225

@@ -39,22 +42,28 @@ git clone https://github.com/{{YOUR_ORG_ID}}/{{YOUR_REPO_NAME}}.git
3942
./check-prereqs
4043
```
4144

42-
4. Initialize your configuration
45+
4. Authenticate your tools as needed:
46+
47+
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - `aws get-caller-identity` should work and return your expected account/user
48+
- if plan to get data from Google Workspace, auth [GCloud CLI](https://cloud.google.com/sdk/docs/authorizing) - `gcloud auth login` to authenticate, then `gcloud auth list` to verify you have expected account/user
49+
- if plan to get data from Microsoft 365, auth [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli) - `az login --allow-no-subscription` to authenticate, then `az account list` to verify you have expected account/user
50+
51+
5. Initialize your configuration
4352

4453
```shell
4554
./init
4655
```
4756

48-
5. Review your `terraform.tfvars` file; customize as needed (eg, comment out datasources you don't need).
57+
6. Review your `terraform.tfvars` file; customize as needed (eg, comment out datasources you don't need).
4958

50-
6. Run `terraform plan` and review results to understand what will be created. Customize your
59+
7. Run `terraform plan` and review results to understand what will be created. Customize your
5160
`terraform.tfvars` or `main.tf` file if needed.
5261

5362
```shell
5463
terraform plan
5564
```
5665

57-
7. Run `terraform apply` to create the resources.
66+
8. Run `terraform apply` to create the resources.
5867
```shell
5968
terraform apply
6069
```

build

Lines changed: 0 additions & 23 deletions
This file was deleted.

check-prereqs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ if ! git --version &> /dev/null ; then
1717
exit 1
1818
fi
1919

20+
if ! terraform -v &> /dev/null ; then
21+
printf "${RED}Terraform CLI not available.${NC} Psoxy examples / deployment scripts require it. See https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli\n"
22+
if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install terraform${NC}\n"; fi
23+
exit 1
24+
fi
25+
2026
if ! mvn -v &> /dev/null ; then
2127
printf "${RED}Maven not installed.${NC} See https://maven.apache.org/install.html\n"
2228
if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install maven${NC}\n"; fi
@@ -62,7 +68,7 @@ if ! gcloud --version &> /dev/null ; then
6268
printf "${RED}Google Cloud SDK is not installed.${NC} ${GCLOUD_REASON} See https://cloud.google.com/sdk/docs/install\n"
6369
if $HOMEBREW_AVAILABLE; then printf " or, as you have Homebrew available, run ${BLUE}brew install --cask google-cloud-sdk${NC}\n"; fi
6470
else
65-
printf "Google Cloud SDK version ${BLUE}`gcloud --version | head -n 1`${NC} is installed.\n"
71+
printf "Google Cloud SDK version ${BLUE}`gcloud --version 2> /dev/null | head -n 1`${NC} is installed.\n"
6672
printf "\t- make sure ${BLUE}gcloud auth list --filter=\"status:ACTIVE\"${NC} returns the account you expect. $GCLOUD_REASON\n"
6773
fi
6874

@@ -75,7 +81,5 @@ if ! az --version &> /dev/null ; then
7581
else
7682
# how can pipe to sed or something to strip extra whitespace out?
7783
printf "Azure CLI version ${BLUE}`az --version --only-show-errors | head -n 1`${NC} is installed.\n"
78-
printf "\t- make sure ${BLUE}az account show${NC} is the user/tenant you expect. $AZCLI_REASON\n"
84+
printf "\t- make sure ${BLUE}az account show${NC} is the user/tenant you expect. If not, ${BLUE}az login --allow-no-subscription${NC} to authenticate. $AZCLI_REASON\n"
7985
fi
80-
81-
# TODO: check auth aws, gcp, azure ??

main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ provider "azuread" {
5656
}
5757

5858
module "psoxy" {
59-
# source = "../psoxy/infra/modular-examples/aws"
60-
source = "git::https://github.com/worklytics/psoxy//infra/modular-examples/aws?ref=v0.4.17"
59+
# source = "../../modular-examples/aws"
60+
source = "git::https://github.com/worklytics/psoxy//infra/modular-examples/aws?ref=v0.4.18"
6161

6262
aws_account_id = var.aws_account_id
6363
aws_assume_role_arn = var.aws_assume_role_arn # role that can test the instances (lambdas)
@@ -71,6 +71,7 @@ module "psoxy" {
7171
non_production_connectors = var.non_production_connectors
7272
connector_display_name_suffix = var.connector_display_name_suffix
7373
custom_bulk_connectors = var.custom_bulk_connectors
74+
custom_rest_rules = var.custom_rest_rules
7475
lookup_table_builders = var.lookup_table_builders
7576
msft_tenant_id = var.msft_tenant_id
7677
msft_owners_email = var.msft_owners_email

terraform.tfvars.example.hcl

Lines changed: 0 additions & 21 deletions
This file was deleted.

variables.tf

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,12 @@ variable "general_environment_variables" {
130130
variable "pseudonymize_app_ids" {
131131
type = string
132132
description = "if set, will set value of PSEUDONYMIZE_APP_IDS environment variable to this value for all sources"
133-
default = false
133+
default = true
134134
}
135135

136136
variable "enabled_connectors" {
137137
type = list(string)
138138
description = "list of ids of connectors to enabled; see modules/worklytics-connector-specs"
139-
140-
default = [
141-
"azure-ad",
142-
"outlook-cal",
143-
"outlook-mail",
144-
"asana",
145-
"hris",
146-
"slack-discovery-api",
147-
"zoom",
148-
]
149139
}
150140

151141
variable "non_production_connectors" {
@@ -156,14 +146,20 @@ variable "non_production_connectors" {
156146

157147
variable "bulk_input_expiration_days" {
158148
type = number
159-
description = "**alpha** Number of days after which objects in the bucket will expire. This could be as low as 1 day; longer aids debugging of issues."
149+
description = "Number of days after which objects in the bucket will expire. This could be as low as 1 day; longer aids debugging of issues."
160150
default = 30
161151
}
162152

163153
variable "bulk_sanitized_expiration_days" {
164154
type = number
165-
description = "**alpha** Number of days after which objects in the bucket will expire. In practice, Worklytics syncs data ~weekly, so 30 day minimum for this value."
166-
default = 720
155+
description = "Number of days after which objects in the bucket will expire. In practice, Worklytics syncs data ~weekly, so 30 day minimum for this value."
156+
default = 1805 # 5 years; intent is 'forever', but some upperbound in case bucket is forgotten
157+
}
158+
159+
variable "custom_rest_rules" {
160+
type = map(string)
161+
description = "map of connector id --> YAML file with custom rules"
162+
default = {}
167163
}
168164

169165
variable "custom_bulk_connectors" {
@@ -235,4 +231,3 @@ variable "lookup_table_builders" {
235231
# }
236232
}
237233
}
238-

0 commit comments

Comments
 (0)