Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt testing/benchmark to okta-aws-cli #15512

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions testing/benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ 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

export AWS_PROFILE ?= elastic-observability

.default: all

Expand All @@ -54,17 +48,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 $(AWS_PROFILE) --write-aws-credentials
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use the elastic-okta-awscli - the only CLI available for some Elastic employees. The current elastic-observability should work with that tool.

We can sync up and discuss this if needed


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` AWS Account.

### ESS Credentials

Expand Down
Loading