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

Secrets and vpcs #37

Merged
merged 7 commits into from
Mar 7, 2024
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
.DS_Store
docs
inst/doc
tests/fixtures/aws_db_rds_create.yml
tests/fixtures/aws_db_redshift_create.yml
tests/fixtures/aws_secret*.yml
tests/fixtures/aws_db_rds_create.yml
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ Imports:
s3fs (>= 0.1.3),
cli,
glue,
memoise
memoise,
uuid,
jsonlite,
curl
Suggests:
knitr,
rmarkdown,
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ style_file:

style_package:
${RSCRIPT} -e "styler::style_pkg()"

scan_secrets:
@echo "scanning for leaks in commits\n"
gitleaks detect --source . -v
@echo "\n\n\n"
@echo "scanning for leaks in uncommitted files\n"
gitleaks protect --source . -v
24 changes: 24 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export(aws_db_rds_create)
export(aws_db_redshift_client)
export(aws_db_redshift_con)
export(aws_db_redshift_create)
export(aws_ec2_client)
export(aws_file_attr)
export(aws_file_copy)
export(aws_file_delete)
Expand All @@ -39,6 +40,14 @@ export(aws_role)
export(aws_role_create)
export(aws_role_delete)
export(aws_roles)
export(aws_secrets_all)
export(aws_secrets_create)
export(aws_secrets_delete)
export(aws_secrets_get)
export(aws_secrets_list)
export(aws_secrets_pwd)
export(aws_secrets_rotate)
export(aws_secrets_update)
export(aws_user)
export(aws_user_access_key)
export(aws_user_add_to_group)
Expand All @@ -47,20 +56,33 @@ export(aws_user_current)
export(aws_user_delete)
export(aws_user_exists)
export(aws_users)
export(aws_vpc)
export(aws_vpc_sec_group_rules)
export(aws_vpc_security_group)
export(aws_vpc_security_group_create)
export(aws_vpc_security_group_ingress)
export(aws_vpc_security_groups)
export(aws_vpcs)
export(billing)
export(ip_permissions_generator)
export(s3_path)
export(set_s3_interface)
importFrom(cli,cli_inform)
importFrom(cli,cli_progress_bar)
importFrom(cli,cli_progress_update)
importFrom(cli,pb_spin)
importFrom(curl,curl_fetch_memory)
importFrom(dplyr,bind_rows)
importFrom(dplyr,filter)
importFrom(dplyr,last_col)
importFrom(dplyr,mutate)
importFrom(dplyr,pull)
importFrom(dplyr,relocate)
importFrom(fs,file_exists)
importFrom(fs,fs_bytes)
importFrom(glue,glue)
importFrom(jsonlite,fromJSON)
importFrom(jsonlite,toJSON)
importFrom(lubridate,as_datetime)
importFrom(magrittr,"%>%")
importFrom(paws,costexplorer)
Expand All @@ -72,6 +94,8 @@ importFrom(purrr,flatten)
importFrom(purrr,list_rbind)
importFrom(purrr,map)
importFrom(purrr,map_chr)
importFrom(purrr,map_lgl)
importFrom(purrr,pluck)
importFrom(rlang,":=")
importFrom(rlang,has_name)
importFrom(s3fs,s3_dir_info)
Expand Down
10 changes: 10 additions & 0 deletions R/ec2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#' Get the `paws` EC2 client - primarily for usage of VPC security groups
#' @export
#' @note returns existing client if found; a new client otherwise
#' @family security groups
#' @return a list with methods for interfacing with EC2;
#' see <https://www.paws-r-sdk.com/docs/ec2/>
aws_ec2_client <- function() {
if (is.null(env64$ec2)) env64$ec2 <- paws::ec2()
return(env64$ec2)
}
6 changes: 6 additions & 0 deletions R/globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ utils::globalVariables(c(
"PolicyName", # <as_policy_arn>
"Arn", # <as_policy_arn>
".", # <aws_role>
".", # <aws_secrets_all>
"arn", # <aws_secrets_all>
"created_date", # <aws_secrets_all>
"secret_raw", # <aws_secrets_rotate>
"secret_str", # <aws_secrets_rotate>
"PasswordLastUsed", # <user_list_tidy>
"CreateDate", # <tidy_generator>
"IpPermissions", # <security_group_handler>
NULL
))
1 change: 1 addition & 0 deletions R/onload.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ env64 <- new.env()
# iam and costexplorer services
env64$iam <- paws::iam()
env64$costexplorer <- paws::costexplorer()
env64$secretsmanager <- paws::secretsmanager()
}
Loading
Loading