Skip to content

Commit

Permalink
Attempt to adapt testing/benchmark to okta-aws-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Jan 31, 2025
1 parent dcb08ac commit 0db3739
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
21 changes: 2 additions & 19 deletions testing/benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ APM_SERVER_IP = $(shell terraform output -raw apm_server_ip)
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c

# This profile will also be used by the Terraform provider.

# export AWS_PROFILE if CI is not defined
ifeq ($(CI),)
export AWS_PROFILE ?= default
endif


.default: all

.PHONY: all
Expand All @@ -54,17 +46,8 @@ REPO_ROOT:=$(abspath ${MAKEFILE_DIR}/../../)
include ${MAKEFILE_DIR}/../../go.mk

.PHONY: auth
auth: init-aws-profile
@okta-awscli --profile $(AWS_PROFILE)

.PHONY: init-aws-profile
init-aws-profile: ~/.aws/credentials
@grep $(AWS_PROFILE) ~/.aws/credentials > /dev/null || \
echo "[$(AWS_PROFILE)]\naws_access_key_id = x\naws_secret_access_key = x" >> ~/.aws/credentials

~/.aws/credentials:
@mkdir -p ~/.aws
@touch $@
auth:
@$$(okta-aws-cli --profile elastic-observability) # this doesn't work

terraform.tfvars:
@sed "s/USER/$(USER)/" $(TFVARS_SOURCE) > terraform.tfvars
Expand Down
16 changes: 5 additions & 11 deletions testing/benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ credentials to run the benchmark against it.
- `scp`
- `jq`
- `go`
- `okta-awscli` (only for `all` and `auth` targets)
- `python3`
- `awscli`
- `okta-aws-cli` (only for `all` and `auth` targets)

## Credentials

To successfully use the this environment, you will need to have credentials for:
To successfully use this environment, you will need to have credentials for:

- An AWS account.
- ESS or self-serviced ECE environment API key (`EC_API_KEY` environment variable).
Expand All @@ -30,14 +28,10 @@ To successfully use the this environment, you will need to have credentials for:

In order to facilitate self-service of this environment without assuming the consumer
has the AWS credentials up to date, the `make all` (default target) and `make auth`
uses `okta-awscli` to generate the necessary credentials in `~/.aws/credentials`.
For more information on how to set up these, please refer to our [internal docs](https://github.com/elastic/observability-dev/blob/main/environments/ecetest/README.md#okta-aws-cli-setup).
uses `okta-aws-cli` to generate the necessary credentials in `~/.aws/credentials`.
For more information on how to set up these, please refer to our [internal docs](https://github.com/elastic/observability-dev/blob/main/docs/how-we-work/aws-onboarding.md).

It isn't a requirement to use `okta-awscli`, and your own credentials can be used
as long as they are provided in `~/.aws/credentials` under the `default` profile.

If you want to use a different profile, you can set the `AWS_PROFILE` make variable
to a different value.
It is required to use `okta-aws-cli` for programmatic access to `elastic-observability`.

### ESS Credentials

Expand Down

0 comments on commit 0db3739

Please sign in to comment.