├── .github └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── docs ├── _index.md └── filters.md ├── scripts ├── awsinfo.bash ├── combine_calls.py ├── command_example │ ├── command.bash │ └── command.md ├── commands │ ├── acm │ │ ├── certificate.bash │ │ ├── certificate.md │ │ ├── index.bash │ │ └── index.md │ ├── apigateway │ │ ├── account.bash │ │ ├── account.md │ │ ├── api-keys.bash │ │ ├── api-keys.md │ │ ├── authorizers.bash │ │ ├── authorizers.md │ │ ├── base-path-mappings.bash │ │ ├── base-path-mappings.md │ │ ├── client-certificates.bash │ │ ├── client-certificates.md │ │ ├── deployment.bash │ │ ├── deployment.md │ │ ├── deployments.bash │ │ ├── deployments.md │ │ ├── domain-names.bash │ │ ├── domain-names.md │ │ ├── gateway-responses.bash │ │ ├── gateway-responses.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── integration-response.bash │ │ ├── integration-response.md │ │ ├── integration.bash │ │ ├── integration.md │ │ ├── method-response.bash │ │ ├── method-response.md │ │ ├── method.bash │ │ ├── method.md │ │ ├── model-schema.bash │ │ ├── model-schema.md │ │ ├── models.bash │ │ ├── models.md │ │ ├── resource.bash │ │ ├── resource.md │ │ ├── resource.sh │ │ ├── resources.bash │ │ ├── resources.md │ │ ├── rest-apis.sh │ │ ├── stage.bash │ │ ├── stage.md │ │ ├── stages.bash │ │ └── stages.md │ ├── apigatewayv2 │ │ ├── api.bash │ │ ├── api.md │ │ ├── apis.sh │ │ ├── authorizers.bash │ │ ├── authorizers.md │ │ ├── deployment.bash │ │ ├── deployment.md │ │ ├── deployments.bash │ │ ├── deployments.md │ │ ├── domain-names.bash │ │ ├── domain-names.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── integration-responses.bash │ │ ├── integration-responses.md │ │ ├── integration.bash │ │ ├── integration.md │ │ ├── integrations.bash │ │ ├── integrations.md │ │ ├── model-schema.bash │ │ ├── model-schema.md │ │ ├── models.bash │ │ ├── models.md │ │ ├── route-responses.bash │ │ ├── route-responses.md │ │ ├── route.bash │ │ ├── route.md │ │ ├── routes.bash │ │ ├── routes.md │ │ ├── stage.bash │ │ ├── stage.md │ │ ├── stages.bash │ │ └── stages.md │ ├── appautoscaling │ │ ├── index.bash │ │ ├── index.md │ │ ├── policies.bash │ │ ├── policies.md │ │ ├── policy.bash │ │ ├── policy.md │ │ ├── schedules.bash │ │ ├── schedules.md │ │ ├── service_namespace.sh │ │ ├── targets.bash │ │ └── targets.md │ ├── appsync │ │ ├── datasources.bash │ │ ├── datasources.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── resolvers.bash │ │ ├── resolvers.md │ │ ├── schema.bash │ │ ├── schema.md │ │ ├── types.bash │ │ └── types.md │ ├── assume │ │ ├── index.bash │ │ ├── index.md │ │ ├── role.bash │ │ ├── role.md │ │ ├── token.bash │ │ └── token.md │ ├── autoscaling │ │ ├── group.bash │ │ ├── group.md │ │ ├── index.bash │ │ └── index.md │ ├── batch │ │ ├── compute-environment.bash │ │ ├── compute-environment.md │ │ ├── compute-environments.bash │ │ ├── compute-environments.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── job-queues.bash │ │ ├── job-queues.md │ │ ├── jobs.bash │ │ └── jobs.md │ ├── budgets │ │ ├── budget.bash │ │ ├── budget.md │ │ ├── index.bash │ │ └── index.md │ ├── cloudformation │ │ ├── change-set.bash │ │ ├── change-set.md │ │ ├── change-sets.bash │ │ ├── change-sets.md │ │ ├── events.bash │ │ ├── events.md │ │ ├── exports.bash │ │ ├── exports.md │ │ ├── imports.bash │ │ ├── imports.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── outputs.bash │ │ ├── outputs.md │ │ ├── policy.bash │ │ ├── policy.md │ │ ├── resources.bash │ │ ├── resources.md │ │ ├── stack-set-instances.bash │ │ ├── stack-set-instances.md │ │ ├── stack-set-operations.bash │ │ ├── stack-set-operations.md │ │ ├── stack-set-template.bash │ │ ├── stack-set-template.md │ │ ├── stack-set.bash │ │ ├── stack-set.md │ │ ├── stack-sets.bash │ │ ├── stack-sets.md │ │ ├── stack.bash │ │ ├── stack.md │ │ ├── template.bash │ │ └── template.md │ ├── cloudfront │ │ ├── distribution.bash │ │ ├── distribution.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── origins.bash │ │ └── origins.md │ ├── cloudwatch │ │ ├── alarms.bash │ │ └── alarms.md │ ├── codebuild │ │ ├── build-reports.bash │ │ ├── build-reports.md │ │ ├── build-status.bash │ │ ├── build-status.md │ │ ├── build.bash │ │ ├── build.md │ │ ├── build_selection.sh │ │ ├── builds.bash │ │ ├── builds.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── report-groups.bash │ │ ├── report-groups.md │ │ ├── report.bash │ │ ├── report.md │ │ ├── reports.bash │ │ └── reports.md │ ├── codecommit │ │ ├── branches.bash │ │ ├── branches.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── pull-request.bash │ │ ├── pull-request.md │ │ ├── pull-requests.bash │ │ ├── pull-requests.md │ │ ├── pull_requests_shared.sh │ │ ├── repository.bash │ │ └── repository.md │ ├── codepipeline │ │ ├── action-executions.bash │ │ ├── action-executions.md │ │ ├── actions.bash │ │ ├── actions.md │ │ ├── execution.bash │ │ ├── execution.md │ │ ├── executions.bash │ │ ├── executions.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── stage.bash │ │ ├── stage.md │ │ ├── state.bash │ │ └── state.md │ ├── cognito │ │ ├── clients.bash │ │ ├── clients.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── users.bash │ │ └── users.md │ ├── commands │ │ ├── index.bash │ │ └── index.md │ ├── complete │ │ ├── index.bash │ │ ├── index.md │ │ ├── zsh.bash │ │ └── zsh.md │ ├── costs │ │ ├── accounts.bash │ │ ├── accounts.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── service.bash │ │ ├── service.md │ │ ├── services.bash │ │ ├── services.md │ │ ├── usage.bash │ │ └── usage.md │ ├── credentials │ │ ├── index.bash │ │ └── index.md │ ├── dynamodb │ │ ├── index.bash │ │ ├── index.md │ │ ├── table.bash │ │ └── table.md │ ├── ec2 │ │ ├── images.bash │ │ ├── images.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── instance.bash │ │ ├── instance.md │ │ ├── keys.bash │ │ ├── keys.md │ │ └── terminated-instances.sh │ ├── ecr │ │ ├── images.bash │ │ ├── images.md │ │ ├── index.bash │ │ └── index.md │ ├── ecs │ │ ├── cluster.bash │ │ ├── cluster.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── instance.bash │ │ ├── instance.md │ │ ├── instances.bash │ │ ├── instances.md │ │ ├── service-events.bash │ │ ├── service-events.md │ │ ├── service.bash │ │ ├── service.md │ │ ├── services.bash │ │ ├── services.md │ │ ├── task-definition.bash │ │ ├── task-definition.md │ │ ├── task-definitions.bash │ │ ├── task-definitions.md │ │ ├── task-families.bash │ │ ├── task-families.md │ │ ├── task.bash │ │ ├── task.md │ │ ├── tasks.bash │ │ └── tasks.md │ ├── efs │ │ ├── file-system.bash │ │ ├── file-system.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── mount-targets.bash │ │ ├── mount-targets.md │ │ ├── security-groups.bash │ │ └── security-groups.md │ ├── elasticbeanstalk │ │ ├── applications.bash │ │ ├── applications.md │ │ ├── events.bash │ │ ├── events.md │ │ ├── health.bash │ │ ├── health.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── instances.bash │ │ ├── instances.md │ │ ├── stacks.bash │ │ ├── stacks.md │ │ ├── versions.bash │ │ └── versions.md │ ├── elb │ │ ├── attributes.bash │ │ ├── attributes.md │ │ ├── classic.bash │ │ ├── classic.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── listener-certificates.bash │ │ ├── listener-certificates.md │ │ ├── listener.bash │ │ ├── listener.md │ │ ├── listeners.bash │ │ ├── listeners.md │ │ ├── loadbalancer_filter.sh │ │ ├── rules.bash │ │ ├── rules.md │ │ ├── target-group.bash │ │ ├── target-group.md │ │ ├── target-groups.bash │ │ ├── target-groups.md │ │ ├── targets.bash │ │ └── targets.md │ ├── es │ │ ├── domain.bash │ │ ├── domain.md │ │ ├── index.bash │ │ └── index.md │ ├── events │ │ ├── bus-policy.bash │ │ ├── bus-policy.md │ │ ├── buses.bash │ │ ├── buses.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── targets.bash │ │ └── targets.md │ ├── firehose │ │ ├── index.bash │ │ ├── index.md │ │ ├── stream.bash │ │ └── stream.md │ ├── iam │ │ ├── attached-group-policies.bash │ │ ├── attached-group-policies.md │ │ ├── attached-role-policies.bash │ │ ├── attached-role-policies.md │ │ ├── attached-user-policies.bash │ │ ├── attached-user-policies.md │ │ ├── aws-policies.bash │ │ ├── aws-policies.md │ │ ├── group-policies.bash │ │ ├── group-policies.md │ │ ├── group-policy.bash │ │ ├── group-policy.md │ │ ├── groups.bash │ │ ├── groups.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── instance-profiles.bash │ │ ├── instance-profiles.md │ │ ├── keys-last-used.bash │ │ ├── keys-last-used.md │ │ ├── keys.bash │ │ ├── keys.md │ │ ├── mfa.bash │ │ ├── mfa.md │ │ ├── password-policy.bash │ │ ├── password-policy.md │ │ ├── policies.bash │ │ ├── policies.md │ │ ├── policy-version.bash │ │ ├── policy-version.md │ │ ├── role-permissions.bash │ │ ├── role-permissions.md │ │ ├── role-policies.bash │ │ ├── role-policies.md │ │ ├── role-policy.bash │ │ ├── role-policy.md │ │ ├── role.bash │ │ ├── role.md │ │ ├── roles.bash │ │ ├── roles.md │ │ ├── saml-provider.bash │ │ ├── saml-provider.md │ │ ├── saml-providers.bash │ │ ├── saml-providers.md │ │ ├── user-policies.bash │ │ ├── user-policies.md │ │ ├── user-policy.bash │ │ ├── user-policy.md │ │ ├── user.bash │ │ ├── user.md │ │ ├── users.bash │ │ └── users.md │ ├── kms │ │ ├── aliases.bash │ │ ├── aliases.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── policies.bash │ │ ├── policies.md │ │ ├── policy.bash │ │ └── policy.md │ ├── lambda │ │ ├── code.bash │ │ ├── code.md │ │ ├── function.bash │ │ ├── function.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── versions.bash │ │ └── versions.md │ ├── logs │ │ ├── export-tasks.bash │ │ ├── export-tasks.md │ │ ├── groups.bash │ │ ├── groups.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── streams.bash │ │ └── streams.md │ ├── me │ │ ├── index.bash │ │ └── index.md │ ├── orgs │ │ ├── index.bash │ │ └── index.md │ ├── rds │ │ ├── cluster.bash │ │ ├── cluster.md │ │ ├── clusters.bash │ │ ├── clusters.md │ │ ├── engine-versions.bash │ │ ├── engine-versions.md │ │ ├── events.bash │ │ ├── events.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── instance.bash │ │ └── instance.md │ ├── route53 │ │ ├── index.bash │ │ ├── index.md │ │ ├── records.bash │ │ └── records.md │ ├── s3 │ │ ├── acl.bash │ │ ├── acl.md │ │ ├── bucket_listing.sh │ │ ├── content.bash │ │ ├── content.md │ │ ├── encryption.bash │ │ ├── encryption.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── lifecycle.bash │ │ ├── lifecycle.md │ │ ├── location.bash │ │ ├── location.md │ │ ├── notifications.bash │ │ ├── notifications.md │ │ ├── objects.bash │ │ ├── objects.md │ │ ├── policy.bash │ │ ├── policy.md │ │ ├── website.bash │ │ └── website.md │ ├── secretsmanager │ │ ├── index.bash │ │ ├── index.md │ │ ├── policy.bash │ │ ├── policy.md │ │ ├── secret.bash │ │ ├── secret.md │ │ ├── value.bash │ │ └── value.md │ ├── ses │ │ ├── index.bash │ │ └── index.md │ ├── sns │ │ ├── index.bash │ │ ├── index.md │ │ ├── policy.bash │ │ ├── policy.md │ │ ├── subscriptions.bash │ │ └── subscriptions.md │ ├── sqs │ │ ├── index.bash │ │ └── index.md │ ├── ssm │ │ ├── index.bash │ │ ├── index.md │ │ ├── instance-associations.bash │ │ ├── instance-associations.md │ │ ├── parameter.bash │ │ ├── parameter.md │ │ ├── parameters.bash │ │ ├── parameters.md │ │ ├── session.bash │ │ └── session.md │ └── vpc │ │ ├── endpoint.bash │ │ ├── endpoint.md │ │ ├── endpoints-available.bash │ │ ├── endpoints-available.md │ │ ├── endpoints.bash │ │ ├── endpoints.md │ │ ├── index.bash │ │ ├── index.md │ │ ├── internet-gateway.bash │ │ ├── internet-gateway.md │ │ ├── internet-gateways.bash │ │ ├── internet-gateways.md │ │ ├── nat-gateways.bash │ │ ├── nat-gateways.md │ │ ├── network-acl.bash │ │ ├── network-acl.md │ │ ├── network-acls.bash │ │ ├── network-acls.md │ │ ├── network-interface.bash │ │ ├── network-interface.md │ │ ├── network-interfaces.bash │ │ ├── network-interfaces.md │ │ ├── peering-connections.bash │ │ ├── peering-connections.md │ │ ├── route-table.bash │ │ ├── route-table.md │ │ ├── route-tables.bash │ │ ├── route-tables.md │ │ ├── security-group.bash │ │ ├── security-group.md │ │ ├── security-groups.bash │ │ ├── security-groups.md │ │ ├── subnet.bash │ │ ├── subnet.md │ │ ├── subnets.bash │ │ └── subnets.md ├── complete.py ├── complete_zsh.py ├── header.txt └── helpers │ ├── arguments.bash │ ├── awscli.bash │ ├── colors.bash │ ├── common.bash │ ├── date.bash │ ├── filters.bash │ └── functions.bash ├── stacks ├── dynamodb │ └── dynamodb.template.yml ├── elasticbeanstalk │ ├── eb.template.yml │ └── stack.config.yml ├── iam │ ├── iam.template.yaml │ └── stack.config.yml ├── lambda │ ├── code.py │ ├── lambda.template.yaml │ └── stack.config.yml ├── rds │ ├── rds.template.yml │ └── stack.config.yml └── route53 │ ├── route53.template.yml │ └── stack.config.yml └── tests ├── awsinfo.bash ├── commands ├── awsinfo.bats ├── cfn │ ├── cfn.template.yml │ └── index.bats └── logs │ ├── groups.bats │ ├── index.bats │ └── logs.template.yml ├── integration-user.template.yml └── stack.config.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests/test-helpers/bats"] 2 | path = tests/test-helpers/bats 3 | url = https://github.com/sstephenson/bats 4 | [submodule "tests/test-helpers/bats-assert"] 5 | path = tests/test-helpers/bats-assert 6 | url = https://github.com/ztombol/bats-assert 7 | [submodule "tests/test-helpers/bats-support"] 8 | path = tests/test-helpers/bats-support 9 | url = https://github.com/ztombol/bats-support 10 | -------------------------------------------------------------------------------- /scripts/command_example/command.md: -------------------------------------------------------------------------------- 1 | # `awsinfo SERVICE COMMAND [first-filters]+ -- [second-filters]*` 2 | 3 | Give an overview description of the command here 4 | 5 | ## Options 6 | 7 | * `-s`: Some 8 | * `-f`: Option 9 | 10 | ## First Filter matches against 11 | 12 | * Attribute1 13 | * Attribute2 14 | 15 | ## Second Filter matches against 16 | 17 | * Attribute1 18 | * Attribute2 19 | 20 | # `awsinfo SERVICE COMMAND [filters]+` 21 | 22 | Give an overview description of the command here 23 | 24 | ## Filter matches against 25 | 26 | * Attribute1 27 | * Attribute2 28 | -------------------------------------------------------------------------------- /scripts/commands/acm/certificate.bash: -------------------------------------------------------------------------------- 1 | CERTIFICATE_LIST=$(awscli acm list-certificates --output text --query "CertificateSummaryList[$(auto_filter_joined DomainName CertificateArn -- "$@")].[CertificateArn]") 2 | 3 | select_one Certificate "$CERTIFICATE_LIST" 4 | 5 | awscli acm describe-certificate --certificate-arn "$SELECTED" --output table --query "Certificate" -------------------------------------------------------------------------------- /scripts/commands/acm/certificate.md: -------------------------------------------------------------------------------- 1 | # `awsinfo acm certificate [filters]*` 2 | 3 | Describe an ACM Certificate with all details. 4 | 5 | ## Filter matches against 6 | 7 | * DomainName 8 | * CertificateArn 9 | -------------------------------------------------------------------------------- /scripts/commands/acm/index.bash: -------------------------------------------------------------------------------- 1 | awscli acm list-certificates --output table --query "CertificateSummaryList[$(auto_filter_joined DomainName -- "$@")].{\"1.Domain\":DomainName,\"2.Arn\":CertificateArn}" -------------------------------------------------------------------------------- /scripts/commands/acm/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo acm [substrings]*` 2 | 3 | List all ACM certificates, with their `Domain` and `Arn`. 4 | If `substrings` are given it will only print certificates where the `Domain` contains all `substrings`. 5 | 6 | ## Examples: 7 | 8 | * ```awsinfo acm .io``` for all `.io` Domains. 9 | * ```awsinfo acm example.com``` for the example.com domain (and all its subdomain certificates) 10 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/account.bash: -------------------------------------------------------------------------------- 1 | awscli apigateway get-account --output table -------------------------------------------------------------------------------- /scripts/commands/apigateway/account.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway account` 2 | 3 | Show Account details for APIGateway like Limits. -------------------------------------------------------------------------------- /scripts/commands/apigateway/api-keys.bash: -------------------------------------------------------------------------------- 1 | awscli apigateway get-api-keys --output table --query "sort_by(items,&name)[$(auto_filter_joined name description id -- "$@")]" -------------------------------------------------------------------------------- /scripts/commands/apigateway/api-keys.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway api-keys [filters]+` 2 | 3 | List all available Apigatewa API Keys. 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Description 9 | * Id 10 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/authorizers.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined name authorizerUri identitySource type id -- "$SECOND_RESOURCE") 4 | 5 | awscli apigateway get-authorizers --rest-api-id "$SELECTED" --output table --query "sort_by(items,&name)[$FILTER].{ 6 | \"1.Id\":Id, 7 | \"2.Name\":name, 8 | \"3.IdentitySource\":identitySource, 9 | \"4.Type\":type, 10 | \"5.TTL\":authorizerResultTtlInSeconds, 11 | \"6.Uri\":authorizerUri}" 12 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/authorizers.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway authorizers [first-filters]+ -- [second-filters]*` 2 | 3 | List all Authorzers for a Rest API 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * Name 14 | * AuthorizerUri 15 | * IdentitySource 16 | * Type 17 | * Id 18 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/base-path-mappings.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | DOMAIN_NAMES=$(awscli apigateway get-domain-names --output text --query "items[$(auto_filter_joined domainName -- "$FIRST_RESOURCE")].[domainName]") 4 | select_one DomainName "$DOMAIN_NAMES" 5 | 6 | awscli apigateway get-base-path-mappings --domain-name "$SELECTED" --output table --query "items[$(auto_filter_joined basePath restApiId stage -- "$SECOND_RESOURCE")]" -------------------------------------------------------------------------------- /scripts/commands/apigateway/base-path-mappings.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway base-path-mappings [first-filters]+ -- [second-filters]*` 2 | 3 | List all Base Path Mappings for a Domain 4 | 5 | ## First Filter matches against 6 | 7 | * DomainName 8 | 9 | ## Second Filter matches against 10 | 11 | * BasePath 12 | * RestApiId 13 | * Stage 14 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/client-certificates.bash: -------------------------------------------------------------------------------- 1 | awscli apigateway get-client-certificates --output table --query "items[$(auto_filter_joined clientCertificateId description -- "$@")].{ 2 | \"1.Id\":clientCertificateId, 3 | \"2.Description\":description, 4 | \"3.CreatedAt\": createdDate, 5 | \"4.ExpiresAt\":expirationDate}" 6 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/client-certificates.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway client-certificates [filters]+` 2 | 3 | List all Client Certificates 4 | 5 | ## Filter matches against 6 | 7 | * ClientCertificateId 8 | * Description 9 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/deployment.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined description id -- "$SECOND_RESOURCE") 4 | 5 | DEPLOYMENTS_LIST=$(awscli apigateway get-deployments --rest-api-id "$SELECTED" --output text --query "items[$FILTER].[id]") 6 | 7 | select_one Deployment $DEPLOYMENTS_LIST 8 | 9 | awscli apigateway get-deployment --rest-api-id "$SELECTED_REST_API" --deployment-id "$SELECTED" --output table --embed apisummary -------------------------------------------------------------------------------- /scripts/commands/apigateway/deployment.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway deployment [first-filters]+ -- [second-filters]*` 2 | 3 | Get all details for a Deployment 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * Id 14 | * Description 15 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/deployments.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined description id -- "$SECOND_RESOURCE") 4 | 5 | awscli apigateway get-deployments --rest-api-id "$SELECTED" --output table --query "items[$FILTER].{ 6 | \"1.Id\":id, 7 | \"2.Description\":description||'', 8 | \"3.CreatedDate\":createdDate}" 9 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/deployments.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway deployments [first-filters]+ -- [second-filters]*` 2 | 3 | List all Deployments for a Rest API 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * Id 14 | * Description 15 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/domain-names.bash: -------------------------------------------------------------------------------- 1 | awscli apigateway get-domain-names --output table --query "sort_by(items,&domainName)[$(auto_filter_joined domainName -- "$@")].{ 2 | \"1.Name\":domainName, 3 | \"2.RegionalDomainName\":regionalDomainName, 4 | \"3.Endpoint\": join(',', endpointConfiguration.types||[]), 5 | \"4.Status\":domainNameStatus, 6 | \"5.SecurityPolicy\":securityPolicy}" -------------------------------------------------------------------------------- /scripts/commands/apigateway/domain-names.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway domain-names [filters]+` 2 | 3 | List all Domain Names 4 | 5 | ## Filter matches against 6 | 7 | * DomainName 8 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/gateway-responses.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined responseType statusCode "to_string(defaultResponse)" -- "$SECOND_RESOURCE") 4 | 5 | awscli apigateway get-gateway-responses --rest-api-id $SELECTED_REST_API --output table --query "sort_by(items,&to_string(statusCode))[$FILTER]" -------------------------------------------------------------------------------- /scripts/commands/apigateway/gateway-responses.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway gateway-responses [first-filters]+ -- [second-filters]*` 2 | 3 | List all Gateway Responses for a Rest API 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * ResponseType 14 | * StatusCode 15 | * DefaultResponse -------------------------------------------------------------------------------- /scripts/commands/apigateway/index.bash: -------------------------------------------------------------------------------- 1 | # Example of a Simple Command 2 | 3 | FILTER=$(auto_filter_joined id name "join('',endpointConfiguration.types)" -- "$@") 4 | awscli apigateway get-rest-apis --output table --query "sort_by(items,&name)[$FILTER].{ 5 | \"1.Name\":name, 6 | \"2.Id\":id, 7 | \"3.Description\": description, 8 | \"4.Created\":createdDate, 9 | \"5.APIKeySource\":apiKeySource, 10 | \"6.EndpointTypes\":join('',endpointConfiguration.types)}" -------------------------------------------------------------------------------- /scripts/commands/apigateway/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway [filters]+` 2 | 3 | List the API Gateway Rest APIs 4 | 5 | ## Filter matches against 6 | 7 | * Id 8 | * Name 9 | * Endpoint Type 10 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/integration-response.bash: -------------------------------------------------------------------------------- 1 | HTTP_REQUEST_METHOD="GET" 2 | HTTP_STATUS_CODE="200" 3 | 4 | while getopts "m:s:" opt; do 5 | case "$opt" in 6 | m) HTTP_REQUEST_METHOD="$OPTARG" ;; 7 | s) HTTP_STATUS_CODE="$OPTARG" ;; 8 | *) echo "Unsupported Flag" && exit 1 9 | esac 10 | done 11 | shift $(($OPTIND-1)) 12 | 13 | source $CURRENT_COMMAND_DIR/resource.sh 14 | 15 | echosuccess "Selected HTTPMethod $HTTP_REQUEST_METHOD" 16 | 17 | awscli apigateway get-integration-response --rest-api-id "$SELECTED_REST_API" --resource-id "$SELECTED" --http-method "$HTTP_REQUEST_METHOD" --status-code "$HTTP_STATUS_CODE" --output table -------------------------------------------------------------------------------- /scripts/commands/apigateway/integration-response.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway integration-response [first-filters]+ -- [second-filters]*` 2 | 3 | Describe an Integration Response for a Resource in a Rest API defined by the HTTP Method and Status 4 | 5 | ## Options 6 | 7 | * `-m`: HTTP Method. Default GET 8 | * `-s`: HTTP Status. Default 200 9 | 10 | ## First Filter matches against 11 | 12 | * Id 13 | * Name 14 | * EndpointConfigurationType 15 | 16 | ## Second Filter matches against 17 | 18 | * Path 19 | * Id 20 | * ParentId 21 | * ResourceMethods -------------------------------------------------------------------------------- /scripts/commands/apigateway/integration.bash: -------------------------------------------------------------------------------- 1 | HTTP_REQUEST_METHOD="GET" 2 | 3 | while getopts "m:" opt; do 4 | case "$opt" in 5 | m) HTTP_REQUEST_METHOD="$OPTARG" ;; 6 | *) echo "Unsupported Flag" && exit 1 7 | esac 8 | done 9 | shift $(($OPTIND-1)) 10 | 11 | source $CURRENT_COMMAND_DIR/resource.sh 12 | 13 | echosuccess "Selected HTTPMethod $HTTP_REQUEST_METHOD" 14 | 15 | awscli apigateway get-integration --rest-api-id $SELECTED_REST_API --resource-id "$SELECTED" --http-method $HTTP_REQUEST_METHOD --output table -------------------------------------------------------------------------------- /scripts/commands/apigateway/integration.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway integration [first-filters]+ -- [second-filters]*` 2 | 3 | Describe an Integration for a Resource in a Rest API 4 | 5 | ## Options 6 | 7 | * `-m`: HTTP Method. Default GET 8 | 9 | ## First Filter matches against 10 | 11 | * Id 12 | * Name 13 | * EndpointConfigurationType 14 | 15 | ## Second Filter matches against 16 | 17 | * Path 18 | * Id 19 | * ParentId 20 | * ResourceMethods -------------------------------------------------------------------------------- /scripts/commands/apigateway/method-response.bash: -------------------------------------------------------------------------------- 1 | HTTP_REQUEST_METHOD="GET" 2 | HTTP_STATUS_CODE="200" 3 | 4 | while getopts "m:s:" opt; do 5 | case "$opt" in 6 | m) HTTP_REQUEST_METHOD="$OPTARG" ;; 7 | s) HTTP_STATUS_CODE="$OPTARG" ;; 8 | *) echo "Unsupported Flag" && exit 1 9 | esac 10 | done 11 | shift $(($OPTIND-1)) 12 | 13 | source $CURRENT_COMMAND_DIR/resource.sh 14 | 15 | echosuccess "Selected HTTPMethod $HTTP_REQUEST_METHOD" 16 | 17 | awscli apigateway get-method-response --rest-api-id "$SELECTED_REST_API" --resource-id "$SELECTED" --http-method "$HTTP_REQUEST_METHOD" --status-code "$HTTP_STATUS_CODE" --output table -------------------------------------------------------------------------------- /scripts/commands/apigateway/method-response.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway method-response [first-filters]+ -- [second-filters]*` 2 | 3 | Describe a Method Response for a Resource in a Rest API defined by the HTTP Method and Status 4 | 5 | ## Options 6 | 7 | * `-m`: HTTP Method. Default GET 8 | * `-s`: HTTP Status. Default 200 9 | 10 | ## First Filter matches against 11 | 12 | * Id 13 | * Name 14 | * EndpointConfigurationType 15 | 16 | ## Second Filter matches against 17 | 18 | * Path 19 | * Id 20 | * ParentId 21 | * ResourceMethods -------------------------------------------------------------------------------- /scripts/commands/apigateway/method.bash: -------------------------------------------------------------------------------- 1 | HTTP_REQUEST_METHOD="GET" 2 | 3 | while getopts "m:" opt; do 4 | case "$opt" in 5 | m) HTTP_REQUEST_METHOD="$OPTARG" ;; 6 | *) echo "Unsupported Flag" && exit 1 7 | esac 8 | done 9 | shift $(($OPTIND-1)) 10 | 11 | source $CURRENT_COMMAND_DIR/resource.sh 12 | 13 | echosuccess "Selected HTTPMethod $HTTP_REQUEST_METHOD" 14 | 15 | awscli apigateway get-method --rest-api-id $SELECTED_REST_API --resource-id "$SELECTED" --http-method $HTTP_REQUEST_METHOD --output table -------------------------------------------------------------------------------- /scripts/commands/apigateway/method.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway method [first-filters]+ -- [second-filters]*` 2 | 3 | Describe a Method for a Resource in a Rest API 4 | 5 | ## Options 6 | 7 | * `-m`: HTTP Method. Default GET 8 | 9 | ## First Filter matches against 10 | 11 | * Id 12 | * Name 13 | * EndpointConfigurationType 14 | 15 | ## Second Filter matches against 16 | 17 | * Path 18 | * Id 19 | * ParentId 20 | * ResourceMethods -------------------------------------------------------------------------------- /scripts/commands/apigateway/model-schema.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined id name description contentType -- "$SECOND_RESOURCE") 4 | 5 | MODELS_LIST=$(awscli apigateway get-models --rest-api-id "$SELECTED" --output text --query "items[$FILTER].[name]") 6 | 7 | select_one Model "$MODELS_LIST" 8 | 9 | awscli apigateway get-model --rest-api-id "$SELECTED_REST_API" --model-name "$SELECTED" --output text --query schema -------------------------------------------------------------------------------- /scripts/commands/apigateway/model-schema.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway model-schema [first-filters]+ -- [second-filters]*` 2 | 3 | Show the Schema of a particular Model. 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * Id 14 | * Name 15 | * Description 16 | * ContentType -------------------------------------------------------------------------------- /scripts/commands/apigateway/models.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined id name description contentType -- "$SECOND_RESOURCE") 4 | 5 | awscli apigateway get-models --rest-api-id "$SELECTED" --output table --query "items[$FILTER].{ 6 | \"1.Id\":id, 7 | \"2.Name\":name, 8 | \"3.Description\":description, 9 | \"4.ContentType\":contentType}" 10 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/models.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway models [first-filters]+ -- [second-filters]*` 2 | 3 | List all Models 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * Id 14 | * Name 15 | * Description 16 | * ContentType -------------------------------------------------------------------------------- /scripts/commands/apigateway/resource.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined path id parentId -- "$SECOND_RESOURCE") 4 | RESOURCE_LIST=$(awscli apigateway get-resources --rest-api-id "$SELECTED" --output text --query "sort_by(items,&path)[$FILTER].[id]") 5 | 6 | select_one Resource $RESOURCE_LIST 7 | 8 | awscli apigateway get-resource --rest-api-id $SELECTED_REST_API --resource-id "$SELECTED" --output table --embed methods -------------------------------------------------------------------------------- /scripts/commands/apigateway/resource.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway resource [first-filters]+ -- [second-filters]*` 2 | 3 | Show details of a Resource. 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * Id 14 | * Path 15 | * ParentId -------------------------------------------------------------------------------- /scripts/commands/apigateway/resource.sh: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined path id parentId "join('',keys(resourceMethods||{Miss:''}))" -- "$SECOND_RESOURCE") 4 | 5 | RESOURCE_LIST=$(awscli apigateway get-resources --rest-api-id "$SELECTED" --output text --query "sort_by(items,&path)[$FILTER].[id]") 6 | 7 | select_one Resource "$RESOURCE_LIST" 8 | 9 | SELECTED_RESOURCE="$SELECTED" -------------------------------------------------------------------------------- /scripts/commands/apigateway/resources.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | FILTER=$(auto_filter_joined path id parentId "join('',keys(resourceMethods||{Miss:''}))" -- "$SECOND_RESOURCE") 4 | 5 | awscli apigateway get-resources --rest-api-id "$SELECTED" --output table --query "sort_by(items,&path)[$FILTER].{ 6 | \"1.Path\":path, 7 | \"2.Id\":id, 8 | \"3.ParentId\":parentId||'', 9 | \"4.PathPart\":pathPart||'', 10 | \"5.Methods\":join(', 'keys(resourceMethods||{Miss: ''}))}" | sed 's/ Miss / /g' 11 | 12 | 13 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/resources.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway resources [first-filters]+ -- [second-filters]*` 2 | 3 | List all Resources. 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * Id 14 | * Path 15 | * ParentId -------------------------------------------------------------------------------- /scripts/commands/apigateway/rest-apis.sh: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | FILTER=$(auto_filter_joined id name "join('',endpointConfiguration.types)" -- "$FIRST_RESOURCE") 4 | 5 | REST_APIS_LISTING=$(awscli apigateway get-rest-apis --output text --query "sort_by(items,&name)[$FILTER].[id]") 6 | select_one RestAPI "$REST_APIS_LISTING" 7 | 8 | SELECTED_REST_API=$SELECTED -------------------------------------------------------------------------------- /scripts/commands/apigateway/stage.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | REST_API_ID="$SELECTED" 4 | 5 | REST_API_STAGE_LISTINGS=$(awscli apigateway get-stages --rest-api-id $REST_API_ID --output text --query "sort_by(item,&stageName)[$(auto_filter_joined deploymentId stageName -- "$SECOND_RESOURCE")].[stageName]") 6 | select_one Stage "$REST_API_STAGE_LISTINGS" 7 | 8 | awscli apigateway get-stage --rest-api-id "$REST_API_ID" --stage-name "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/apigateway/stage.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway stage [first-filters]+ -- [second-filters]*` 2 | 3 | Show details of a Stage. 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * DeploymentId 14 | * StageName -------------------------------------------------------------------------------- /scripts/commands/apigateway/stages.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/rest-apis.sh 2 | 3 | awscli apigateway get-stages --rest-api-id "$SELECTED" --output table --query "sort_by(item,&stageName)[$(auto_filter_joined deploymentId stageName -- "$SECOND_RESOURCE")].{ 4 | \"1.Name\":stageName, 5 | \"2.DeploymentId\":deploymentId}" 6 | -------------------------------------------------------------------------------- /scripts/commands/apigateway/stages.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigateway stages [first-filters]+ -- [second-filters]*` 2 | 3 | List all Stages of a RestAPI. 4 | 5 | ## First Filter matches against 6 | 7 | * Id 8 | * Name 9 | * EndpointConfigurationType 10 | 11 | ## Second Filter matches against 12 | 13 | * DeploymentId 14 | * StageName -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/api.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | awscli apigatewayv2 get-api --api-id $SELECTED_API --output table -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/api.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 api [filters]+` 2 | 3 | Get all Details for an API 4 | 5 | ## Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/apis.sh: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | FILTER=$(auto_filter_joined ApiId Name ApiEndpoint Description ProtocolType -- "$FIRST_RESOURCE") 4 | 5 | APIS_LISTING=$(awscli apigatewayv2 get-apis --output text --query "Items[$FILTER].[ApiId]") 6 | select_one API "$APIS_LISTING" 7 | 8 | SELECTED_API=$SELECTED -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/authorizers.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined Name AuthorizerId AuthorizerType -- "$SECOND_RESOURCE") 4 | 5 | awscli apigatewayv2 get-authorizers --api-id "$SELECTED" --output table --query "sort_by(Items,&Name)[$FILTER].{ 6 | \"1.Id\":AuthorizerId, 7 | \"2.Name\":Name, 8 | \"3.AuthorizerType\":AuthorizerType}" 9 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/authorizers.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 authorizers [first-filters]+ -- [second-filters]*` 2 | 3 | List all Authorzers for an API 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * Name 16 | * AuthorizerId 17 | * AuthorizerType 18 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/deployment.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined DeploymentId DeploymentStatus Description AutoDeployed -- "$SECOND_RESOURCE") 4 | 5 | DEPLOYMENTS_LIST=$(awscli apigatewayv2 get-deployments --api-id "$SELECTED" --output text --query "Items[$FILTER].[DeploymentId]") 6 | 7 | select_one Deployment "$DEPLOYMENTS_LIST" 8 | 9 | awscli apigatewayv2 get-deployment --api-id "$SELECTED_API" --deployment-id "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/deployment.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 deployment [first-filters]+ -- [second-filters]*` 2 | 3 | Get all details for a Deployment 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * DeploymentId 16 | * DeploymentStatus 17 | * Description 18 | * AutoDeployed 19 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/deployments.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined DeploymentId DeploymentStatus Description AutoDeployed -- "$SECOND_RESOURCE") 4 | 5 | awscli apigatewayv2 get-deployments --api-id "$SELECTED" --output table --query "Items[$FILTER].{ 6 | \"1.Id\":DeploymentId, 7 | \"2.DeploymentStatus\":DeploymentStatus, 8 | \"3.CreatedDate\":CreatedDate, 9 | \"4.Description\":Description||'', 10 | \"5.AutoDeployed\":AutoDeployed}" 11 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/deployments.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 deployments [first-filters]+ -- [second-filters]*` 2 | 3 | List all Deployments for an API 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * DeploymentId 16 | * DeploymentStatus 17 | * Description 18 | * AutoDeployed 19 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/domain-names.bash: -------------------------------------------------------------------------------- 1 | awscli apigatewayv2 get-domain-names --output table --query "sort_by(Items,&DomainName)[$(auto_filter_joined DomainName -- "$@")].{ 2 | \"1.DomainName\":DomainName}" -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/domain-names.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 domain-names [filters]+` 2 | 3 | List all Domain Names 4 | 5 | ## Filter matches against 6 | 7 | * DomainName 8 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/index.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined ApiId Name ApiEndpoint Description ProtocolType -- "$@") 2 | awscli apigatewayv2 get-apis --output table --query "sort_by(Items,&Name)[$FILTER].{ 3 | \"1.Name\":Name, 4 | \"2.Id\":ApiId, 5 | \"3.Description\": Description, 6 | \"4.Protocol\":ProtocolType, 7 | \"6.ApiEndpoint\":ApiEndpoint}" -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 [filters]+` 2 | 3 | List the API Gateway APIs 4 | 5 | ## Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/integration-responses.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined IntegrationId IntegrationMethod IntegrationType ConnectionType Description -- "$SECOND_RESOURCE") 4 | 5 | INTEGRATIONS_LIST=$(awscli apigatewayv2 get-integrations --api-id "$SELECTED" --output text --query "Items[$FILTER].[IntegrationId]") 6 | 7 | select_one Integration "$INTEGRATIONS_LIST" 8 | 9 | awscli apigatewayv2 get-integration-responses --api-id "$SELECTED_API" --integration-id "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/integration-responses.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 integration-responses [first-filters]+ -- [second-filters]*` 2 | 3 | List all Integration Responses for an API Integration 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * IntegrationId 16 | * IntegrationMethod 17 | * IntegrationType 18 | * ConnectionType 19 | * Description 20 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/integration.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined IntegrationId IntegrationMethod IntegrationType ConnectionType Description -- "$SECOND_RESOURCE") 4 | 5 | INTEGRATIONS_LIST=$(awscli apigatewayv2 get-integrations --api-id "$SELECTED" --output text --query "Items[$FILTER].[IntegrationId]") 6 | 7 | select_one Integration "$INTEGRATIONS_LIST" 8 | 9 | awscli apigatewayv2 get-integration --api-id "$SELECTED_API" --integration-id "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/integration.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 integration [first-filters]+ -- [second-filters]*` 2 | 3 | Describe an Integration for an API 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * IntegrationId 16 | * IntegrationMethod 17 | * IntegrationType 18 | * ConnectionType 19 | * Description 20 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/integrations.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined IntegrationId IntegrationMethod IntegrationType ConnectionType Description -- "$SECOND_RESOURCE") 4 | 5 | awscli apigatewayv2 get-integrations --api-id "$SELECTED" --output table --query "Items[$FILTER].{ 6 | \"1.Id\":IntegrationId, 7 | \"2.Method\":IntegrationMethod, 8 | \"3.Type\":IntegrationType, 9 | \"4.ConnectionType\":ConnectionType, 10 | \"5.Description\":Description}" 11 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/integrations.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 integrations [first-filters]+ -- [second-filters]*` 2 | 3 | List all Integrations for an API 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * IntegrationId 16 | * IntegrationMethod 17 | * IntegrationType 18 | * ConnectionType 19 | * Description 20 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/model-schema.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined ModelId Name Description ContentType -- "$SECOND_RESOURCE") 4 | 5 | MODELS_LIST=$(awscli apigatewayv2 get-models --api-id "$SELECTED" --output text --query "items[$FILTER].[ModelId]") 6 | 7 | select_one Model "$MODELS_LIST" 8 | 9 | awscli apigatewayv2 get-model --api-id "$SELECTED_API" --model-id "$SELECTED" --output text --query schema -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/model-schema.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 model-schema [first-filters]+ -- [second-filters]*` 2 | 3 | Show the Schema of a particular Model. 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * ModelId 16 | * Name 17 | * Description 18 | * ContentType 19 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/models.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined ModelId Name Description ContentType -- "$SECOND_RESOURCE") 4 | 5 | awscli apigatewayv2 get-models --api-id "$SELECTED" --output table --query "Items[$FILTER].{ 6 | \"1.Id\":ModelId, 7 | \"2.Name\":Name, 8 | \"3.Description\":Description, 9 | \"4.ContentType\":ContentType}" 10 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/models.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 models [first-filters]+ -- [second-filters]*` 2 | 3 | List all Models 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * ModelId 16 | * Name 17 | * Description 18 | * ContentType 19 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/route-responses.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined RouteId RouteKey Target ApiKeyRequired AuthorizationType -- "$SECOND_RESOURCE") 4 | 5 | ROUTES_LIST=$(awscli apigatewayv2 get-routes --api-id "$SELECTED" --output text --query "Items[$FILTER].[RouteId]") 6 | 7 | select_one Route "$ROUTES_LIST" 8 | 9 | awscli apigatewayv2 get-route-responses --api-id "$SELECTED_API" --route-id "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/route-responses.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 route-responses [first-filters]+ -- [second-filters]*` 2 | 3 | List all Route Responses for an API Route 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * RouteId 16 | * RouteKey 17 | * Target 18 | * ApiKeyRequired 19 | * AuthorizationType 20 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/route.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined RouteId RouteKey Target ApiKeyRequired AuthorizationType -- "$SECOND_RESOURCE") 4 | 5 | ROUTES_LIST=$(awscli apigatewayv2 get-routes --api-id "$SELECTED" --output text --query "Items[$FILTER].[RouteId]") 6 | 7 | select_one Route "$ROUTES_LIST" 8 | 9 | awscli apigatewayv2 get-route --api-id "$SELECTED_API" --route-id "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/route.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 route [first-filters]+ -- [second-filters]*` 2 | 3 | Get all Details for an API Route 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * RouteId 16 | * RouteKey 17 | * Target 18 | * ApiKeyRequired 19 | * AuthorizationType 20 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/routes.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | FILTER=$(auto_filter_joined RouteId RouteKey Target ApiKeyRequired AuthorizationType -- "$SECOND_RESOURCE") 4 | 5 | awscli apigatewayv2 get-routes --api-id "$SELECTED" --output table --query "Items[$FILTER].{ 6 | \"1.Id\":RouteId, 7 | \"2.RouteKey\":RouteKey, 8 | \"3.Target\":Target, 9 | \"4.ApiKeyRequired\":ApiKeyRequired, 10 | \"5.AuthorizationType\":AuthorizationType}" 11 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/routes.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 routes [first-filters]+ -- [second-filters]*` 2 | 3 | List all Routes for an API 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * RouteId 16 | * RouteKey 17 | * Target 18 | * ApiKeyRequired 19 | * AuthorizationType 20 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/stage.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | API_STAGE_LISTINGS=$(awscli apigatewayv2 get-stages --api-id $SELECTED_API --output text --query "sort_by(Items,&StageName)[$(auto_filter_joined StageName DeploymentId -- "$SECOND_RESOURCE")].[StageName]") 4 | select_one Stage "$API_STAGE_LISTINGS" 5 | 6 | awscli apigatewayv2 get-stage --api-id "$SELECTED_API" --stage-name "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/stage.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 stage [first-filters]+ -- [second-filters]*` 2 | 3 | Show details of a Stage. 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * StageName 16 | * DeploymentId 17 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/stages.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/apis.sh 2 | 3 | awscli apigatewayv2 get-stages --api-id "$SELECTED" --output table --query "sort_by(Items,&StageName)[$(auto_filter_joined StageName DeploymentId -- "$SECOND_RESOURCE")].{ 4 | \"1.Name\":StageName, 5 | \"2.DeploymentId\":DeploymentId, 6 | \"3.AutoDeploy\":AutoDeploy, 7 | \"4.LastUpdatedDate\":LastUpdatedDate}" 8 | -------------------------------------------------------------------------------- /scripts/commands/apigatewayv2/stages.md: -------------------------------------------------------------------------------- 1 | # `awsinfo apigatewayv2 stages [first-filters]+ -- [second-filters]*` 2 | 3 | List all Stages of a RestAPI. 4 | 5 | ## First Filter matches against 6 | 7 | * ApiId 8 | * Name 9 | * ApiEndpoint 10 | * Description 11 | * ProtocolType 12 | 13 | ## Second Filter matches against 14 | 15 | * DeploymentId 16 | * StageName -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appautoscaling NAMESPACE -- [filters]*` 2 | 3 | Describe all Application Autoscaling Events for a namespace. 4 | 5 | The namespace has to fit one of the supported namespaces, e.g. `ecs` 6 | 7 | ## Options: 8 | 9 | * `-r` limit events to ResourceId 10 | * `-d` limit events to Dimension 11 | 12 | 13 | ## Filter matches against 14 | 15 | * ResourceId 16 | * ScalableDimension 17 | * Cause 18 | * StatusCode 19 | * StatusMessage -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/policies.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | source $CURRENT_COMMAND_DIR/service_namespace.sh 4 | 5 | awscli application-autoscaling describe-scaling-policies --service-namespace $FIRST_RESOURCE --output table --query "ScalingPolicies[$(auto_filter_joined ScalableDimension ResourceId -- "$SECOND_RESOURCE")].{ 6 | \"1.PolicyName\":PolicyName, 7 | \"2.Dimension\":ScalableDimension, 8 | \"3.ResourceId\":ResourceId}" -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appautoscaling policies NAMESPACE -- [filters]*` 2 | 3 | List all Application Autoscaling Policies for a namespace. 4 | 5 | The namespace has to fit one of the supported namespaces, e.g. `ecs` 6 | 7 | ## Filter matches against 8 | 9 | * ScalableDimension 10 | * ResourceId -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/policy.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | source $CURRENT_COMMAND_DIR/service_namespace.sh 4 | 5 | POLICY_LIST=$(awscli application-autoscaling describe-scaling-policies --service-namespace $FIRST_RESOURCE --output text --query "ScalingPolicies[$(auto_filter_joined ScalableDimension ResourceId PolicyName -- "$SECOND_RESOURCE")].[PolicyName]") 6 | 7 | select_one Policy "$POLICY_LIST" 8 | 9 | awscli application-autoscaling describe-scaling-policies --policy-names "$SELECTED" --service-namespace $FIRST_RESOURCE --output table --query "ScalingPolicies[0]" 10 | 11 | -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appautoscaling policy NAMESPACE -- [filters]*` 2 | 3 | Describe all Details of an Application Autoscaling Policy for a namespace. 4 | 5 | The namespace has to fit one of the supported namespaces, e.g. `ecs` 6 | 7 | ## Filter matches against 8 | 9 | * ScalableDimension 10 | * ResourceId 11 | * PolicyName -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/schedules.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | source $CURRENT_COMMAND_DIR/service_namespace.sh 4 | 5 | awscli application-autoscaling describe-scheduled-actions --service-namespace $FIRST_RESOURCE --output table --query "ScheduledActions[$(auto_filter_joined ScalableDimension ResourceId ScheduledActionName Schedule -- "$SECOND_RESOURCE")].{ 6 | \"1.Name\":ScheduledActionName, 7 | \"2.Schedule\":Schedule, 8 | \"3.Resource\":ResourceId, 9 | \"4.Dimension\":ScalableDimension, 10 | \"5.New Min/Max\":join('/', [to_string(ScalableTargetAction.MinCapacity), to_string(ScalableTargetAction.MaxCapacity)]) 11 | }" -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/schedules.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appautoscaling schedules NAMESPACE -- [filters]*` 2 | 3 | Describe Application Autoscaling Schedules for a namespace. 4 | 5 | The namespace has to fit one of the supported namespaces, e.g. `ecs` 6 | 7 | ## Filter matches against 8 | 9 | * ScalableDimension 10 | * ResourceId -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/service_namespace.sh: -------------------------------------------------------------------------------- 1 | if [[ "$FIRST_RESOURCE" = "" || ! "$FIRST_RESOURCE" =~ ^[[:space:]][a-z1-9-]+$ ]] 2 | then 3 | echo "Plaese provide a single service namespace without whitespace as first argument" 4 | exit 1 5 | fi -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/targets.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | source $CURRENT_COMMAND_DIR/service_namespace.sh 4 | 5 | awscli application-autoscaling describe-scalable-targets --service-namespace $FIRST_RESOURCE --output table --query "ScalableTargets[$(auto_filter_joined ScalableDimension ResourceId -- "$SECOND_RESOURCE")].{ 6 | \"1.Resource\":ResourceId, 7 | \"2.Dimension\":ScalableDimension, 8 | \"3.MinCapacity\":MinCapacity, 9 | \"4.MaxCapacity\":MaxCapacity, 10 | \"5.CreatedAt\":CreationTime 11 | }" -------------------------------------------------------------------------------- /scripts/commands/appautoscaling/targets.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appautoscaling targets NAMESPACE -- [filters]*` 2 | 3 | Describe Application Autoscaling Targets. 4 | 5 | The namespace has to fit one of the supported namespaces, e.g. `ecs` 6 | 7 | ## Filter matches against 8 | 9 | * ScalableDimension 10 | * ResourceId -------------------------------------------------------------------------------- /scripts/commands/appsync/datasources.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | APIS=$(awscli appsync list-graphql-apis --output text --query "sort_by(graphqlApis,&name)[$(auto_filter_joined name apiId authenticationType uris.GRAPHQL -- "$FIRST_RESOURCE")].[apiId]") 4 | select_one APIS "$APIS" 5 | 6 | awscli appsync list-data-sources --api-id "$SELECTED" --output table --query "sort_by(dataSources,&name)[$(auto_filter_joined name type serviceRoleArn dynamodbConfig.tableName -- "$SECOND_RESOURCE")].{ 7 | \"1.Name\":name, 8 | \"2.Type\":type, 9 | \"3.Config\":dynamodbConfig||lambdaConfig||elasticsearchConfig}" 10 | -------------------------------------------------------------------------------- /scripts/commands/appsync/datasources.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appsync datasources [api-filter]* -- [type-filter]*` 2 | 3 | List all Data Sources for an AppSync API 4 | 5 | ## First filter matches against 6 | 7 | * Name 8 | * API Id 9 | * AuthenticationType 10 | * GrapQL Uri 11 | 12 | ## Second filter matches against 13 | 14 | * Name 15 | * Type Name 16 | * Service Role Name 17 | * DynamoDB Table Name 18 | -------------------------------------------------------------------------------- /scripts/commands/appsync/index.bash: -------------------------------------------------------------------------------- 1 | awscli appsync list-graphql-apis --output table --query "sort_by(graphqlApis,&name)[$(auto_filter_joined name apiId authenticationType uris.GRAPHQL -- "$@")].{ 2 | \"1.Name\":name, 3 | \"2.Id\":apiId, 4 | \"3.Auth\": authenticationType, 5 | \"4.URI\":uris.GRAPHQL}" -------------------------------------------------------------------------------- /scripts/commands/appsync/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appsync [filters]*` 2 | 3 | List all Appsync APIs 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * API Id 9 | * AuthenticationType 10 | * GrapQL Uri 11 | -------------------------------------------------------------------------------- /scripts/commands/appsync/resolvers.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appsync resolvers [api-filter]* -- [type-filter]*` 2 | 3 | List all field resolvers for a specific type (including Mutation, Query or Subscription) 4 | 5 | ## First filter matches against 6 | 7 | * Name 8 | * API Id 9 | * AuthenticationType 10 | * GrapQL Uri 11 | 12 | ## Second filter matches against 13 | 14 | * Type Name 15 | -------------------------------------------------------------------------------- /scripts/commands/appsync/schema.bash: -------------------------------------------------------------------------------- 1 | APIS=$(awscli appsync list-graphql-apis --output text --query "sort_by(graphqlApis,&name)[$(auto_filter_joined name apiId authenticationType uris.GRAPHQL -- "$@")].[apiId]") 2 | select_one APIS "$APIS" 3 | 4 | awscli appsync get-introspection-schema --api-id "$SELECTED" --format SDL /dev/stdout 5 | -------------------------------------------------------------------------------- /scripts/commands/appsync/schema.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appsync schema [api-filters]*` 2 | 3 | Print the Schema of an AppSync API 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * API Id 9 | * AuthenticationType 10 | * GrapQL Uri 11 | -------------------------------------------------------------------------------- /scripts/commands/appsync/types.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | APIS=$(awscli appsync list-graphql-apis --output text --query "sort_by(graphqlApis,&name)[$(auto_filter_joined name apiId authenticationType uris.GRAPHQL -- "$FIRST_RESOURCE")].[apiId]") 4 | select_one APIS "$APIS" 5 | 6 | awscli appsync list-types --api-id "$SELECTED" --format json --output table --query "sort_by(types,&name)[$(auto_filter_joined name -- "$SECOND_RESOURCE")].{ 7 | \"1.Name\":name}" 8 | -------------------------------------------------------------------------------- /scripts/commands/appsync/types.md: -------------------------------------------------------------------------------- 1 | # `awsinfo appsync types [api-filter]* -- [type-filter]*` 2 | 3 | List all Types for an AppSync API 4 | 5 | ## First filter matches against 6 | 7 | * Name 8 | * API Id 9 | * AuthenticationType 10 | * GrapQL Uri 11 | 12 | ## Second filter matches against 13 | 14 | * Type Name 15 | -------------------------------------------------------------------------------- /scripts/commands/assume/role.md: -------------------------------------------------------------------------------- 1 | # `awsinfo assume role -r ROLE_NAME [-a ACCOUNT_ID] [-d DurationInHours] [-s MFA_SERIAL_NUMBER] [-t MFA_TOKEN] [-m WithMFA] ` 2 | 3 | Assume a specific Role with optional MFA device support. When you don't have access to list the Organisations this allows 4 | you to specify the Account ID directly. If you don't specify the Account Id the command will send a request to 5 | AWS to determine the account id of the credentials currently used and use that ID. 6 | 7 | If you do not specificy a MFA token the command will ask for it. 8 | 9 | If you specify `-m` but no MFA Serial Number with `-s` it will build that arn out of the current account id and your username. -------------------------------------------------------------------------------- /scripts/commands/assume/token.md: -------------------------------------------------------------------------------- 1 | # `awsinfo assume token [-d DurationInHours] [-s MFA_SERIAL_NUMBER] [-t MFA_TOKEN] [-m MFA_TOKEN]` 2 | 3 | Get Session Tokens that can optionally be authorized with MFA. 4 | 5 | If you specify `-m` but no MFA Serial Number with `-s` it will build that arn out of the current account id and your username. -------------------------------------------------------------------------------- /scripts/commands/autoscaling/group.bash: -------------------------------------------------------------------------------- 1 | AUTOSCALING_GROUPS=$(awscli autoscaling describe-auto-scaling-groups --output text --query "AutoScalingGroups[$(auto_filter_joined AutoScalingGroupName -- "$@")].[AutoScalingGroupName]") 2 | 3 | select_one AutoScalingGroup "$AUTOSCALING_GROUPS" 4 | 5 | awscli autoscaling describe-auto-scaling-groups --auto-scaling-group-names "$SELECTED" --output table --query "AutoScalingGroups[0]" -------------------------------------------------------------------------------- /scripts/commands/autoscaling/group.md: -------------------------------------------------------------------------------- 1 | # `awsinfo autoscaling group [filters]+` 2 | 3 | Show all details of an Autoscaling Group 4 | 5 | ## Filter matches against 6 | 7 | * AutoScalingGroupName 8 | -------------------------------------------------------------------------------- /scripts/commands/autoscaling/index.bash: -------------------------------------------------------------------------------- 1 | awscli autoscaling describe-auto-scaling-groups --output table --query "AutoScalingGroups[$(auto_filter_joined AutoScalingGroupName -- "$@")].{ 2 | \"1.Name\":AutoScalingGroupName, 3 | \"2.Min/Max Size\":join('/',[to_string(MinSize),to_string(MaxSize)]), 4 | \"3.Desired\":DesiredCapacity}" -------------------------------------------------------------------------------- /scripts/commands/autoscaling/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo autoscaling [filters]+` 2 | 3 | List all Autoscaling Groups 4 | 5 | ## Filter matches against 6 | 7 | * AutoScalingGroupName 8 | -------------------------------------------------------------------------------- /scripts/commands/batch/compute-environment.bash: -------------------------------------------------------------------------------- 1 | COMPUTE_ENVIRONMENTS=$(awscli batch describe-compute-environments --output text --query "sort_by(computeEnvironments,&computeEnvironmentName)[$(auto_filter_joined status state computeEnvironmentName type computeResources.type -- "$@")].[computeEnvironmentName]") 2 | select_one ComputeEnvironment "$COMPUTE_ENVIRONMENTS" 3 | 4 | awscli batch describe-compute-environments --compute-environments "$SELECTED" --output table --query "computeEnvironments[0].{ 5 | \"1.Name\":computeEnvironmentName, 6 | \"2.Type\":type 7 | \"3.Provisioning\":computeResources.type, 8 | \"4.Status\":status, 9 | \"5.State\": state, 10 | \"6.ComputeResources\":computeResources}" 11 | -------------------------------------------------------------------------------- /scripts/commands/batch/compute-environment.md: -------------------------------------------------------------------------------- 1 | # `awsinfo batch compute-environment [filter]*` 2 | 3 | Describe a specific compute environment 4 | 5 | ## Filter matches against 6 | 7 | * ComputeEnvironmentName 8 | * Status 9 | * State 10 | * Type 11 | * Provisioning Type 12 | -------------------------------------------------------------------------------- /scripts/commands/batch/compute-environments.bash: -------------------------------------------------------------------------------- 1 | awscli batch describe-compute-environments --output table --query "sort_by(computeEnvironments,&computeEnvironmentName)[$(auto_filter_joined status state computeEnvironmentName type computeResources.type -- "$@")].{ 2 | \"1.Name\":computeEnvironmentName, 3 | \"2.Type\":type, 4 | \"3.Provisioning\":computeResources.type, 5 | \"4.Status\":status, 6 | \"5.State\": state, 7 | \"6.InstanceTypes\":join(', ', computeResources.instanceTypes), 8 | \"7.CPU Min/Des/Max\":join(' / ', [to_string(computeResources.minvCpus), to_string(computeResources.desiredvCpus), to_string(computeResources.maxvCpus)]), 9 | \"8.ImageId\":computeResources.imageId}" 10 | -------------------------------------------------------------------------------- /scripts/commands/batch/compute-environments.md: -------------------------------------------------------------------------------- 1 | # `awsinfo batch compute-environments [filter]* ` 2 | 3 | List all Compute Environments 4 | 5 | ## Filter matches against 6 | 7 | * ComputeEnvironmentName 8 | * Status 9 | * State 10 | * Type 11 | * Provisioning Type 12 | -------------------------------------------------------------------------------- /scripts/commands/batch/index.bash: -------------------------------------------------------------------------------- 1 | echo "AWSInfo Batch doesn't have an index command" 2 | -------------------------------------------------------------------------------- /scripts/commands/batch/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo batch` 2 | 3 | Batch doesn't have an index command, please use the subcommands. 4 | -------------------------------------------------------------------------------- /scripts/commands/batch/job-queues.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined jobQueueName status "join('',computeEnvironmentOrder[].computeEnvironment)" -- "$@") 2 | 3 | awscli batch describe-job-queues --output json --query "sort_by(jobQueues,&jobQueueName)[$FILTER].{ 4 | \"1.Name\":jobQueueName, 5 | \"2.State\":state, 6 | \"3.Status\":status, 7 | \"4.ComputeEnvironmentsOrder\":join(', ', map(&join(':', [to_string(@.order), @.computeEnvironment]), sort_by(computeEnvironmentOrder, &order)))}" | sed "s/arn:aws:batch:[a-z1-9-]*:[0-9]*:compute-environment\///g" | print_table ListStackInstances 8 | -------------------------------------------------------------------------------- /scripts/commands/batch/job-queues.md: -------------------------------------------------------------------------------- 1 | # `awsinfo batch job-queues [filter]* ` 2 | 3 | List all Resources for the specified stack 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Status 9 | * Compute Environment Name 10 | -------------------------------------------------------------------------------- /scripts/commands/batch/jobs.md: -------------------------------------------------------------------------------- 1 | # `awsinfo batch jobs [job-queue-filter]* -- [job-filter]*` 2 | 3 | List all running jobs 4 | 5 | ## Options 6 | 7 | * `-p`: List all PENDING jobs 8 | * `-p`: List all RUNNABLE jobs 9 | * `-s`: List all SUCCEEDED jobs 10 | * `-f`: List all FAILED jobs 11 | 12 | ## First filter matches against 13 | 14 | * Name 15 | * Status 16 | * Compute Environment Name 17 | 18 | ## Second filter matches against 19 | 20 | * Name 21 | * Id 22 | * Status 23 | * Status Reason 24 | -------------------------------------------------------------------------------- /scripts/commands/budgets/budget.bash: -------------------------------------------------------------------------------- 1 | ACCOUNT_ID=$(awscli sts get-caller-identity --output text --query "Account") 2 | 3 | BUDGETS=$(awscli budgets describe-budgets --account-id $ACCOUNT_ID --output text --query "Budgets[$(auto_filter_joined BudgetName -- "$@")].[BudgetName]") 4 | 5 | select_one Budget "$BUDGETS" 6 | 7 | awscli budgets describe-budget --budget-name "$SELECTED" --account-id $ACCOUNT_ID --output table -------------------------------------------------------------------------------- /scripts/commands/budgets/budget.md: -------------------------------------------------------------------------------- 1 | # `awsinfo budgets budget [filters]+` 2 | 3 | Show all details of a budget. 4 | 5 | ## Filter matches against 6 | 7 | * BudgetName 8 | -------------------------------------------------------------------------------- /scripts/commands/budgets/index.bash: -------------------------------------------------------------------------------- 1 | ACCOUNT_ID=$(awscli sts get-caller-identity --output text --query "Account") 2 | 3 | awscli budgets describe-budgets --account-id $ACCOUNT_ID --output table --query "Budgets[$(auto_filter_joined BudgetName -- "$@")].{ 4 | \"1.Name\":BudgetName, 5 | \"2.Limit\":join(' ', [BudgetLimit.Amount, BudgetLimit.Unit]), 6 | \"3.TimeUnit\":TimeUnit, 7 | \"4.ActualSpend\":join(' ', [CalculatedSpend.ActualSpend.Amount, CalculatedSpend.ActualSpend.Unit]), 8 | \"5.ForecastedSpend\":join(' ', [CalculatedSpend.ForecastedSpend.Amount, CalculatedSpend.ForecastedSpend.Unit]), 9 | \"5.Type\":BudgetType}" -------------------------------------------------------------------------------- /scripts/commands/budgets/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo budgets [filters]+` 2 | 3 | List all Budgets with their most important details 4 | 5 | ## Filter matches against 6 | 7 | * BudgetName 8 | -------------------------------------------------------------------------------- /scripts/commands/cloudformation/change-set.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation change-set [stack-filters]+ -- [change-set-filters]*` 2 | 3 | Show the details of the specified ChangeSet for a stack. Filters before `--` are used to select the stack, 4 | filters after `--` are used to select the ChangeSet. ChangeSet filters are optional as it will choose the 5 | first one if none are given. 6 | 7 | ## First Filter matches against 8 | 9 | * Stack Name 10 | 11 | ## Second Filter matches against 12 | 13 | * ChangeSet Name -------------------------------------------------------------------------------- /scripts/commands/cloudformation/change-sets.bash: -------------------------------------------------------------------------------- 1 | STACK_LISTING=$(awscli cloudformation describe-stacks --output text --query "sort_by(Stacks,&StackName)[$(auto_filter_joined StackName -- "$@")].[StackName]") 2 | select_one Stack "$STACK_LISTING" 3 | 4 | awscli cloudformation list-change-sets --stack-name "$SELECTED" --output table --query "Summaries[].{\"1.Stack\":StackName,\"2.ChangeSetName\":ChangeSetName,\"3.Status\":Status,\"4.Executable\":ExecutionStatus,\"5.CreatedAt\":CreationTime}" 5 | -------------------------------------------------------------------------------- /scripts/commands/cloudformation/change-sets.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation change-sets [filters]*` 2 | 3 | List the ChangeSets for the specified CloudFormation stack. Select the 4 | CloudFormation stack by specifying filters. 5 | 6 | ## Filter matches against 7 | 8 | * Stack Name -------------------------------------------------------------------------------- /scripts/commands/cloudformation/events.bash: -------------------------------------------------------------------------------- 1 | STACK_LISTING=$(awscli cloudformation describe-stacks --output text --query "sort_by(Stacks,&StackName)[$(auto_filter_joined StackName -- "$@")].[StackName]") 2 | select_one Stack "$STACK_LISTING" 3 | 4 | echo "Most recent events are on the bottom" 5 | 6 | awscli cloudformation describe-stack-events --stack-name "$SELECTED" --query "StackEvents[0:50]|reverse(@)[].{\"1.Timestamp\":Timestamp,\"2.Status\":ResourceStatus,\"3.LogicalId\":LogicalResourceId,\"4.ResourceType\": ResourceType,\"5.Log\":ResourceStatusReason||''}" --output table -------------------------------------------------------------------------------- /scripts/commands/cloudformation/events.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation events [substrings]*` 2 | 3 | List the last 50 CloudFormation Events for a specific Stack. It will select the Stack that 4 | contains all supplied substrings. For long status messages it might break up the table and 5 | make it less readable (the AWSCLI doesn't provide an in-table line break). -------------------------------------------------------------------------------- /scripts/commands/cloudformation/exports.bash: -------------------------------------------------------------------------------- 1 | awscli cloudformation list-exports --output table --query "Exports[$(auto_filter_joined ExportingStackId Name -- "$@")].{\"1.Name\":Name,\"2.Value\":Value}" -------------------------------------------------------------------------------- /scripts/commands/cloudformation/exports.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation exports [substrings]*` 2 | 3 | List all CloudFormation exports, with their `Name`, and `Value`. 4 | If `substrings` are given it will only print exports that contain all `substrings` either 5 | in the `Name` or `Stack` the export comes from. -------------------------------------------------------------------------------- /scripts/commands/cloudformation/imports.bash: -------------------------------------------------------------------------------- 1 | EXPORT_LISTING=$(awscli cloudformation list-exports --output text --query "sort_by(Exports,&Name)[$(auto_filter_joined Name -- "$@")].[Name]") 2 | select_one Stack "$EXPORT_LISTING" 3 | 4 | awscli cloudformation list-imports --export-name "$SELECTED" --query "Imports" --output table -------------------------------------------------------------------------------- /scripts/commands/cloudformation/imports.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation imports [substrings]*` 2 | 3 | List all Stacks that import the CloudFormation Export that matches all substrings. -------------------------------------------------------------------------------- /scripts/commands/cloudformation/index.bash: -------------------------------------------------------------------------------- 1 | awscli cloudformation describe-stacks --output table --query "sort_by(Stacks,&StackName)[$(auto_filter_joined StackName -- "$@")].{\"1.Name\":StackName,\"2.Status\":StackStatus,\"3.RoleARN\": RoleARN, \"4.CreationTime\":CreationTime,\"5.LastUpdated\":LastUpdatedTime}" -------------------------------------------------------------------------------- /scripts/commands/cloudformation/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation [filters]*` 2 | 3 | List all CloudFormation stacks 4 | 5 | ## Filter matches against 6 | 7 | * StackName 8 | -------------------------------------------------------------------------------- /scripts/commands/cloudformation/outputs.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | STACK_LISTING=$(awscli cloudformation describe-stacks --output text --query "sort_by(Stacks,&StackName)[$(auto_filter_joined StackName -- "$FIRST_RESOURCE")].[StackName]") 4 | select_one Stack "$STACK_LISTING" 5 | 6 | awscli cloudformation describe-stacks --stack-name "$SELECTED" --output table --query "Stacks[].Outputs[$(auto_filter_joined OutputKey -- "$SECOND_RESOURCE")].{\"1.Key\":OutputKey,\"2.Value\":OutputValue}" -------------------------------------------------------------------------------- /scripts/commands/cloudformation/outputs.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation outputs [stack-filters]* -- [output-filters]*` 2 | 3 | List all Outputs for the specified stack. It will select the Stack that contains all supplied substrings. 4 | 5 | ## Stack Filter matches against 6 | 7 | * Stack Name 8 | 9 | ## Instance Filter matches against 10 | 11 | * Output Key -------------------------------------------------------------------------------- /scripts/commands/cloudformation/policy.bash: -------------------------------------------------------------------------------- 1 | STACK_LISTING=$(awscli cloudformation describe-stacks --output text --query "sort_by(Stacks,&StackName)[$(auto_filter_joined StackName -- "$@")].[StackName]") 2 | select_one Stack "$STACK_LISTING" 3 | 4 | awscli cloudformation get-stack-policy --stack-name "$SELECTED" --query "StackPolicyBody||''" --output text | jq . -------------------------------------------------------------------------------- /scripts/commands/cloudformation/policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation policy [substrings]*` 2 | 3 | Print the Stack Policy for the stack matching all substrings. -------------------------------------------------------------------------------- /scripts/commands/cloudformation/resources.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation resources [stack-filter]* -- [resource-filter]*` 2 | 3 | List all Resources for the specified stack 4 | 5 | ## First filter matches against 6 | 7 | * StackName 8 | 9 | ## Second filter matches against 10 | 11 | * LogicalResourceId 12 | * PhysicalResourceId 13 | * ResourceType 14 | -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack-set-operations.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation stack-set-operations [stack-set-filter]* -- [operations-filters]` 2 | 3 | Describe Operations for a CloudFormation StackSet 4 | 5 | ## First Filter matches against 6 | 7 | * StackSet Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Operation Id 12 | * Operation Action 13 | * Operation Status -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack-set-template.bash: -------------------------------------------------------------------------------- 1 | STACKSET_LISTING=$(awscli cloudformation list-stack-sets --status ACTIVE --output text --query "sort_by(Summaries,&StackSetName)[$(auto_filter_joined StackSetName -- "$@")].[StackSetName]") 2 | select_one StackSet "$STACKSET_LISTING" 3 | 4 | awscli cloudformation describe-stack-set --stack-set-name "$SELECTED" --output text --query StackSet.TemplateBody 5 | -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack-set-template.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation stack-set [filters]*` 2 | 3 | Describe a CloudFormation StackSet 4 | 5 | ## Filter matches against 6 | 7 | * StackSet Name -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack-set.bash: -------------------------------------------------------------------------------- 1 | STACKSET_LISTING=$(awscli cloudformation list-stack-sets --status ACTIVE --output text --query "sort_by(Summaries,&StackSetName)[$(auto_filter_joined StackSetName -- "$@")].[StackSetName]") 2 | select_one StackSet "$STACKSET_LISTING" 3 | 4 | awscli cloudformation describe-stack-set --stack-set-name "$SELECTED" --output table --query "StackSet.{ 5 | \"1.Name\":StackSetName, 6 | \"2.AdministrationRoleARN\":AdministrationRoleARN, 7 | \"3.ExecutionRoleName\":ExecutionRoleName, 8 | \"4.Parameters\":Parameters||[[]], 9 | \"5.Capabilities\":Capabilities||[[]], 10 | \"6.Tags\":Tags||[[]]}" 11 | -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack-set.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation stack-set [filters]*` 2 | 3 | Describe a CloudFormation StackSet 4 | 5 | ## Filter matches against 6 | 7 | * StackSet Name -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack-sets.bash: -------------------------------------------------------------------------------- 1 | awscli cloudformation list-stack-sets --status ACTIVE --output table --query "sort_by(Summaries,&StackSetName)[$(auto_filter_joined StackSetName -- "$@")].{\"1.Name\":StackSetName,\"2.Id\":StackSetId,\"3.Status\": Status}" -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack-sets.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation stack-sets [filters]*` 2 | 3 | List all active CloudFormation StackSets 4 | 5 | ## Filter matches against 6 | 7 | * StackSet Name -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack.bash: -------------------------------------------------------------------------------- 1 | STACK_LISTING=$(awscli cloudformation describe-stacks --output text --query "sort_by(Stacks,&StackName)[$(auto_filter_joined StackName -- "$@")].[StackName]") 2 | select_one Stack "$STACK_LISTING" 3 | 4 | awscli cloudformation describe-stacks --stack-name "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/cloudformation/stack.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation stack [stack-filter]` 2 | 3 | Describe a Stack and its details 4 | 5 | ## Filter matches against 6 | 7 | * StackName 8 | -------------------------------------------------------------------------------- /scripts/commands/cloudformation/template.bash: -------------------------------------------------------------------------------- 1 | STACK_LISTING=$(awscli cloudformation describe-stacks --output text --query "sort_by(Stacks,&StackName)[$(auto_filter_joined StackName -- "$@")].[StackName]") 2 | select_one Stack "$STACK_LISTING" 3 | 4 | awscli cloudformation get-template --stack-name $SELECTED -------------------------------------------------------------------------------- /scripts/commands/cloudformation/template.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudformation template [filters]*` 2 | 3 | Print the CloudFormation template for a stack 4 | 5 | ## Filter matches against 6 | 7 | * Stack Name -------------------------------------------------------------------------------- /scripts/commands/cloudfront/distribution.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined Id DomainName Status "(Aliases.Items||[''])|join(',',@)" -- "$@") 2 | 3 | DISTRIBUTIONS=$(awscli cloudfront list-distributions --output text --query "DistributionList.Items[$FILTER].[Id]") 4 | select_one Distribution "$DISTRIBUTIONS" 5 | 6 | awscli cloudfront get-distribution-config --id "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/cloudfront/distribution.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudfront distribution [filters]*` 2 | 3 | Describe all properties of a Distribution 4 | 5 | ## Filter matches against 6 | 7 | * Id 8 | * Domain 9 | * Status 10 | * Aliases -------------------------------------------------------------------------------- /scripts/commands/cloudfront/index.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined Id DomainName Status "join(',',Aliases.Items||[''])" -- "$@") 2 | 3 | awscli cloudfront list-distributions --output table --query "DistributionList.Items[$FILTER].{ \ 4 | \"1.Id\": Id, \ 5 | \"2.DomainName\": DomainName, \ 6 | \"3.Status\": Status, \ 7 | \"4.Enabled\":Enabled, \ 8 | \"5.PriceClass\": PriceClass, \ 9 | \"6.Aliases\": (Aliases.Items||[''])|join(',',@), \ 10 | \"7.Origins\": Origins.Quantity, \ 11 | \"8.CacheBehaviors\": CacheBehaviors.Quantity}" -------------------------------------------------------------------------------- /scripts/commands/cloudfront/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudfront [filters]*` 2 | 3 | List all or filtered CloudFront Distributions with their most important data. 4 | 5 | ## Filter matches against 6 | 7 | * Id 8 | * Domain 9 | * Status 10 | * Aliases -------------------------------------------------------------------------------- /scripts/commands/cloudfront/origins.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined Id DomainName Status "(Aliases.Items||[''])|join(',',@)" -- "$@") 2 | 3 | DISTRIBUTIONS=$(awscli cloudfront list-distributions --output text --query "DistributionList.Items[$FILTER].[Id]") 4 | select_one Distribution "$DISTRIBUTIONS" 5 | 6 | awscli cloudfront get-distribution-config --id "$SELECTED" --output table --query "DistributionConfig.Origins.Items[]" -------------------------------------------------------------------------------- /scripts/commands/cloudfront/origins.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudfront origins [filters]*` 2 | 3 | List the Origins for the specified CloudFront distribution. Select the 4 | CloudFront distribution by specifying filters. 5 | 6 | ## Filter matches against 7 | 8 | * ID 9 | * Domain 10 | * Status 11 | * Aliases -------------------------------------------------------------------------------- /scripts/commands/cloudwatch/alarms.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined AlarmName StateValue "Namespace||['']" "MetricName||['']" -- "$@") 2 | 3 | awscli cloudwatch describe-alarms --output table --query "MetricAlarms[$FILTER].{ 4 | \"1.Name\":AlarmName, 5 | \"2.Status\":StateValue, 6 | \"3.Metric\":join('/',[Namespace||'',MetricName||'']), 7 | \"4.Dimension\":Dimensions[].join('/',[Name,Value])|join(',',@), 8 | \"5.Comparison/Threshold\":join('/',[ComparisonOperator,to_string(Threshold)]), 9 | \"6.Periods/Length\":join('/',[to_string(Period),to_string(EvaluationPeriods)])}" 10 | -------------------------------------------------------------------------------- /scripts/commands/cloudwatch/alarms.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cloudwatch alarms [substrings]*` 2 | 3 | List all CloudWatch Alarms with their most important data. 4 | 5 | If `substrings` is given it will only print `Alarms` where all `substrings` are part of the `AlarmName`, `StateValue`, 6 | `Namespace` or `MetricName` -------------------------------------------------------------------------------- /scripts/commands/codebuild/build-reports.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/build_selection.sh 2 | 3 | awscli codebuild batch-get-builds --output table --query "builds[].reportArns | []" --ids $SELECTED -------------------------------------------------------------------------------- /scripts/commands/codebuild/build-reports.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codebuild build-reports [filters]+ ` 2 | 3 | Show all Build Reports for a Build 4 | 5 | ## First Filter matches against 6 | 7 | * Project Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Build Id 12 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/build-status.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/build_selection.sh 2 | 3 | awscli codebuild batch-get-builds --output table --ids $SELECTED --query "builds[].{ 4 | \"1.Id\":id, 5 | \"2.Number\":buildNumber, 6 | \"3.Phase\":currentPhase, 7 | \"4.Status\":buildStatus, 8 | \"5.StartedAt\":startTime, 9 | \"6.FinishedAt\":endTime, 10 | \"7.Environment\":environment}" -------------------------------------------------------------------------------- /scripts/commands/codebuild/build-status.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codebuild build-status [first-filters]+ -- [second-filters]*` 2 | 3 | Show only the status and most relevant data of a build 4 | 5 | ## First Filter matches against 6 | 7 | * Project Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Build Id 12 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/build.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/build_selection.sh 2 | 3 | awscli codebuild batch-get-builds --output table --query builds --ids $SELECTED -------------------------------------------------------------------------------- /scripts/commands/codebuild/build.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codebuild build [filters]+ ` 2 | 3 | Show all details of a Build 4 | 5 | ## First Filter matches against 6 | 7 | * Project Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Build Id 12 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/build_selection.sh: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | PROJECTS=$(awscli codebuild list-projects --output text --query "projects[$(auto_filter_joined @ -- "$FIRST_RESOURCE")].[@]") 4 | 5 | select_one Project "$PROJECTS" 6 | 7 | BUILD_IDS=$(awscli codebuild list-builds-for-project --project-name "$SELECTED" --max-items 100 --output text --query "ids[$(auto_filter_joined @ -- "$SECOND_RESOURCE")].[@]") 8 | 9 | select_one_unsorted Build "$BUILD_IDS" -------------------------------------------------------------------------------- /scripts/commands/codebuild/builds.md: -------------------------------------------------------------------------------- 1 | # `awsinfo coddbuild builds [filters]+` 2 | 3 | List all builds for a project 4 | 5 | ## Options 6 | 7 | * `-m`: Number of builds to show 8 | 9 | ## Filter matches against 10 | 11 | * Project Name 12 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/index.bash: -------------------------------------------------------------------------------- 1 | awscli codebuild list-projects --output table --query "projects[$(auto_filter_joined @ -- "$@")]" -------------------------------------------------------------------------------- /scripts/commands/codebuild/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codebuild [filters]+ ` 2 | 3 | List Codebuild projects 4 | 5 | ## Filter matches against 6 | 7 | * Project Name 8 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/report-groups.bash: -------------------------------------------------------------------------------- 1 | awscli codebuild list-report-groups --output table --query "reportGroups[$(auto_filter_joined @ -- "$@")]" 2 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/report-groups.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codebuild report-groups [filters]+` 2 | 3 | List all Report Groups 4 | 5 | ## Filter matches against 6 | 7 | * Arn 8 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/report.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | REPORT_GROUPS=$(awscli codebuild list-report-groups --output text --query "reportGroups[$(auto_filter_joined @ -- "$FIRST_RESOURCE")].[@]") 4 | select_one ReportGroup "$REPORT_GROUPS" 5 | 6 | REPORT_ARNS=$(awscli codebuild list-reports-for-report-group --report-group-arn "$SELECTED" --query "reports[$(auto_filter_joined @ -- "$SECOND_RESOURCE")].[@]" --output text) 7 | 8 | select_one_unsorted Reports "$REPORT_ARNS" 9 | 10 | awscli codebuild batch-get-reports --report-arns "$SELECTED" --query reports --output table -------------------------------------------------------------------------------- /scripts/commands/codebuild/report.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codebuild report [first-filters]+ -- [second-filters]*` 2 | 3 | Show a report 4 | 5 | ## First Filter matches against 6 | 7 | * Report Group ARN 8 | 9 | ## Second Filter matches against 10 | 11 | * Report ARN 12 | -------------------------------------------------------------------------------- /scripts/commands/codebuild/reports.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | REPORT_GROUPS=$(awscli codebuild list-report-groups --output text --query "reportGroups[$(auto_filter_joined @ -- "$FIRST_RESOURCE")].[@]") 4 | select_one ReportGroup "$REPORT_GROUPS" 5 | 6 | awscli codebuild list-reports-for-report-group --report-group-arn "$SELECTED" --output table --query "reverse(reports)[$(auto_filter_joined @ -- "$SECOND_RESOURCE")]" -------------------------------------------------------------------------------- /scripts/commands/codebuild/reports.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codebuild reports [first-filters]+ -- [second-filters]*` 2 | 3 | List Reports of a Report Group 4 | 5 | ## First Filter matches against 6 | 7 | * Report Group ARN 8 | 9 | ## Second Filter matches against 10 | 11 | * Report ARN 12 | -------------------------------------------------------------------------------- /scripts/commands/codecommit/branches.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | REPOSITORIES=$(awscli codecommit list-repositories --output text --query "repositories[$(auto_filter_joined repositoryName repositoryId -- "$FIRST_RESOURCE")].[repositoryName]") 4 | select_one Repository "$REPOSITORIES" 5 | 6 | awscli codecommit list-branches --repository-name "$SELECTED" --output table --query "branches[$(auto_filter_joined @ -- "$SECOND_RESOURCE")]" -------------------------------------------------------------------------------- /scripts/commands/codecommit/branches.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codecommit branches [filters]+` 2 | 3 | List all branches for a Repository 4 | 5 | ## Filter matches against 6 | 7 | * Branch Name 8 | -------------------------------------------------------------------------------- /scripts/commands/codecommit/index.bash: -------------------------------------------------------------------------------- 1 | awscli codecommit list-repositories --output table --query "repositories[$(auto_filter_joined repositoryName repositoryId -- "$@")].{ 2 | \"1.Name\":repositoryName, 3 | \"2.Id\":repositoryId}" -------------------------------------------------------------------------------- /scripts/commands/codecommit/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codecommit [filters]+ ` 2 | 3 | List all Repositories 4 | 5 | ## Filter matches against 6 | 7 | * Repository Names 8 | -------------------------------------------------------------------------------- /scripts/commands/codecommit/pull-request.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/pull_requests_shared.sh 2 | 3 | select_one PullRequest "$PULL_REQUESTS" 4 | 5 | awscli codecommit get-pull-request --output table --query "pullRequest" --pull-request-id $SELECTED -------------------------------------------------------------------------------- /scripts/commands/codecommit/pull-request.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codecommit pull-request [first-filters]+ -- [second-filters]*` 2 | 3 | Describe a CodeCommit PullRequest. 4 | 5 | ## First Filter matches against 6 | 7 | * RepositoryName 8 | * RepositoryId 9 | 10 | ## Second Filter matches against 11 | 12 | * PullRequestId 13 | -------------------------------------------------------------------------------- /scripts/commands/codecommit/pull-requests.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/pull_requests_shared.sh 2 | 3 | echo "$PULL_REQUESTS" | xargs -rn 1 bash -c "awscli codecommit get-pull-request --output json --query \"pullRequest.{\\\"1.Id\\\": pullRequestId, \\\"2.Title\\\": title, \\\"3.Author\\\": authorArn}\" --pull-request-id \$0 \$@" | print_table GetPullRequests -------------------------------------------------------------------------------- /scripts/commands/codecommit/pull-requests.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codecommit pull-requests [first-filters]+ -- [second-filters]*` 2 | 3 | List CodeCommit PullRequests. It has to get the information separately 4 | per PullRequest before showing them. 5 | 6 | ## First Filter matches against 7 | 8 | * RepositoryName 9 | * RepositoryId 10 | 11 | ## Second Filter matches against 12 | 13 | * PullRequestId 14 | -------------------------------------------------------------------------------- /scripts/commands/codecommit/pull_requests_shared.sh: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | REPOSITORIES=$(awscli codecommit list-repositories --output text --query "repositories[$(auto_filter_joined repositoryName repositoryId -- "$FIRST_RESOURCE")].[repositoryName]") 4 | 5 | select_one Repository "$REPOSITORIES" 6 | 7 | PULL_REQUESTS=$(awscli codecommit list-pull-requests --pull-request-status OPEN --repository-name "$SELECTED" --output text --query "pullRequestIds[$(auto_filter_joined @ -- "$SECOND_RESOURCE")].[@]") 8 | -------------------------------------------------------------------------------- /scripts/commands/codecommit/repository.bash: -------------------------------------------------------------------------------- 1 | REPOSITORIES=$(awscli codecommit list-repositories --output text --query "repositories[$(auto_filter_joined repositoryName repositoryId -- "$@")].[repositoryName]") 2 | 3 | select_one Repository "$REPOSITORIES" 4 | 5 | awscli codecommit get-repository --repository-name "$SELECTED" --output table --query "repositoryMetadata" -------------------------------------------------------------------------------- /scripts/commands/codecommit/repository.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codecommit repository [filters]+` 2 | 3 | Describe a CodeCommit Repository. 4 | 5 | ## Filter matches against 6 | 7 | * RepositoryName 8 | * RepositoryId 9 | -------------------------------------------------------------------------------- /scripts/commands/codepipeline/action-executions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codepipeline action-executions [first-filters]+ -- [second-filters]*` 2 | 3 | List the last 100 action executions for a specific pipeline. Helpful to see the history of specific actions, e.g. you want to see the last 100 Deploy actions and their results. 4 | 5 | ## First Filter matches against 6 | 7 | * Pipeline name 8 | 9 | ## Second Filter matches against 10 | 11 | * Action Name 12 | -------------------------------------------------------------------------------- /scripts/commands/codepipeline/actions.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | PIPELINES=$(awscli codepipeline list-pipelines --output text --query "pipelines[$(auto_filter_joined name version -- "$FIRST_RESOURCE")].[name]") 4 | select_one Pipeline "$PIPELINES" 5 | 6 | FILTER=$(auto_filter_joined "join('',actionStates[].actionName||[''])" -- "$SECOND_RESOURCE") 7 | 8 | awscli codepipeline get-pipeline-state --name "$SELECTED" --output table --query "stageStates[$FILTER].actionStates[] | [$(auto_filter_joined actionName -- "$SECOND_RESOURCE")]" -------------------------------------------------------------------------------- /scripts/commands/codepipeline/actions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codepipeline actions [first-filters]+ -- [second-filters]*` 2 | 3 | Show Details of current actions in a pipeline. 4 | 5 | ## First Filter matches against 6 | 7 | * Pipeline Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Action Name 12 | -------------------------------------------------------------------------------- /scripts/commands/codepipeline/execution.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | PIPELINES=$(awscli codepipeline list-pipelines --output text --query "pipelines[$(auto_filter_joined name version -- "$FIRST_RESOURCE")].[name]") 4 | select_one Pipeline "$PIPELINES" 5 | 6 | PIPELINE=$SELECTED 7 | 8 | PIPELINE_EXECUTIONS=$(awscli codepipeline list-pipeline-executions --pipeline-name "$SELECTED" --output text --query "pipelineExecutionSummaries[$(auto_filter_joined pipelineExecutionId -- "$SECOND_RESOURCE")].[pipelineExecutionId]") 9 | 10 | select_one PipelineExecution "$PIPELINE_EXECUTIONS" 11 | 12 | awscli codepipeline get-pipeline-execution --pipeline-name "$PIPELINE" --pipeline-execution-id "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/codepipeline/execution.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codepipeline execution [first-filters]+ -- [second-filters]*` 2 | 3 | Get Details of a specific execution of a Codepipeline. 4 | 5 | ## First Filter matches against 6 | 7 | * Pipeline Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Execution IDs 12 | 13 | -------------------------------------------------------------------------------- /scripts/commands/codepipeline/executions.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | PIPELINES=$(awscli codepipeline list-pipelines --output text --query "pipelines[$(auto_filter_joined name version -- "$FIRST_RESOURCE")].[name]") 4 | select_one Pipeline "$PIPELINES" 5 | 6 | FILTER=$(auto_filter_joined pipelineExecutionId status "join('',sourceRevisions[].revisionId||[''])" -- "$SECOND_RESOURCE") 7 | 8 | awscli codepipeline list-pipeline-executions --pipeline-name "$SELECTED" --output table --query "pipelineExecutionSummaries[$FILTER].{ 9 | \"1.ExecutionId\":pipelineExecutionId, 10 | \"2.RevisionId\":join(', ',sourceRevisions[].revisionId||['']), 11 | \"3.Status\":status, 12 | \"4.StartTime\":startTime}" -------------------------------------------------------------------------------- /scripts/commands/codepipeline/executions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codepipeline executions [first-filters]+ -- [second-filters]*` 2 | 3 | List all Codepipeline Executions 4 | 5 | ## First Filter matches against 6 | 7 | * Pipeline Name 8 | * Pipeline Version 9 | 10 | ## Second Filter matches against 11 | 12 | * ExecutionID 13 | * Status 14 | * Revision -------------------------------------------------------------------------------- /scripts/commands/codepipeline/index.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined name version -- "$@") 2 | 3 | awscli codepipeline list-pipelines --output table --query "pipelines[$FILTER].{ 4 | \"1.Name\":name, 5 | \"2.Version\":version, 6 | \"3.Created\":created, 7 | \"4.Updated\":updated}" -------------------------------------------------------------------------------- /scripts/commands/codepipeline/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codepipline [first-filters]+` 2 | 3 | List all Pipelines 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Version 9 | -------------------------------------------------------------------------------- /scripts/commands/codepipeline/stage.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | PIPELINES=$(awscli codepipeline list-pipelines --output text --query "pipelines[$(auto_filter_joined name version -- "$FIRST_RESOURCE")].[name]") 4 | select_one Pipeline "$PIPELINES" 5 | 6 | awscli codepipeline get-pipeline-state --name "$SELECTED" --output table --query "stageStates[$(auto_filter_joined stageName -- "$SECOND_RESOURCE")]" -------------------------------------------------------------------------------- /scripts/commands/codepipeline/stage.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codepipeline stage [first-filters]+ -- [second-filters]*` 2 | 3 | Show details of a specific Stage in a CodePipeline 4 | 5 | ## First Filter matches against 6 | 7 | * Pipeline Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Stage Name 12 | -------------------------------------------------------------------------------- /scripts/commands/codepipeline/state.bash: -------------------------------------------------------------------------------- 1 | PIPELINES=$(awscli codepipeline list-pipelines --output text --query "pipelines[$(auto_filter_joined name version -- "$@")].[name]") 2 | 3 | select_one Pipeline "$PIPELINES" 4 | 5 | awscli codepipeline get-pipeline-state --name "$SELECTED" --output table --query "stageStates[].{\"1.StageName\": stageName, \"2.LatestExecution\":latestExecution.pipelineExecutionId, \"3.Actions\": actionStates[].{ 6 | \"1.ActionName\": actionName, 7 | \"2.ActionStatus\": latestExecution.status, 8 | \"3.Revision\": currentRevision.revisionId || ''}}" -------------------------------------------------------------------------------- /scripts/commands/codepipeline/state.md: -------------------------------------------------------------------------------- 1 | # `awsinfo codepipeline state [filters]+` 2 | 3 | Get an overview on the current stage of a pipeline with details like current actions per stage and exuction ids for each stage and action. 4 | 5 | ## Filter matches against 6 | 7 | * Pipeline Name 8 | -------------------------------------------------------------------------------- /scripts/commands/cognito/clients.bash: -------------------------------------------------------------------------------- 1 | USER_POOLS=$(awscli cognito-idp list-user-pools --max-results 60 --output text --query "sort_by(UserPools,&Name)[$(auto_filter_joined Id Name -- "$@")].[Id]") 2 | select_one UserPool "$USER_POOLS" 3 | 4 | awscli cognito-idp list-user-pool-clients --max-results 60 --user-pool-id "$SELECTED" --output table --query "UserPoolClients[].{ 5 | \"1.ClientId\": ClientId, 6 | \"2.ClientName\": ClientName}" -------------------------------------------------------------------------------- /scripts/commands/cognito/clients.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cognito clients [user-pool-filter]*` 2 | 3 | List all or filtered Clients in your Cognito UserPool 4 | 5 | ## User Pool Filter 6 | 7 | * ID 8 | * Name 9 | -------------------------------------------------------------------------------- /scripts/commands/cognito/index.bash: -------------------------------------------------------------------------------- 1 | awscli cognito-idp list-user-pools --max-results 60 --output table --query "UserPools[$(auto_filter_joined Id Name -- "$@")].{\"1.Name\":Name,\"2.Id\":Id, \"3.Triggers\": length(LambdaConfig)}" -------------------------------------------------------------------------------- /scripts/commands/cognito/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cognito [filters]*` 2 | 3 | List all or Cognito User Pools 4 | 5 | ## Filter matches against 6 | 7 | * ID 8 | * Name -------------------------------------------------------------------------------- /scripts/commands/cognito/users.md: -------------------------------------------------------------------------------- 1 | # `awsinfo cognito users [user-pool-filter]* -- [user-subfilter]` 2 | 3 | List all or filtered Users in your Cognito UserPool 4 | 5 | ## User Pool Filter 6 | 7 | * ID 8 | * Name 9 | 10 | ## User Filter 11 | 12 | * Username 13 | * First Name 14 | * Last Name 15 | * Email -------------------------------------------------------------------------------- /scripts/commands/commands/index.bash: -------------------------------------------------------------------------------- 1 | 2 | if [[ $# -gt 0 ]] 3 | then 4 | if [[ -d "$DIR/commands/$1" ]] 5 | then 6 | echosuccess Available Commands: 7 | find $DIR/commands/$1 -name "*.bash" | sed s/index//g | sed s/.bash//g | awk '{n=split($0,array,"/"); print " " array[n-1] " " array[n]}' | sort 8 | else 9 | echo Service "$1" is not supported 10 | fi 11 | else 12 | echo "Run 'awsinfo commands SERVICE' to see a list of all available commands for the SERVICE" 13 | echo "e.g. 'awsinfo commands route53'" 14 | echosuccess Supported Services: 15 | ls $DIR/commands | sort | sed 's/^/ /' 16 | fi 17 | 18 | -------------------------------------------------------------------------------- /scripts/commands/commands/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo commands [service]` 2 | 3 | If no specific service is given as an argument it will list all available services. 4 | If you specify a service as the first parameter it will list all commands for that service. -------------------------------------------------------------------------------- /scripts/commands/complete/index.bash: -------------------------------------------------------------------------------- 1 | DIR="$(dirname "$(awsinfo_readlink -f "$0")")" 2 | 3 | python $DIR/complete.py $DIR 4 | -------------------------------------------------------------------------------- /scripts/commands/complete/zsh.bash: -------------------------------------------------------------------------------- 1 | DIR="$(dirname "$(awsinfo_readlink -f "$0")")" 2 | 3 | python3 $DIR/complete_zsh.py $DIR 4 | -------------------------------------------------------------------------------- /scripts/commands/costs/accounts.bash: -------------------------------------------------------------------------------- 1 | START_DATE=$(awsinfo_date +%Y-%m-01) 2 | END_DATE=$(awsinfo_date --date="$START_DATE +1 month" +%Y-%m-%d) 3 | 4 | FILTER=$(auto_filter_joined "join('',Keys)" -- "$@") 5 | 6 | awscli ce get-cost-and-usage --time-period Start=$START_DATE,End=$END_DATE --granularity MONTHLY --group-by Type=DIMENSION,Key=LINKED_ACCOUNT --metrics UNBLENDED_COST --output table --query "{ 7 | Accounts: DimensionValueAttributes[$(auto_filter_joined Value -- "$@")].{\"1.Id\":Value,\"2.Name\":Attributes.description}, Costs: ResultsByTime[0].Groups[$FILTER].{\"1.Id\":Keys[0],\"2.Name\":Metrics.UnblendedCost.Amount}} 8 | " -------------------------------------------------------------------------------- /scripts/commands/costs/accounts.md: -------------------------------------------------------------------------------- 1 | # `awsinfo costs accounts [filters]+` 2 | 3 | List all Unblended Costs per Account. 4 | 5 | ## Filter matches against 6 | 7 | * AccountId 8 | -------------------------------------------------------------------------------- /scripts/commands/costs/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo costs` 2 | 3 | Uses the CostExplorer API to show current costs for this month. -------------------------------------------------------------------------------- /scripts/commands/costs/service.md: -------------------------------------------------------------------------------- 1 | # `awsinfo costs service [first-filters]+` 2 | 3 | Costs in the last 14 days of a Service 4 | 5 | ## First Filter matches against 6 | 7 | * Name of the AWS Service -------------------------------------------------------------------------------- /scripts/commands/costs/services.bash: -------------------------------------------------------------------------------- 1 | START_DATE=$(awsinfo_date +%Y-%m-01) 2 | END_DATE=$(awsinfo_date --date="$START_DATE +1 month" +%Y-%m-%d) 3 | 4 | FILTER=$(auto_filter_joined "join('',Keys)" -- "$@") 5 | 6 | awscli ce get-cost-and-usage --time-period Start=$START_DATE,End=$END_DATE --granularity MONTHLY --metrics UNBLENDED_COST --group-by Type=DIMENSION,Key=SERVICE --query "ResultsByTime[].reverse(sort_by(Groups,&to_number(Metrics.UnblendedCost.Amount)))[$FILTER].{\"1.Service\": join('',Keys),\"2.Costs\":join(' ',[Metrics.UnblendedCost.Amount,Metrics.UnblendedCost.Unit])}" --output table -------------------------------------------------------------------------------- /scripts/commands/costs/services.md: -------------------------------------------------------------------------------- 1 | # `awsinfo costs services [first-filters]+` 2 | 3 | Monthly costs grouped by Service 4 | 5 | ## First Filter matches against 6 | 7 | * Name of the AWS Service -------------------------------------------------------------------------------- /scripts/commands/costs/usage.md: -------------------------------------------------------------------------------- 1 | # `awsinfo costs usage [first-filters]+` 2 | 3 | List all of a Services usage costs for a detailed breakdown of the costs of a specific service. 4 | 5 | ## First Filter matches against 6 | 7 | * Name of the AWS Service in Costs -------------------------------------------------------------------------------- /scripts/commands/credentials/index.bash: -------------------------------------------------------------------------------- 1 | awscli configure list 2 | -------------------------------------------------------------------------------- /scripts/commands/credentials/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo credentials` 2 | 3 | Print the current awscli configuration, including region, keys and where they are loaded from. 4 | -------------------------------------------------------------------------------- /scripts/commands/dynamodb/index.bash: -------------------------------------------------------------------------------- 1 | awscli dynamodb list-tables --output table --query "TableNames[$(auto_filter_joined @ -- "$@")]" -------------------------------------------------------------------------------- /scripts/commands/dynamodb/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo dynamodb [substrings]*` 2 | 3 | List all Dynamodb tables .If `substrings` are given it will only print tables that contain all `substrings`. -------------------------------------------------------------------------------- /scripts/commands/dynamodb/table.md: -------------------------------------------------------------------------------- 1 | # `awsinfo dynamodb table [substrings]*` 2 | 3 | Select a DynamoDB table and describe all its details. -------------------------------------------------------------------------------- /scripts/commands/ec2/images.bash: -------------------------------------------------------------------------------- 1 | OWNER="--owners $(awscli sts get-caller-identity --query Account --output text)" 2 | 3 | while getopts "o:" opt; do 4 | case "$opt" in 5 | o) OWNER="--owners $OPTARG" ;; 6 | esac 7 | done 8 | shift $(($OPTIND - 1)) 9 | 10 | awscli ec2 describe-images $OWNER --filter "Name=name,Values=*$@*" --output table --query "Images[].{ 11 | \"1.Name\":Name, 12 | \"2.ImageId\":ImageId, 13 | \"3.PlatformDetails\":PlatformDetails, 14 | \"4.Architecture\":Architecture, 15 | \"5.State\":State}" 16 | -------------------------------------------------------------------------------- /scripts/commands/ec2/images.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 images [name-filter]` 2 | 3 | Lists the EC2 images filtered by name and optionally owner. 4 | The name filter parameter can contain wildcards. A wildcard is also automatically added to the beginning and the end of the provided name. 5 | 6 | For example `awsinfo ec2 images -o amazon 'amzn2-ami-hvm*2021*86*ebs'` will look for all Amazon Linux 2 images from 2021 in `X86_64` infrastructure with `EBS` storage. 7 | 8 | ## Options 9 | 10 | * `-o`: Owner of the images, e.g. `amazon` or your Account Id. By default set to Account Id 11 | -------------------------------------------------------------------------------- /scripts/commands/ec2/index.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/terminated-instances.sh 2 | 3 | FILTER=$(auto_filter_joined "$TAG_NAME" InstanceId InstanceType State.Name Placement.AvailabilityZone PublicIpAddress PrivateIpAddress InstanceLifecycle -- "$@") 4 | 5 | awscli ec2 describe-instances --output table $EC2_FILTER --query "sort_by($SORT_BY)[].Instances[$FILTER][].{ 6 | \"1.Name\":$TAG_NAME, 7 | \"2.InstanceId\":InstanceId, 8 | \"3.Type\":InstanceType, 9 | \"4.State\":State.Name, 10 | \"5.InstanceLifecycle\":InstanceLifecycle||'on-demand', 11 | \"6.LaunchTime\":LaunchTime, 12 | \"7.AZ\":Placement.AvailabilityZone, 13 | \"8.PublicIP\":PublicIpAddress, 14 | \"9.PrivateIP\":PrivateIpAddress}" -------------------------------------------------------------------------------- /scripts/commands/ec2/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 [filters]*` 2 | 3 | List all EC2 instances. Use `-t` to show terminated instances. 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Id 9 | * Type 10 | * State 11 | * AvailabilityZone 12 | * SecurityGroups -------------------------------------------------------------------------------- /scripts/commands/ec2/instance.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/terminated-instances.sh 2 | 3 | SECURITY_GROUPS="NetworkInterfaces|length(@)" 4 | FILTER=$(auto_filter_joined "$TAG_NAME" InstanceId InstanceType State.Name Placement.AvailabilityZone "$SECURITY_GROUPS" PublicIpAddress PrivateIpAddress -- "$@") 5 | 6 | INSTANCE_LIST=$(awscli ec2 describe-instances --output text $EC2_FILTER --query "sort_by(Reservations,&Instances[0].LaunchTime)[].Instances[$FILTER].[InstanceId]") 7 | 8 | select_one Instance "$INSTANCE_LIST" 9 | 10 | awscli ec2 describe-instances --instance-ids "$SELECTED" --output table $EC2_FILTER --query "sort_by(Reservations,&Instances[0].LaunchTime)[].Instances[0][]" 11 | -------------------------------------------------------------------------------- /scripts/commands/ec2/instance.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 instance [filters]*` 2 | 3 | List all EC2 instances. Use `-t` to show terminated instances. 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Id 9 | * Type 10 | * State 11 | * AvailabilityZone 12 | * SecurityGroups -------------------------------------------------------------------------------- /scripts/commands/ec2/keys.bash: -------------------------------------------------------------------------------- 1 | awscli ec2 describe-key-pairs --output table --query "KeyPairs[$(auto_filter_joined KeyName KeyFingerprint -- "$@")].{\"1.Name\":KeyName,\"2.Fingerprint\":KeyFingerprint}" -------------------------------------------------------------------------------- /scripts/commands/ec2/keys.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 keys [substrings]*` 2 | 3 | List all EC2 key pairs. 4 | 5 | If `substrings` is given it will only print key pairs where all `substrings` are part of the `Key Name` or 6 | the `Fingerpring`. This makes it easy to limit the instances shown without having to enter the full Name or Fingerprint. -------------------------------------------------------------------------------- /scripts/commands/ec2/terminated-instances.sh: -------------------------------------------------------------------------------- 1 | EC2_FILTER="--filter Name=instance-state-name,Values=pending,running" 2 | SORT_BY="Reservations,&Instances[0].LaunchTime" 3 | 4 | 5 | while getopts "tn" opt; do 6 | case "$opt" in 7 | t) EC2_FILTER="";; 8 | n) SORT_BY="Reservations,&Instances[0].Tags[?Key=='Name'].Value|[0]||''";; 9 | esac 10 | done 11 | shift $(($OPTIND-1)) -------------------------------------------------------------------------------- /scripts/commands/ecr/images.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecr images [repository-filters]+ -- [image-filters]*` 2 | 3 | Show the details of the specified ECR images for a repository. 4 | 5 | ## First Filter matches against 6 | 7 | * Repository Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Image Digest 12 | * Tags -------------------------------------------------------------------------------- /scripts/commands/ecr/index.bash: -------------------------------------------------------------------------------- 1 | awscli ecr describe-repositories --output table --query "repositories[$(auto_filter_joined repositoryName repositoryUri -- "$@")].{\"1.Name\":repositoryName,\"2.Uri\":repositoryUri}" 2 | -------------------------------------------------------------------------------- /scripts/commands/ecr/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecr [filters]*` 2 | 3 | List all or filtered ECR Repositories 4 | 5 | ## Filter matches against 6 | 7 | * Repository URI 8 | * Repository Name -------------------------------------------------------------------------------- /scripts/commands/ecs/cluster.bash: -------------------------------------------------------------------------------- 1 | CLUSTERS=$(awscli ecs list-clusters --output text --query "clusterArns[$(auto_filter_joined @ -- "$@")].[@]") 2 | select_one Cluster "$CLUSTERS" 3 | 4 | awscli ecs describe-clusters --output table --clusters "$SELECTED" -------------------------------------------------------------------------------- /scripts/commands/ecs/cluster.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs cluster [filters]*` 2 | 3 | Describe an ECS Cluster 4 | 5 | ## Filter matches against 6 | 7 | * Cluster Arn 8 | -------------------------------------------------------------------------------- /scripts/commands/ecs/index.bash: -------------------------------------------------------------------------------- 1 | CLUSTERS=$(awscli ecs list-clusters --query clusterArns[$(auto_filter_joined '@' -- "$@")] --output text) 2 | 3 | awscli ecs describe-clusters --clusters $CLUSTERS --output table --query "clusters[].{\"1.Name\":clusterName,\"2.Status\":status,\"3.Instances\":registeredContainerInstancesCount,\"4.RunningTasks\":runningTasksCount,\"5.PendingTasks\":pendingTasksCount,\"6.ActiveServices\":activeServicesCount}" -------------------------------------------------------------------------------- /scripts/commands/ecs/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs [substrings]*` 2 | 3 | List all ECS Clusters with their most important data. 4 | 5 | If `substrings` is given it will only print clusters where all `substrings` are part of the cluster Arn so you can limit which cluster data you want to see. -------------------------------------------------------------------------------- /scripts/commands/ecs/instance.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs instance -f "CLUSTER_FILTER_EXPRESSION" [cluster-filter]* -- [instance-filter]*` 2 | 3 | Describe a cluster instance. 4 | 5 | With `-f` you can use a ECS cluster query (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) 6 | to select an instance (on top of just selecting it with a filter on the Container Instance ID). This is helpful 7 | if you want to filter on attributes. 8 | 9 | ## First filter matches against 10 | 11 | * Cluster Name 12 | 13 | ## Second filter matches against 14 | 15 | * Container Instance Id 16 | -------------------------------------------------------------------------------- /scripts/commands/ecs/service-events.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | CLUSTERS=$(awscli ecs list-clusters --output text --query "clusterArns[$(auto_filter_joined @ -- "$FIRST_RESOURCE")].[@]") 4 | select_one Cluster "$CLUSTERS" 5 | 6 | CLUSTER=$SELECTED 7 | 8 | SERVICES=$(awscli ecs list-services --cluster $CLUSTER --output text --query "serviceArns[$(auto_filter_joined @ -- "$SECOND_RESOURCE")].[@]") 9 | select_one Service "$SERVICES" 10 | 11 | awscli ecs describe-services --cluster $CLUSTER --services "$SELECTED" --output table --query "services[0].events[].{ 12 | \"1.Timestamp\":createdAt, 13 | \"2.Message\":message}" -------------------------------------------------------------------------------- /scripts/commands/ecs/service-events.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs service-events [cluster-filter]* -- [service-filter]*` 2 | 3 | List all Service Events from a Service. 4 | 5 | ## First filter matches against 6 | 7 | * Cluster Arn 8 | 9 | ## Second filter matches against 10 | 11 | * Service Arn -------------------------------------------------------------------------------- /scripts/commands/ecs/service.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | CLUSTERS=$(awscli ecs list-clusters --output text --query "clusterArns[$(auto_filter_joined @ -- "$FIRST_RESOURCE")].[@]") 4 | select_one Cluster "$CLUSTERS" 5 | 6 | CLUSTER=$SELECTED 7 | 8 | SERVICES=$(awscli ecs list-services --cluster $CLUSTER --output text --query "serviceArns[$(auto_filter_joined @ -- "$SECOND_RESOURCE")].[@]") 9 | select_one Service "$SERVICES" 10 | 11 | awscli ecs describe-services --cluster $CLUSTER --services "$SELECTED" --query "services[0]" --output json | print_table_excluding .events DescribeService -------------------------------------------------------------------------------- /scripts/commands/ecs/service.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs service [cluster-filter]* -- [service-filter]*` 2 | 3 | Describe an ECS Service from a cluster. 4 | 5 | ## First filter matches against 6 | 7 | * Cluster Arn 8 | 9 | ## Second filter matches against 10 | 11 | * Service Arn -------------------------------------------------------------------------------- /scripts/commands/ecs/services.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | CLUSTERS=$(awscli ecs list-clusters --output text --query "clusterArns[$(auto_filter_joined @ -- "$FIRST_RESOURCE")].[@]") 4 | select_one Cluster "$CLUSTERS" 5 | 6 | awscli ecs list-services --output table --cluster "$SELECTED" --query "serviceArns[$(auto_filter_joined @ -- "$SECOND_RESOURCE")]" -------------------------------------------------------------------------------- /scripts/commands/ecs/services.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs services [cluster-filter]* -- [service-filter]*` 2 | 3 | List all ECS services in a cluster 4 | 5 | ## First filter matches against 6 | 7 | * Cluster Arn 8 | 9 | ## Second filter matches against 10 | 11 | * Service Arn -------------------------------------------------------------------------------- /scripts/commands/ecs/task-definition.bash: -------------------------------------------------------------------------------- 1 | TASK_DEFINITIONS=$(awscli ecs list-task-definitions --output text --query "taskDefinitionArns[$(auto_filter_joined @ -- "$@")].[@]") 2 | select_one TaskDefinition "$TASK_DEFINITIONS" 3 | 4 | awscli ecs describe-task-definition --task-definition "$SELECTED" --output table --include TAGS -------------------------------------------------------------------------------- /scripts/commands/ecs/task-definition.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs task-definitions [filter]*` 2 | 3 | Describe a task definition including its containers, volumes and other data. 4 | 5 | ## Filter matches against 6 | 7 | * Task Definition Arn 8 | -------------------------------------------------------------------------------- /scripts/commands/ecs/task-definitions.bash: -------------------------------------------------------------------------------- 1 | awscli ecs list-task-definitions --output table --query "taskDefinitionArns[$(auto_filter_joined @ -- "$@")].[@]" 2 | -------------------------------------------------------------------------------- /scripts/commands/ecs/task-definitions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs task-definitions [filter]*` 2 | 3 | List all task definitions. 4 | 5 | ## Filter matches against 6 | 7 | * Task Definition Arn 8 | -------------------------------------------------------------------------------- /scripts/commands/ecs/task-families.bash: -------------------------------------------------------------------------------- 1 | awscli ecs list-task-definition-families --output table --query "families[$(auto_filter_joined @ -- "$@")]" 2 | -------------------------------------------------------------------------------- /scripts/commands/ecs/task-families.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs task-families [filter]*` 2 | 3 | List all task definition families. 4 | 5 | ## Filter matches against 6 | 7 | * Task Definition Family 8 | -------------------------------------------------------------------------------- /scripts/commands/ecs/task.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ecs task [-s] [cluster-filter]* -- [task-filter]*` 2 | 3 | Describe a task. 4 | 5 | ## Options 6 | 7 | * `-s`: Match against stopped tasks 8 | 9 | ## First filter matches against 10 | 11 | * Cluster Name 12 | 13 | ## Second filter matches against 14 | 15 | * Task Arn 16 | * TaskDefinitionArn 17 | * ContainerInstanceArn 18 | * LastStatus 19 | * Group 20 | * Cpu 21 | * Memory 22 | * LaunchType 23 | -------------------------------------------------------------------------------- /scripts/commands/efs/file-system.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | FILE_SYSTEM_LISTING=$(awscli efs describe-file-systems --output text --query "sort_by(FileSystems,&FileSystemId)[$(auto_filter_joined FileSystemId -- "$FIRST_RESOURCE")].[FileSystemId]") 4 | select_one Stack "$FILE_SYSTEM_LISTING" 5 | 6 | awscli efs describe-file-systems --file-system-id "$SELECTED" --output table \ 7 | --query "FileSystems[0]" 8 | -------------------------------------------------------------------------------- /scripts/commands/efs/file-system.md: -------------------------------------------------------------------------------- 1 | # `awsinfo efs file-system [file-system-filter]*` 2 | 3 | Describe a File System with all its details 4 | 5 | ## Filter matches against 6 | 7 | * FileSystemId -------------------------------------------------------------------------------- /scripts/commands/efs/index.bash: -------------------------------------------------------------------------------- 1 | awscli efs describe-file-systems --output table \ 2 | --query "FileSystems[$(auto_filter_joined FileSystemId LifeCycleState Name PerformanceMode ThroughputMode 'to_string(Encrypted)' -- "$@")].{ \ 3 | \"1.Id\":FileSystemId, \ 4 | \"2.Name\":Name, \ 5 | \"3.State\":LifeCycleState, \ 6 | \"4.SizeInBytes\":SizeInBytes.Value, \ 7 | \"5.MountTargets\":NumberOfMountTargets, \ 8 | \"6.PerformanceMode\":PerformanceMode, \ 9 | \"7.Encrypted\":to_string(Encrypted), \ 10 | \"8.ThroughputMode\":ThroughputMode}" 11 | -------------------------------------------------------------------------------- /scripts/commands/efs/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo efs [filters]*` 2 | 3 | List all EFS File Systems. 4 | 5 | ## Filter matches against 6 | 7 | * FileSystemId 8 | * LifeCycleState 9 | * Name 10 | * PerformanceMode 11 | * ThroughputMode 12 | * Encrypted 13 | -------------------------------------------------------------------------------- /scripts/commands/efs/mount-targets.md: -------------------------------------------------------------------------------- 1 | # `awsinfo efs mount-targets [file-system-filter]* -- [mount-target-filter]*` 2 | 3 | List all Mount Targets for an EFS file system. 4 | 5 | ## First filter matches against 6 | 7 | * FileSystemId 8 | * LifeCycleState 9 | * Name 10 | * PerformanceMode 11 | * ThroughputMode 12 | * Encrypted 13 | 14 | 15 | ## Second filter matches against 16 | 17 | * MountTargetId 18 | * SubnetId 19 | * LifeCycleState 20 | * IpAddress 21 | * NetworkInterfaceId 22 | -------------------------------------------------------------------------------- /scripts/commands/efs/security-groups.md: -------------------------------------------------------------------------------- 1 | # `awsinfo efs security-groups [file-system-filter]* -- [mount-target-filter]*` 2 | 3 | List all Security Groups for a Mount Target. 4 | 5 | ## First filter matches against 6 | 7 | * FileSystemId 8 | * LifeCycleState 9 | * Name 10 | * PerformanceMode 11 | * ThroughputMode 12 | * Encrypted 13 | 14 | 15 | ## Second filter matches against 16 | 17 | * MountTargetId 18 | * SubnetId 19 | * LifeCycleState 20 | * IpAddress 21 | * NetworkInterfaceId 22 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/applications.bash: -------------------------------------------------------------------------------- 1 | VLC="ResourceLifecycleConfig.VersionLifecycleConfig" 2 | 3 | awscli elasticbeanstalk describe-applications --output table --query "sort_by(Applications,&ApplicationName)[$(auto_filter_joined ApplicationName -- "$@")].{\"1.Name\":ApplicationName,\"2.Versions\":Versions || '' | length(@), \"3.VersionLimit\":$VLC.MaxCountRule.Enabled, \"4.MaxVersions\":$VLC.MaxCountRule.MaxCount, \"5.DeleteSource\":$VLC.MaxCountRule.DeleteSourceFromS3, \"6.VersionAgeLimit\":$VLC.MaxAgeRule.Enabled, \"7.LimitInDays\":$VLC.MaxAgeRule.MaxAgeInDays, \"8.DeleteSource\":$VLC.MaxAgeRule.DeleteSourceFromS3}" -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/applications.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elasticbeanstalk applications [filters]*` 2 | 3 | List all or filtered ElasticBeanstalk Applications with their most important data. 4 | 5 | ## Filter matches against 6 | 7 | * Application Name 8 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/events.bash: -------------------------------------------------------------------------------- 1 | ENVIRONMENTS=$(awscli elasticbeanstalk describe-environments --output text --query "sort_by(Environments,&EnvironmentName)[$(auto_filter_joined EnvironmentName ApplicationName -- "$@")].[EnvironmentName]") 2 | select_one Environment "$ENVIRONMENTS" 3 | 4 | awscli elasticbeanstalk describe-events --environment-name "$SELECTED" --output table --query "Events[0:50]|reverse(@)[].{\"1.EventDate\":EventDate,\"2.Severity\":Severity,\"3.Message\":Message}" 5 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/events.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elasticbeanstalk events [filters]*` 2 | 3 | List Events of a selected ElasticBeanstalk Environment. 4 | 5 | ## Filter matches against 6 | 7 | * Environment Name 8 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/health.bash: -------------------------------------------------------------------------------- 1 | ENVIRONMENTS=$(awscli elasticbeanstalk describe-environments --output text --query "sort_by(Environments,&EnvironmentName)[$(auto_filter_joined EnvironmentName -- "$@")].[EnvironmentName]") 2 | select_one Environment "$ENVIRONMENTS" 3 | 4 | awscli elasticbeanstalk describe-environment-health --environment-name "$SELECTED" --attribute-names All --output table --query "{\"1.EnvironmentName\":EnvironmentName,\"2.HealthStatus\":HealthStatus,\"3.Status\":Status,\"4.Color\":Color, \"5.ApplicationMetrics\":ApplicationMetrics,\"6.InstancesHealth\":InstancesHealth}" 5 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/health.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elasticbeanstalk health [filters]*` 2 | 3 | Get health details for a selected ElasticBeanstalk Environment. 4 | 5 | ## Filter matches against 6 | 7 | * Environment Name 8 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/index.bash: -------------------------------------------------------------------------------- 1 | awscli elasticbeanstalk describe-environments --output table --query "sort_by(Environments,&join('-',[ApplicationName, EnvironmentName])) \ 2 | [$(auto_filter_joined ApplicationName EnvironmentName Status Health EnvironmentId CNAME -- "$@")].{ \ 3 | \"1.ApplicationName\":ApplicationName, \ 4 | \"2.EnvironmentName\":EnvironmentName, \ 5 | \"3.Status\":Status, \ 6 | \"4.Health\":Health, \ 7 | \"5.EnvironmentId\":EnvironmentId, \ 8 | \"6.CNAME\":CNAME}" -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elasticbeanstalk [filters]*` 2 | 3 | List all or filtered ElasticBeanstalk Environments with their most important data. 4 | 5 | ## Filter matches against 6 | 7 | * Application Name 8 | * Environment Name 9 | * Status 10 | * Health 11 | * Environment Id 12 | * Cname -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/instances.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elasticbeanstalk instance [environment_filters]* -- [instance_filters]*` 2 | 3 | Get details about the health and load of each instance in a selected ElasticBeanstalk Environment with optional 4 | filtering of the instnances 5 | 6 | ## Environment Filter matches against 7 | 8 | * Environment Name 9 | 10 | ## Instance Filter matches against 11 | 12 | * Instance Id 13 | * Availability Zone 14 | * Version 15 | * Health 16 | * Color -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/stacks.bash: -------------------------------------------------------------------------------- 1 | awscli elasticbeanstalk list-available-solution-stacks --output table --query "SolutionStacks[$(auto_filter_joined '@' -- "$@")]" -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/stacks.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elasticbeanstalk applications [filters]*` 2 | 3 | List all or filtered ElasticBeanstalk SolutionStacks. 4 | 5 | ## Filter matches against 6 | 7 | * Solution Stack Name 8 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/versions.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | APPLICATIONS=$(awscli elasticbeanstalk describe-applications --output text --query "sort_by(Applications,&ApplicationName)[$(auto_filter_joined ApplicationName -- $FIRST_RESOURCE)].[ApplicationName]") 4 | select_one Application "$APPLICATIONS" 5 | 6 | awscli elasticbeanstalk describe-application-versions --application-name "$SELECTED" --output table --query "ApplicationVersions[$(auto_filter_joined VersionLabel -- $SECOND_RESOURCE)].{\"1.ApplicationName\":ApplicationName,\"2.VersionLabel\":VersionLabel,\"3.Status\":Status,\"4.DateCreated\":DateCreated, \"5.Source\":join('/', ['s3:/',SourceBundle.S3Bucket,SourceBundle.S3Key])}" 7 | -------------------------------------------------------------------------------- /scripts/commands/elasticbeanstalk/versions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elasticbeanstalk versions [application-filters]+ [-- [version-filters]*]` 2 | 3 | List all ElasticBeanstalk Versions for a specified Application. 4 | You can filter the versions by splitting arguments with `--`. 5 | 6 | ## First Filter matches against 7 | 8 | * Application Name 9 | 10 | ## Second Filter matches against 11 | 12 | * Version Label -------------------------------------------------------------------------------- /scripts/commands/elb/attributes.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/loadbalancer_filter.sh 2 | 3 | awscli elbv2 describe-load-balancer-attributes --load-balancer-arn "$SELECTED" --output table 4 | -------------------------------------------------------------------------------- /scripts/commands/elb/attributes.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb attributes [load-balancer-filter]*` 2 | 3 | List all Load Balancer Attributes 4 | 5 | ## Filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | -------------------------------------------------------------------------------- /scripts/commands/elb/classic.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined LoadBalancerName VPCId "join('',AvailabilityZones)" "join('',Instances[].InstanceId)" -- "$@") 2 | 3 | awscli elb describe-load-balancers --query "LoadBalancerDescriptions[$FILTER]" --output table -------------------------------------------------------------------------------- /scripts/commands/elb/classic.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb old [substrings]*` 2 | 3 | Lists all Elastic Load Balancers. 4 | 5 | If `substrings`is given it will only print Load Balancers that contain all `substrings` in the `LoadBalancerName`, 6 | `VPCId`, `Subnets`, `AvailabilityZones` or `InstanceId` giving you a very simple way to view only the ELBs with 7 | the specific characteristics you're interseted in. -------------------------------------------------------------------------------- /scripts/commands/elb/index.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined LoadBalancerName VpcId Scheme LoadBalancerArn DNSName "join('',AvailabilityZones[].ZoneName)" "join('',AvailabilityZones[].SubnetId)" "join('',SecurityGroups||[''])" -- "$@") 2 | 3 | awscli elbv2 describe-load-balancers --output table --query "LoadBalancers[$FILTER].{ 4 | \"1.LoadBalancerName\":LoadBalancerName, 5 | \"2.Type\":Type, 6 | \"3.Scheme\":Scheme, 7 | \"4.VpcId\":VpcId, 8 | \"5.AZs\": AvailabilityZones||''|length(@), 9 | \"6.SGs\": SecurityGroups||''|length(@), 10 | \"7.IPType\":IpAddressType, 11 | \"8.DNSName\":DNSName 12 | }" -------------------------------------------------------------------------------- /scripts/commands/elb/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb [filters]*` 2 | 3 | Show an overview on all ElasticLoadbalancers (V2) 4 | 5 | ## Filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups -------------------------------------------------------------------------------- /scripts/commands/elb/listener-certificates.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/loadbalancer_filter.sh 2 | 3 | LISTENER_FILTER=$(auto_filter_joined "to_string(Port)" Protocol -- "$SECOND_RESOURCE") 4 | 5 | LISTENERS=$(awscli elbv2 describe-listeners --load-balancer-arn "$SELECTED" --output text --query "Listeners[$LISTENER_FILTER].[ListenerArn]") 6 | select_one Listener "$LISTENERS" 7 | 8 | awscli elbv2 describe-listener-certificates --listener-arn "$SELECTED" --output table --query "Certificates" 9 | -------------------------------------------------------------------------------- /scripts/commands/elb/listener-certificates.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb listener-certificates [load-balancer-filter]* -- [listener-filter]*` 2 | 3 | List all Load Balancer Listener Certificates 4 | 5 | ## First filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | ## Second filter matches against 15 | 16 | * Port 17 | * Protocol 18 | -------------------------------------------------------------------------------- /scripts/commands/elb/listener.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/loadbalancer_filter.sh 2 | 3 | LISTENER_FILTER=$(auto_filter_joined "to_string(Port)" Protocol -- "$SECOND_RESOURCE") 4 | 5 | LISTENERS=$(awscli elbv2 describe-listeners --load-balancer-arn "$SELECTED" --output text --query "Listeners[$LISTENER_FILTER].[ListenerArn]") 6 | select_one Listener "$LISTENERS" 7 | 8 | awscli elbv2 describe-listeners --listener-arns "$SELECTED" --output table \ 9 | --query "Listeners[0]" 10 | -------------------------------------------------------------------------------- /scripts/commands/elb/listener.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb listener [load-balancer-filter]* -- [listener-filter]*` 2 | 3 | List all Load Balancer Rules 4 | 5 | ## First filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | ## Second filter matches against 15 | 16 | * Port 17 | * Protocol 18 | -------------------------------------------------------------------------------- /scripts/commands/elb/listeners.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/loadbalancer_filter.sh 2 | 3 | awscli elbv2 describe-listeners --load-balancer-arn "$SELECTED" --output table \ 4 | --query "Listeners[$(auto_filter_joined 'to_string(Port)' Protocol -- "$SECOND_RESOURCE")].{ \ 5 | \"1.Port\":Port, \ 6 | \"2.Protocol\":Protocol}" 7 | -------------------------------------------------------------------------------- /scripts/commands/elb/listeners.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb listeners [load-balancer-filter]* -- [listener-filter]*` 2 | 3 | List all Load Balancer Rules 4 | 5 | ## First filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | ## Second filter matches against 15 | 16 | * Port 17 | * Protocol 18 | -------------------------------------------------------------------------------- /scripts/commands/elb/loadbalancer_filter.sh: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | function create_filter() { 4 | auto_filter_joined LoadBalancerName VpcId Scheme LoadBalancerArn DNSName "join('',AvailabilityZones[].ZoneName)" "join('',AvailabilityZones[].SubnetId)" "join('',SecurityGroups||[''])" -- "$@" 5 | } 6 | 7 | LOADBALANCER_FILTER=$(create_filter $FIRST_RESOURCE) 8 | 9 | LOAD_BALANCERS=$(awscli elbv2 describe-load-balancers --output text --query "LoadBalancers[$LOADBALANCER_FILTER].[LoadBalancerArn]") 10 | select_one LoadBalancer "$LOAD_BALANCERS" 11 | 12 | SELECTED_LOAD_BALANCER="$SELECTED" -------------------------------------------------------------------------------- /scripts/commands/elb/rules.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/loadbalancer_filter.sh 2 | 3 | LISTENER_FILTER=$(auto_filter_joined "to_string(Port)" Protocol -- "$SECOND_RESOURCE") 4 | 5 | LISTENERS=$(awscli elbv2 describe-listeners --load-balancer-arn "$SELECTED" --output text --query "Listeners[$LISTENER_FILTER].[ListenerArn]") 6 | select_one Listener "$LISTENERS" 7 | 8 | awscli elbv2 describe-rules --listener-arn "$SELECTED" --output table 9 | -------------------------------------------------------------------------------- /scripts/commands/elb/rules.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb rules [load-balancer-filter]* -- [listener-filter]*` 2 | 3 | List all Load Balancer Rules 4 | 5 | ## First filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | ## Second filter matches against 15 | 16 | * Port 17 | * Protocol 18 | -------------------------------------------------------------------------------- /scripts/commands/elb/target-group.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/loadbalancer_filter.sh 2 | 3 | TARGET_GROUP_FILTER=$(auto_filter_joined TargetGroupName 'to_string(Port)' Protocol -- "$SECOND_RESOURCE") 4 | 5 | TARGET_GROUPS=$(awscli elbv2 describe-target-groups --load-balancer-arn "$SELECTED" --output text --query "TargetGroups[$TARGET_GROUP_FILTER].[TargetGroupArn]") 6 | select_one TargetGroup "$TARGET_GROUPS" 7 | 8 | awscli elbv2 describe-target-groups --target-group-arns "$SELECTED" --output table \ 9 | --query "TargetGroups[0]" 10 | -------------------------------------------------------------------------------- /scripts/commands/elb/target-group.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb target-group [load-balancer-filter]* -- [target-group-filter]*` 2 | 3 | Describe a single TargetGroup with all its details 4 | 5 | ## First filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | ## Second filter matches against 15 | 16 | * TargetGroupName 17 | * Port 18 | * Protocol 19 | -------------------------------------------------------------------------------- /scripts/commands/elb/target-groups.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/loadbalancer_filter.sh 2 | 3 | awscli elbv2 describe-target-groups --load-balancer-arn "$SELECTED" --output table \ 4 | --query "TargetGroups[$(auto_filter_joined TargetGroupName 'to_string(Port)' Protocol -- "$SECOND_RESOURCE")].{ \ 5 | \"1.Name\":TargetGroupName, \ 6 | \"2.Protocol\":Protocol, \ 7 | \"3.Port\":Port, \ 8 | \"4.HealthCheckPath\":HealthCheckPath, \ 9 | \"5.HealthCheckProtocol\":HealthCheckProtocol}" 10 | -------------------------------------------------------------------------------- /scripts/commands/elb/target-groups.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb target-groups [load-balancer-filter]* -- [target-group-filter]*` 2 | 3 | List all Target Groups for a Load Balancer 4 | 5 | ## First filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | ## Second filter matches against 15 | 16 | * TargetGroupName 17 | * Port 18 | * Protocol 19 | -------------------------------------------------------------------------------- /scripts/commands/elb/targets.md: -------------------------------------------------------------------------------- 1 | # `awsinfo elb targets [load-balancer-filter]* -- [target-group-filter]*` 2 | 3 | List all Targets Health for a Target Group 4 | 5 | ## First filter matches against 6 | 7 | * LoadBalancerName 8 | * VpcId 9 | * Scheme 10 | * Availability Zones 11 | * SubnetIds 12 | * Security Groups 13 | 14 | ## Second filter matches against 15 | 16 | * TargetGroupName 17 | * Port 18 | * Protocol 19 | -------------------------------------------------------------------------------- /scripts/commands/es/domain.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | DOMAIN_NAMES=$(awscli es list-domain-names --output text --query "sort_by(DomainNames,&DomainName)[$(auto_filter_joined DomainName -- "$FIRST_RESOURCE")].[DomainName]") 4 | select_one DomainName "$DOMAIN_NAMES" 5 | 6 | awscli es describe-elasticsearch-domain --domain-name "$SELECTED" --output table \ 7 | --query "DomainStatus" 8 | -------------------------------------------------------------------------------- /scripts/commands/es/domain.md: -------------------------------------------------------------------------------- 1 | # `awsinfo es domain [filters]*` 2 | 3 | Show details of a specific Elasticsearch Domain 4 | 5 | ## Filter matches against 6 | 7 | * Domain Name 8 | -------------------------------------------------------------------------------- /scripts/commands/es/index.bash: -------------------------------------------------------------------------------- 1 | awscli es list-domain-names --output table --query "sort_by(DomainNames,&DomainName)[$(auto_filter_joined DomainName -- "$@")].{\"1.Name\":DomainName}" 2 | -------------------------------------------------------------------------------- /scripts/commands/es/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo es [filters]*` 2 | 3 | List all or filtered ElasticSearch Domains 4 | 5 | ## Filter matches against 6 | 7 | * Domain Name 8 | -------------------------------------------------------------------------------- /scripts/commands/events/bus-policy.bash: -------------------------------------------------------------------------------- 1 | EVENT_BUSES=$(awscli events list-event-buses --output text --query "sort_by(EventBuses,&Name)[$(auto_filter_joined Name Arn -- "$@")].[Name]") 2 | select_one EventBus "$EVENT_BUSES" 3 | 4 | awscli events describe-event-bus --name "$SELECTED" --output text --query "Policy || ''" -------------------------------------------------------------------------------- /scripts/commands/events/bus-policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo events bus-policy [filters]+` 2 | 3 | Show the EventBus Policy of an EventBus 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Arn 9 | -------------------------------------------------------------------------------- /scripts/commands/events/buses.bash: -------------------------------------------------------------------------------- 1 | # Example of a Simple Command 2 | 3 | awscli events list-event-buses --output table --query "sort_by(EventBuses,&Name)[$(auto_filter_joined Name Arn -- "$@")].{ 4 | \"1.Name\":Name, 5 | \"2.Arn\":Arn}" 6 | -------------------------------------------------------------------------------- /scripts/commands/events/buses.md: -------------------------------------------------------------------------------- 1 | # `awsinfo events buses [filters]+` 2 | 3 | List all EventBuses/ 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Arn 9 | -------------------------------------------------------------------------------- /scripts/commands/events/index.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined Name State ScheduleExpression EventPattern -- "$@") 2 | 3 | awscli events list-rules --output table \ 4 | --query "Rules[$FILTER].{ \ 5 | \"1.Name\":Name, \ 6 | \"2.State\":State, \ 7 | \"3.Schedule\":ScheduleExpression||'', \ 8 | \"4.EventPattern\":EventPattern||''}" 9 | -------------------------------------------------------------------------------- /scripts/commands/events/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo events [filter]*` 2 | 3 | List all Event Rules. 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * State 9 | * ScheduleExpression 10 | * EventPattern 11 | -------------------------------------------------------------------------------- /scripts/commands/events/targets.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | RULES=$(awscli events list-rules --output text --query "sort_by(Rules,&Name)[$(auto_filter_joined Name -- "$FIRST_RESOURCE")].[Name]") 4 | select_one Rule "$RULES" 5 | 6 | awscli events list-targets-by-rule --rule "$SELECTED" --output table \ 7 | --query "Targets[$(auto_filter_joined Id Arn RoleArn -- "$SECOND_RESOURCE")]" 8 | -------------------------------------------------------------------------------- /scripts/commands/events/targets.md: -------------------------------------------------------------------------------- 1 | # `awsinfo events targets [rule-filter]* -- [target-filter]*` 2 | 3 | List all Event Targets. 4 | 5 | ## First filter matches against 6 | 7 | * Rule Name 8 | 9 | ## Second filter matches against 10 | 11 | * Target Id 12 | * Arn 13 | * RoleArn 14 | -------------------------------------------------------------------------------- /scripts/commands/firehose/index.bash: -------------------------------------------------------------------------------- 1 | awscli firehose list-delivery-streams --limit 5000 --output table --query "DeliveryStreamNames[$(auto_filter_joined @ -- "$@")]" 2 | -------------------------------------------------------------------------------- /scripts/commands/firehose/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo firehose [filters]+` 2 | 3 | List all Firehose Delivery Streams 4 | 5 | ## Filter matches against 6 | 7 | * DeliveryStreamName 8 | -------------------------------------------------------------------------------- /scripts/commands/firehose/stream.bash: -------------------------------------------------------------------------------- 1 | DELIVERY_STREAMS=$(awscli firehose list-delivery-streams --limit 5000 --output text --query "DeliveryStreamNames[$(auto_filter_joined @ -- "$@")].[@]") 2 | 3 | select_one DeliveryStream "$DELIVERY_STREAMS" 4 | 5 | awscli firehose describe-delivery-stream --delivery-stream-name "$SELECTED" --output table --query "DeliveryStreamDescription" -------------------------------------------------------------------------------- /scripts/commands/firehose/stream.md: -------------------------------------------------------------------------------- 1 | # `awsinfo firehose stream [filters]+` 2 | 3 | Describe a Stream with all details 4 | 5 | ## Filter matches against 6 | 7 | * DeliveryStreamName 8 | -------------------------------------------------------------------------------- /scripts/commands/iam/attached-group-policies.bash: -------------------------------------------------------------------------------- 1 | GROUPS_LIST=$(awscli iam list-groups --output text --query "Groups[$(auto_filter_joined GroupName GroupId -- "$@")].[GroupName]") 2 | select_one Group "$GROUPS_LIST" 3 | awscli iam list-attached-group-policies --group-name "$SELECTED" --output table --query "AttachedPolicies[]" -------------------------------------------------------------------------------- /scripts/commands/iam/attached-group-policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam attached-group-policies [filters]+` 2 | 3 | List all Policies attached to this Group 4 | 5 | ## Filter matches against 6 | 7 | * Group Name 8 | * Group Id 9 | -------------------------------------------------------------------------------- /scripts/commands/iam/attached-role-policies.bash: -------------------------------------------------------------------------------- 1 | ROLES=$(awscli iam list-roles --output text --query "Roles[$(auto_filter_joined RoleName RoleId -- "$@")].[RoleName]") 2 | select_one Role "$ROLES" 3 | 4 | awscli iam list-attached-role-policies --role-name "$SELECTED" --output table --query "AttachedPolicies[]" -------------------------------------------------------------------------------- /scripts/commands/iam/attached-role-policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam attached-role-policies [filters]+` 2 | 3 | List all Policies attached to this Role 4 | 5 | ## Filter matches against 6 | 7 | * Role Name 8 | * Role Id 9 | -------------------------------------------------------------------------------- /scripts/commands/iam/attached-user-policies.bash: -------------------------------------------------------------------------------- 1 | USERS=$(awscli iam list-users --output text --query "Users[$(auto_filter_joined UserName UserId Path -- "$@")].[UserName]") 2 | select_one User "$USERS" 3 | 4 | awscli iam list-attached-user-policies --user-name "$SELECTED" --output table --query "AttachedPolicies[]" -------------------------------------------------------------------------------- /scripts/commands/iam/attached-user-policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam attached-user-policies [filters]*` 2 | 3 | List all attached user policy names for a matched IAM user 4 | 5 | ## Filter matches against 6 | 7 | * User Name 8 | * User Id 9 | * Path -------------------------------------------------------------------------------- /scripts/commands/iam/aws-policies.bash: -------------------------------------------------------------------------------- 1 | awscli iam list-policies --scope AWS --output table --query "Policies[$(auto_filter_joined PolicyName -- "$@")].{\"1.Name\":PolicyName,\"2.Id\":PolicyId,\"3.AttachedTo\":AttachmentCount\"4.Arn\":Arn}" -------------------------------------------------------------------------------- /scripts/commands/iam/aws-policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam aws-policies [filters]*` 2 | 3 | Lists all AWS managed IAM policies in the current account and region. 4 | 5 | ## Filter matches against 6 | 7 | * Policy Name 8 | -------------------------------------------------------------------------------- /scripts/commands/iam/group-policies.bash: -------------------------------------------------------------------------------- 1 | IAM_GROUPS=$(awscli iam list-groups --output text --query "Groups[$(auto_filter_joined GroupName GroupId Path -- "$@")].[GroupName]") 2 | 3 | select_one Group "$IAM_GROUPS" 4 | 5 | awscli iam list-group-policies --group-name "$SELECTED" --output table --query "PolicyNames[].{\"1.PolicyName\":@}" -------------------------------------------------------------------------------- /scripts/commands/iam/group-policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam group-policies [filters]*` 2 | 3 | List all group policy names for a matched IAM group 4 | 5 | ## Filter matches against 6 | 7 | * User Name 8 | * User Id 9 | * Path -------------------------------------------------------------------------------- /scripts/commands/iam/group-policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam group-policy [group-filters]+ -- [policy-filters]*` 2 | 3 | Show the details of the specified policy for a group. Filters before `--` are used to select the group, filters after `--` are used to select the policy. Policy filters are optional as it will choose the first one if none are given. 4 | 5 | ## First Filter matches against 6 | 7 | * Group Name 8 | * Group Id 9 | * Path 10 | 11 | ## Second Filter matches against 12 | 13 | * Policy Name -------------------------------------------------------------------------------- /scripts/commands/iam/groups.bash: -------------------------------------------------------------------------------- 1 | awscli iam list-groups --output table --query "Groups[$(auto_filter_joined GroupName GroupId Path -- "$@")].{\"1.Name\":GroupName,\"2.Id\":GroupId,\"3.Path\":Path,\"4.Arn\":Arn}" -------------------------------------------------------------------------------- /scripts/commands/iam/groups.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam groups [substrings]*` 2 | 3 | Lists all IAM groups in the current account and region. 4 | 5 | If `substrings`is given it will only print iam groups that contain all `substrings` in the `Name` or `Id`. -------------------------------------------------------------------------------- /scripts/commands/iam/index.bash: -------------------------------------------------------------------------------- 1 | awscli iam get-account-summary --query "SummaryMap" --output table | grep -v "Quota" -------------------------------------------------------------------------------- /scripts/commands/iam/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam` 2 | 3 | Get a summary for IAM including number of roles/groups/users and more. -------------------------------------------------------------------------------- /scripts/commands/iam/instance-profiles.bash: -------------------------------------------------------------------------------- 1 | awscli iam list-instance-profiles --output table --query "InstanceProfiles[$(auto_filter_joined InstanceProfileName InstanceProfileId Roles[0].RoleName Roles[0].RoleId -- "$@")].{\"1.Name\":InstanceProfileName,\"2.Id\":InstanceProfileId,\"3.RoleName\":Roles[0].RoleName,\"4.RoleId\":Roles[0].RoleId}" -------------------------------------------------------------------------------- /scripts/commands/iam/instance-profiles.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam instance-profiles [substrings]*` 2 | 3 | Lists all IAM instance profiles in the current account and region. 4 | 5 | If `substrings`is given it will only print iam instance profiles that contain all `substrings` in the `Name`, `Id`, `Role Name` or `Role Id`. -------------------------------------------------------------------------------- /scripts/commands/iam/keys-last-used.bash: -------------------------------------------------------------------------------- 1 | USERS=$(awscli iam list-users --output text --query "Users[$(auto_filter_joined UserName UserId Path -- "$@")].[UserName]") 2 | select_one User "$USERS" 3 | 4 | awscli iam list-access-keys --user-name "$SELECTED" --output text --query AccessKeyMetadata[].AccessKeyId | xargs -n 1 -I {} bash -c "echoinfomsg AccessKeyId: {} && awscli iam get-access-key-last-used --output table --access-key-id {}" -------------------------------------------------------------------------------- /scripts/commands/iam/keys-last-used.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam keys-last-used [filters]*` 2 | 3 | Show when a Users AccessKeys were last used 4 | 5 | ## Filter matches against 6 | 7 | * UserName 8 | * UserId 9 | * Path 10 | -------------------------------------------------------------------------------- /scripts/commands/iam/keys.bash: -------------------------------------------------------------------------------- 1 | USERS=$(awscli iam list-users --output text --query "Users[$(auto_filter_joined UserName UserId Path -- "$@")].[UserName]") 2 | select_one User "$USERS" 3 | 4 | awscli iam list-access-keys --user-name "$SELECTED" --output table --query AccessKeyMetadata -------------------------------------------------------------------------------- /scripts/commands/iam/keys.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam keys [filter]*` 2 | 3 | List all Access Keys for a User. 4 | 5 | ## Filter matches against 6 | 7 | * UserName 8 | * UserId 9 | * Path 10 | -------------------------------------------------------------------------------- /scripts/commands/iam/mfa.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined "User.UserName||''" "User.UserId||''" "User.Path||''" -- "$@") 2 | 3 | awscli iam list-virtual-mfa-devices --output table --query "VirtualMFADevices[$FILTER].{ 4 | \"1.SerialNumber\":SerialNumber, 5 | \"2.UserName\":User.UserName, 6 | \"3.UserId\":User.UserId, 7 | \"4.UserPath\":User.Path}" 8 | -------------------------------------------------------------------------------- /scripts/commands/iam/mfa.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam mfa [filters]*` 2 | 3 | List all virtual mfa devices and filter them 4 | 5 | ## Filter matches against 6 | 7 | * User Name 8 | * User Id 9 | * Path -------------------------------------------------------------------------------- /scripts/commands/iam/password-policy.bash: -------------------------------------------------------------------------------- 1 | awscli iam get-account-password-policy --output table --query PasswordPolicy -------------------------------------------------------------------------------- /scripts/commands/iam/password-policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam password-policy` 2 | 3 | Show the accounts password policy. 4 | -------------------------------------------------------------------------------- /scripts/commands/iam/policies.bash: -------------------------------------------------------------------------------- 1 | awscli iam list-policies --scope Local --output table --query "Policies[$(auto_filter_joined PolicyName PolicyId Path -- "$@")].{\"1.Name\":PolicyName,\"2.Id\":PolicyId,\"3.AttachedTo\":AttachmentCount,\"4.Path\":Path,\"5.Arn\":Arn}" -------------------------------------------------------------------------------- /scripts/commands/iam/policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam policies [substrings]*` 2 | 3 | Lists all IAM policies in the current account and region. 4 | 5 | If `substrings`is given it will only print iam policies that contain all `substrings` in the `Name` or `Id`. 6 | -------------------------------------------------------------------------------- /scripts/commands/iam/policy-version.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | POLICIES=$(awscli iam list-policies --output text --query "Policies[$(auto_filter_joined PolicyName PolicyId Path -- "$FIRST_RESOURCE")].[Arn]") 4 | select_one Policy "$POLICIES" 5 | 6 | POLICY=$SELECTED 7 | 8 | VERSIONS=$(awscli iam list-policy-versions --policy-arn $POLICY --output text --query "Versions[$(auto_filter_joined VersionId -- "$SECOND_RESOURCE")].[VersionId]") 9 | select_one_unsorted Version "$VERSIONS" 10 | 11 | awscli iam get-policy-version --policy-arn $POLICY --version-id "$SELECTED" --output json \ 12 | --query "PolicyVersion" 13 | -------------------------------------------------------------------------------- /scripts/commands/iam/policy-version.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam policy-version [policy-filter]* -- [version-filter]*` 2 | 3 | Describe a IAM Policy version including its statements. 4 | 5 | ## First filter matches against 6 | 7 | * PolicyName 8 | * PolicyId 9 | * Path 10 | 11 | ## Second filter matches against 12 | 13 | * VersionId 14 | -------------------------------------------------------------------------------- /scripts/commands/iam/role-permissions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam role-permissions [filters]*` 2 | 3 | List all policy and attached policy permissions for a Role. 4 | 5 | ## Filter matches against 6 | 7 | * Role Name 8 | * Role Id -------------------------------------------------------------------------------- /scripts/commands/iam/role-policies.bash: -------------------------------------------------------------------------------- 1 | ROLES=$(awscli iam list-roles --output text --query "Roles[$(auto_filter_joined RoleName RoleId -- "$@")].[RoleName]") 2 | select_one Role "$ROLES" 3 | 4 | awscli iam list-role-policies --role-name "$SELECTED" --output table --query "PolicyNames[].{\"1.PolicyName\":@}" -------------------------------------------------------------------------------- /scripts/commands/iam/role-policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam role-policies [filters]*` 2 | 3 | List all role policy names for a matched IAM role 4 | 5 | ## Filter matches against 6 | 7 | * Role Name 8 | * Role Id -------------------------------------------------------------------------------- /scripts/commands/iam/role-policy.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | ROLES=$(awscli iam list-roles --output text --query "Roles[$(auto_filter_joined RoleName RoleId -- $FIRST_RESOURCE )].[RoleName]") 4 | select_one Role "$ROLES" 5 | 6 | ROLE=$SELECTED 7 | 8 | ROLES=$(awscli iam list-role-policies --role-name $ROLE --output text --query "PolicyNames[$(auto_filter_joined @ -- $SECOND_RESOURCE)].[@]") 9 | select_one Policy "$ROLES" 10 | 11 | awscli iam get-role-policy --role-name $ROLE --policy-name "$SELECTED" --output table --query "@.{ 12 | \"PolicyStatement\":PolicyDocument.Statement[].{ 13 | \"1.Effect\": Effect, 14 | \"2.Action\": [Action][], 15 | \"3.Resource\": [Resource][]}}" 16 | -------------------------------------------------------------------------------- /scripts/commands/iam/role-policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam role-policy [role-filters]+ -- [policy-filters]*` 2 | 3 | Show the details of the specified policy for a role. Filters before `--` are used to select the role, filters after `--` are used to select the policy. Policy filters are optional as it will choose the first one if none are given. 4 | 5 | ## First Filter matches against 6 | 7 | * Role Name 8 | * Role Id 9 | 10 | ## Second Filter matches against 11 | 12 | * Policy Name -------------------------------------------------------------------------------- /scripts/commands/iam/role.bash: -------------------------------------------------------------------------------- 1 | ROLES=$(awscli iam list-roles --output text --query "Roles[$(auto_filter_joined RoleName RoleId -- "$@")].[RoleName]") 2 | select_one Role "$ROLES" 3 | 4 | awscli iam get-role --role-name "$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/iam/role.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam role [filters]+` 2 | 3 | Show details of a role, including the AssumeRolePolicyDocument 4 | 5 | ## Filter matches against 6 | 7 | * Role Name 8 | * Role Id 9 | -------------------------------------------------------------------------------- /scripts/commands/iam/roles.bash: -------------------------------------------------------------------------------- 1 | awscli iam list-roles --output table --query "Roles[$(auto_filter_joined RoleName RoleId -- "$@")].{\"1.Name\":RoleName,\"2.Id\":RoleId,\"3.Arn\":Arn}" -------------------------------------------------------------------------------- /scripts/commands/iam/roles.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam roles [substrings]*` 2 | 3 | Lists all IAM roles in the current account and region. 4 | 5 | If `substrings` is given it will only print iam roles that contain all `substrings` in the `Name` or `Id`. -------------------------------------------------------------------------------- /scripts/commands/iam/saml-provider.bash: -------------------------------------------------------------------------------- 1 | PROVIDER_LISTING=$(awscli iam list-saml-providers --output text --query "sort_by(SAMLProviderList,&Arn)[$(auto_filter_joined Arn -- "$@")].[Arn]") 2 | select_one Stack "$PROVIDER_LISTING" 3 | 4 | awscli iam get-saml-provider --saml-provider-arn "$SELECTED" --output text --query SAMLMetadataDocument -------------------------------------------------------------------------------- /scripts/commands/iam/saml-provider.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam saml-provider [first-filters]+` 2 | 3 | Show the SAML Provider Metadata Document 4 | 5 | ## First Filter matches against 6 | 7 | * Arn 8 | -------------------------------------------------------------------------------- /scripts/commands/iam/saml-providers.bash: -------------------------------------------------------------------------------- 1 | awscli iam list-saml-providers --output table --query "sort_by(SAMLProviderList,&Arn)[$(auto_filter_joined Arn -- "$@")].{ 2 | \"1.Arn\":Arn, 3 | \"2.CreateDate\":CreateDate, 4 | \"3.ValidUntil\": ValidUntil}" -------------------------------------------------------------------------------- /scripts/commands/iam/saml-providers.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam saml-providers [first-filters]+` 2 | 3 | Give an overview description of the command here 4 | 5 | ## First Filter matches against 6 | 7 | * Arn 8 | -------------------------------------------------------------------------------- /scripts/commands/iam/user-policies.bash: -------------------------------------------------------------------------------- 1 | USERS=$(awscli iam list-users --output text --query "Users[$(auto_filter_joined UserName UserId Path -- "$@")].[UserName]") 2 | select_one User "$USERS" 3 | 4 | awscli iam list-user-policies --user-name "$SELECTED" --output table --query "PolicyNames[].{\"1.PolicyName\":@}" -------------------------------------------------------------------------------- /scripts/commands/iam/user-policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam user-policies [filters]*` 2 | 3 | List all user policy names for a matched IAM user 4 | 5 | ## Filter matches against 6 | 7 | * User Name 8 | * User Id 9 | * Path -------------------------------------------------------------------------------- /scripts/commands/iam/user-policy.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | USERS=$(awscli iam list-users --output text --query "Users[$(auto_filter_joined UserName UserId Path -- $FIRST_RESOURCE )].[UserName]") 4 | select_one User "$USERS" 5 | 6 | USER=$SELECTED 7 | 8 | USERS=$(awscli iam list-user-policies --user-name $USER --output text --query "PolicyNames[$(auto_filter_joined @ -- $SECOND_RESOURCE)].[@]") 9 | select_one Policy "$USERS" 10 | 11 | awscli iam get-user-policy --user-name $USER --policy-name "$SELECTED" --output table --query "@.{ 12 | \"PolicyStatement\":PolicyDocument.Statement[]}" 13 | -------------------------------------------------------------------------------- /scripts/commands/iam/user-policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam user-policy [user-filters]+ -- [policy-filters]*` 2 | 3 | Show the details of the specified policy for a user. Filters before `--` are used to select the user, filters after `--` are used to select the policy. Policy filters are optional as it will choose the first one if none are given. 4 | 5 | ## First Filter matches against 6 | 7 | * User Name 8 | * User Id 9 | * Path 10 | 11 | ## Second Filter matches against 12 | 13 | * Policy Name -------------------------------------------------------------------------------- /scripts/commands/iam/user.bash: -------------------------------------------------------------------------------- 1 | USERS=$(awscli iam list-users --output text --query "Users[$(auto_filter_joined UserName UserId Path -- "$@")].[UserName]") 2 | select_one User "$USERS" 3 | 4 | awscli iam get-user --user-name "$SELECTED" --output table --query "User" -------------------------------------------------------------------------------- /scripts/commands/iam/user.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam user [filters]*` 2 | 3 | Describe a User 4 | 5 | ## Filter matches against 6 | 7 | * User Name 8 | * User Id 9 | * Path -------------------------------------------------------------------------------- /scripts/commands/iam/users.bash: -------------------------------------------------------------------------------- 1 | awscli iam list-users --output table --query "Users[$(auto_filter_joined UserName UserId Path -- "$@")].{\"1.Name\":UserName,\"2.Id\":UserId,\"3.Arn\":Arn,\"4.Path\": Path,\"5.PasswordLastUsed\": PasswordLastUsed}" -------------------------------------------------------------------------------- /scripts/commands/iam/users.md: -------------------------------------------------------------------------------- 1 | # `awsinfo iam users [substrings]*` 2 | 3 | Lists all IAM users in the current account and region. 4 | 5 | If `substrings`is given it will only print iam groups that contain all `substrings` in the `Name` or `Id`. -------------------------------------------------------------------------------- /scripts/commands/kms/aliases.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined "(TargetKeyId||'')" AliasName -- "$@") 2 | 3 | awscli kms list-aliases --output table --query "Aliases[$FILTER].{\"1.Name\": AliasName, \"2.Key\": TargetKeyId||'', \"3.AliasArn\": AliasArn}" -------------------------------------------------------------------------------- /scripts/commands/kms/aliases.md: -------------------------------------------------------------------------------- 1 | # `awsinfo kms [filters]*` 2 | 3 | List all or filtered KMS aliases 4 | 5 | ## Filter matches against 6 | 7 | * Alias Name 8 | * Key Id -------------------------------------------------------------------------------- /scripts/commands/kms/index.bash: -------------------------------------------------------------------------------- 1 | awscli kms list-keys --output table --query "Keys[$(auto_filter_joined KeyId -- "$@")].{\"1.Id\": KeyId, \"2.Arn\": KeyArn}" -------------------------------------------------------------------------------- /scripts/commands/kms/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo kms [filters]*` 2 | 3 | List all or filtered KMS keys. 4 | 5 | ## Filter matches against 6 | 7 | * Id -------------------------------------------------------------------------------- /scripts/commands/kms/policies.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | KEYS=$(awscli kms list-keys --output text --query "sort_by(Keys,&KeyArn)[$(auto_filter_joined KeyArn -- "$FIRST_RESOURCE")].[KeyArn]") 4 | 5 | select_one Key "$KEYS" 6 | 7 | awscli kms list-key-policies --key-id "$SELECTED" --output table --query "PolicyNames[$(auto_filter_joined @ -- "$SECOND_RESOURCE")]" 8 | -------------------------------------------------------------------------------- /scripts/commands/kms/policies.md: -------------------------------------------------------------------------------- 1 | # `awsinfo kms policies [filters]+` 2 | 3 | List all KMS Key Policies 4 | 5 | ## Filter matches against 6 | 7 | * Key ARN 8 | -------------------------------------------------------------------------------- /scripts/commands/kms/policy.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | KEYS=$(awscli kms list-keys --output text --query "sort_by(Keys,&KeyArn)[$(auto_filter_joined KeyArn -- "$FIRST_RESOURCE")].[KeyArn]") 4 | 5 | select_one Key "$KEYS" 6 | 7 | KMS_KEY=$SELECTED 8 | 9 | POLICIES=$(awscli kms list-key-policies --key-id "$SELECTED" --output text --query "PolicyNames[$(auto_filter_joined @ -- "$SECOND_RESOURCE")].[@]") 10 | 11 | select_one Policy "$POLICIES" 12 | 13 | awscli kms get-key-policy --key-id $KMS_KEY --policy-name "$SELECTED" --query Policy --output text -------------------------------------------------------------------------------- /scripts/commands/kms/policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo kms policy [first-filters]+ -- [second-filters]*` 2 | 3 | Show the KMS Policy of a Key 4 | 5 | ## First Filter matches against 6 | 7 | * Key ARN 8 | 9 | ## Second Filter matches against 10 | 11 | * Policy Name 12 | -------------------------------------------------------------------------------- /scripts/commands/lambda/code.bash: -------------------------------------------------------------------------------- 1 | FUNCTION_LISTING=$(awscli lambda list-functions --output text --query "sort_by(Functions,&FunctionName)[$(auto_filter_joined FunctionName -- "$@")].[FunctionName]") 2 | select_one Function "$FUNCTION_LISTING" 3 | 4 | awscli lambda get-function --function-name "$SELECTED" --output json --query "Code.Location" | jq -r -------------------------------------------------------------------------------- /scripts/commands/lambda/code.md: -------------------------------------------------------------------------------- 1 | # `awsinfo lambda code [function-filter]*` 2 | 3 | Get a URL Location for the function code. 4 | 5 | ## First filter matches against 6 | 7 | * FunctionName 8 | -------------------------------------------------------------------------------- /scripts/commands/lambda/function.bash: -------------------------------------------------------------------------------- 1 | FUNCTION_LISTING=$(awscli lambda list-functions --output text --query "sort_by(Functions,&FunctionName)[$(auto_filter_joined FunctionName -- "$@")].[FunctionName]") 2 | select_one Function "$FUNCTION_LISTING" 3 | 4 | awscli lambda get-function --function-name "$SELECTED" --output json | print_table_excluding .Code GetFunction -------------------------------------------------------------------------------- /scripts/commands/lambda/function.md: -------------------------------------------------------------------------------- 1 | # `awsinfo lambda function [function-filter]*` 2 | 3 | Get all details of a specific function 4 | 5 | ## Filter matches against 6 | 7 | * Function Name 8 | -------------------------------------------------------------------------------- /scripts/commands/lambda/index.bash: -------------------------------------------------------------------------------- 1 | awscli lambda list-functions --output table --query "Functions[$(auto_filter_joined FunctionName Runtime 'to_string(MemorySize)' 'to_string(Timeout)' -- "$@")].{\"1.Name\":FunctionName,\"2.Runtime\":Runtime,\"3.Timeout\":Timeout,\"4.MemorySize\":MemorySize,\"5.Handler\":Handler,\"6.ARN\":FunctionArn}" 2 | -------------------------------------------------------------------------------- /scripts/commands/lambda/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo lambda [filters]*` 2 | 3 | List all or filtered Lambda Functions. 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Runtime 9 | * MemorySize 10 | * Timeout -------------------------------------------------------------------------------- /scripts/commands/lambda/versions.bash: -------------------------------------------------------------------------------- 1 | FUNCTION_LISTING=$(awscli lambda list-functions --output text --query "sort_by(Functions,&FunctionName)[$(auto_filter_joined FunctionName -- "$@")].[FunctionName]") 2 | select_one Function "$FUNCTION_LISTING" 3 | 4 | awscli lambda list-versions-by-function --function-name "$SELECTED" --output table --query "Versions[-10:].{ 5 | \"1.Name\":FunctionName, 6 | \"2.Version\":Version, 7 | \"3.Runtime\":Runtime, 8 | \"4.Timeout\":Timeout, 9 | \"5.MemorySize\":MemorySize, 10 | \"6.Handler\":Handler, 11 | \"7.ARN\":FunctionArn}" -------------------------------------------------------------------------------- /scripts/commands/lambda/versions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo lambda versions [function-filter]*` 2 | 3 | List the last recent versions of a function 4 | 5 | ## Filter matches against 6 | 7 | * Function Name 8 | -------------------------------------------------------------------------------- /scripts/commands/logs/export-tasks.bash: -------------------------------------------------------------------------------- 1 | awscli logs describe-export-tasks --output table --query "exportTasks[$(auto_filter_joined taskId taskName logGroupName destination status.code -- "$@")].{ 2 | \"1.Id\": taskId, 3 | \"2.Name\": taskName, 4 | \"3.LogGroup\": logGroupName, 5 | \"4.Destination\": join('',[destination,destinationPrefix]), 6 | \"5.From\": from, 7 | \"6.To\": to, 8 | \"7.Status\": join(' - ',[status.code,status.message])}" -------------------------------------------------------------------------------- /scripts/commands/logs/export-tasks.md: -------------------------------------------------------------------------------- 1 | # `awsinfo logs export-tasks [filters]+` 2 | 3 | Describe all Logs export tasks. 4 | 5 | ## Filter matches against 6 | 7 | * TaskId 8 | * TaskName 9 | * LogGroupName 10 | * Destination 11 | * Status.code 12 | -------------------------------------------------------------------------------- /scripts/commands/logs/groups.bash: -------------------------------------------------------------------------------- 1 | awscli logs describe-log-groups --output table --query "logGroups[$(auto_filter_joined logGroupName -- "$@")].{ 2 | \"1.Name\":logGroupName, 3 | \"2.Retention\":retentionInDays, 4 | \"3.StoredBytes\": storedBytes, 5 | \"4.MetricFilters\": metricFilterCount, 6 | \"5.CreatedAt\": creationTime}" 7 | -------------------------------------------------------------------------------- /scripts/commands/logs/groups.md: -------------------------------------------------------------------------------- 1 | # `awsinfo logs groups [filter]*` 2 | 3 | Lists all log groups in the current account and region. 4 | 5 | ## Filter matches against 6 | 7 | * Log Group Name 8 | -------------------------------------------------------------------------------- /scripts/commands/logs/streams.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | LOG_GROUPS=$(awscli logs describe-log-groups --query "logGroups[$(auto_filter_joined logGroupName -- "$FIRST_RESOURCE")].[logGroupName]" --output text) 4 | select_one GROUP "$LOG_GROUPS" 5 | 6 | awscli logs describe-log-streams --log-group-name "$SELECTED" --query "logStreams[$(auto_filter_joined logStreamName -- "$SECOND_RESOURCE")].[logStreamName]" --output table 7 | -------------------------------------------------------------------------------- /scripts/commands/logs/streams.md: -------------------------------------------------------------------------------- 1 | # `awsinfo logs groups [log-group-filter]* -- [log-stream-filter]*` 2 | 3 | Lists all log stream for a specific log group 4 | 5 | ## First Filter matches against 6 | 7 | * Log Group Name 8 | 9 | ## Second Filter matches against 10 | 11 | * Log Stream Name 12 | -------------------------------------------------------------------------------- /scripts/commands/me/index.bash: -------------------------------------------------------------------------------- 1 | CALLER_IDENTITY=$(awscli sts get-caller-identity --output json --query "{\"1.AccountId\":Account,\"3.Arn\":Arn,\"4.UserId\":UserId}") 2 | 3 | ALIAS=$(awscli iam list-account-aliases --output json --query "{\"2.AccountAlias\":AccountAliases[0]||''}") 4 | 5 | echo -e "$CALLER_IDENTITY\n$ALIAS" | jq -crs add | print_table AccountDetails -------------------------------------------------------------------------------- /scripts/commands/me/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo me` 2 | 3 | Print the Account Id, Arn of the current user and IAM UserId to know which user you're currently acting as. -------------------------------------------------------------------------------- /scripts/commands/orgs/index.bash: -------------------------------------------------------------------------------- 1 | awscli organizations list-accounts --output table --query "sort_by(Accounts,&Name)[$(auto_filter_joined Name Id Status Email JoinedMethod JoinedTimestamp -- "$@")].{\"1.Name\":Name,\"2.Id\":Id,\"3.Status\":Status,\"4.Email\":Email,\"5.JoinedVia\":JoinedMethod,\"6.Joined\":JoinedTimestamp}" -------------------------------------------------------------------------------- /scripts/commands/orgs/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo orgs [substrings]*` 2 | 3 | List all Accounts that are part of the Organization this account manages. 4 | 5 | If `substrings` is given it will only print Accounts where all `substrings` are part of the `Name`, `Id`, `Status` or 6 | Email. -------------------------------------------------------------------------------- /scripts/commands/rds/cluster.bash: -------------------------------------------------------------------------------- 1 | CLUSTERS=$(awscli rds describe-db-clusters --output text --query "DBClusters[$(auto_filter_joined DBClusterIdentifier Engine EngineVersion EngineMode Status Endpoint -- "$@")].[DBClusterIdentifier]") 2 | select_one Cluster "$CLUSTERS" 3 | 4 | awscli rds describe-db-clusters --output table --db-cluster-identifier "$SELECTED" --query "DBClusters[0]" -------------------------------------------------------------------------------- /scripts/commands/rds/cluster.md: -------------------------------------------------------------------------------- 1 | # `awsinfo rds cluster [cluster-filter]*` 2 | 3 | Show all details of an RDS Cluster 4 | 5 | ## Filter matches against 6 | 7 | * DBClusterIdentifier 8 | * Engine 9 | * EngineVersion 10 | * EngineMode 11 | * Status 12 | * Endpoint 13 | -------------------------------------------------------------------------------- /scripts/commands/rds/clusters.bash: -------------------------------------------------------------------------------- 1 | awscli rds describe-db-clusters --output table --query "DBClusters[$(auto_filter_joined DBClusterIdentifier Engine EngineVersion EngineMode Status Endpoint -- "$@")].{ \ 2 | \"1.Id\":DBClusterIdentifier, \ 3 | \"2.Engine\":join(':',[Engine, EngineVersion, EngineMode]), \ 4 | \"3.Status\":Status, \ 5 | \"4.AZs\":join(', ', AvailabilityZones), 6 | \"5.MultiAZ\":MultiAZ, 7 | \"6.ClusterMembers\":length(DBClusterMembers), 8 | \"7.ReadReplicas\":length(ReadReplicaIdentifiers), 9 | \"8.Encrypted\":StorageEncrypted, 10 | \"9.DeletionProtection\":DeletionProtection}" 11 | -------------------------------------------------------------------------------- /scripts/commands/rds/clusters.md: -------------------------------------------------------------------------------- 1 | # `awsinfo rds clusters [cluster-filter]*` 2 | 3 | List all RDS Clusters 4 | 5 | ## Filter matches against 6 | 7 | * DBClusterIdentifier 8 | * Engine 9 | * EngineVersion 10 | * EngineMode 11 | * Status 12 | * Endpoint 13 | -------------------------------------------------------------------------------- /scripts/commands/rds/engine-versions.bash: -------------------------------------------------------------------------------- 1 | awscli rds describe-db-engine-versions --output table \ 2 | --query "DBEngineVersions[$(auto_filter_joined Engine EngineVersion DBParameterGroupFamily -- "$@")].{ \ 3 | \"1.Engine\":Engine, \ 4 | \"2.EngineVersion\":EngineVersion, \ 5 | \"3.Family\":DBParameterGroupFamily, \ 6 | \"4.SupportsReadReplica\":SupportsReadReplica}" 7 | -------------------------------------------------------------------------------- /scripts/commands/rds/engine-versions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo engine-versions [engine-filter]*` 2 | 3 | List all available Engine Versions and their families 4 | 5 | ## Engine Filter 6 | 7 | * Engine 8 | * EngineVersion 9 | * DBParameterGroupFamily 10 | -------------------------------------------------------------------------------- /scripts/commands/rds/events.bash: -------------------------------------------------------------------------------- 1 | DURATION="180" 2 | 3 | while getopts "h:" opt; do 4 | case "$opt" in 5 | h) DURATION="$(expr $OPTARG \* 60)" ;; 6 | esac 7 | done 8 | shift $(($OPTIND-1)) 9 | 10 | awscli rds describe-events --output table --duration $DURATION --query "reverse(sort_by(Events,&Date))[$(auto_filter_joined SourceArn SourceType Message -- "$@")].{ 11 | \"1.Source\":SourceIdentifier, 12 | \"2.Type\":SourceType, 13 | \"3.Message\":Message, 14 | \"4.Categories\":join(',',EventCategories), 15 | \"5.Date\":Date}" -------------------------------------------------------------------------------- /scripts/commands/rds/events.md: -------------------------------------------------------------------------------- 1 | # `awsinfo rds events [filters]+` 2 | 3 | Show RDS Events 4 | 5 | ## Options 6 | 7 | * `-h`: Hourse since when to get events 8 | 9 | ## Filter matches against 10 | 11 | * SourceArn 12 | * SourceType 13 | * Message 14 | -------------------------------------------------------------------------------- /scripts/commands/rds/index.bash: -------------------------------------------------------------------------------- 1 | awscli rds describe-db-instances --output table --query "DBInstances[$(auto_filter_joined DBInstanceIdentifier DBInstanceClass Engine EngineVersion DBInstanceStatus Endpoint.Address AvailabilityZone DBClusterIdentifier -- "$@")].{ \ 2 | \"1.Id\":DBInstanceIdentifier, \ 3 | \"2.Class\":DBInstanceClass, \ 4 | \"3.Engine\":join(':',[Engine, EngineVersion]), \ 5 | \"4.Status\":DBInstanceStatus, \ 6 | \"5.AZ\":AvailabilityZone, \ 7 | \"6.Public\":PubliclyAccessible, \ 8 | \"7.Cluster\": DBClusterIdentifier, \ 9 | \"8.Endpoint\":join(':',[Endpoint.Address||'', to_string(Endpoint.Port||'')])}" 10 | -------------------------------------------------------------------------------- /scripts/commands/rds/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo rds [filters]*` 2 | 3 | List all or filtered RDS instances with their most important data. 4 | 5 | ## Filter matches against 6 | 7 | * ID 8 | * Class 9 | * Engine 10 | * Engine Version 11 | * Status 12 | * Endpoint 13 | * AZ 14 | * DB Cluster Identifier 15 | -------------------------------------------------------------------------------- /scripts/commands/rds/instance.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined DBInstanceIdentifier DBInstanceClass Engine EngineVersion DBInstanceStatus Endpoint.Address AvailabilityZone "DBClusterIdentifier||''" -- "$@") 2 | 3 | RDS_INSTANCES=$(awscli rds describe-db-instances --output text --query "DBInstances[$FILTER].[DBInstanceIdentifier]") 4 | select_one Instance "$RDS_INSTANCES" 5 | 6 | awscli rds describe-db-instances --db-instance-identifier "$SELECTED" --output table --query "DBInstances[0]" -------------------------------------------------------------------------------- /scripts/commands/rds/instance.md: -------------------------------------------------------------------------------- 1 | # `awsinfo rds instance [instance-filter]*` 2 | 3 | Show all details of an RDS Instance 4 | 5 | ## Filter matches against 6 | 7 | * DBInstanceIdentifier 8 | * DBInstanceClass 9 | * Engine 10 | * EngineVersion 11 | * DBInstanceStatus 12 | * Endpoint.Address 13 | * AvailabilityZone 14 | * DBClusterIdentifier 15 | -------------------------------------------------------------------------------- /scripts/commands/route53/index.bash: -------------------------------------------------------------------------------- 1 | awscli route53 list-hosted-zones --output table --query "HostedZones[$(auto_filter_joined Name Id -- "$@")].{\"1.Name\":Name,\"2.Id\":Id,\"3.Private\":Config.PrivateZone,\"4.RecordSets\":ResourceRecordSetCount}" -------------------------------------------------------------------------------- /scripts/commands/route53/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo route53 [substrings]*` 2 | 3 | List all `HostedZones` If `substrings` are given it will only print `Hosted Zones` where the 4 | `Domain` or `Id` contains all `substrings`. -------------------------------------------------------------------------------- /scripts/commands/route53/records.bash: -------------------------------------------------------------------------------- 1 | split_args "$@" 2 | 3 | HOSTED_ZONES=$(awscli route53 list-hosted-zones --output text --query "HostedZones[$(auto_filter_joined Name Id -- "$FIRST_RESOURCE")].[Id]") 4 | select_one HostedZone "$HOSTED_ZONES" 5 | 6 | awscli route53 list-resource-record-sets --hosted-zone-id "$SELECTED" --output table --query "ResourceRecordSets[$(auto_filter_joined Name Type 'to_string(TTL)' -- "$SECOND_RESOURCE")].{\"1.Name\":Name,\"2.Type\":Type,\"3.TTL\":TTL||'',\"4.Records\":(ResourceRecords[].Value||(['Alias',join('/',[AliasTarget.HostedZoneId,AliasTarget.DNSName])]|[join(':',@)]))|join(' | ',@)}" -------------------------------------------------------------------------------- /scripts/commands/route53/records.md: -------------------------------------------------------------------------------- 1 | # `awsinfo route53 records [substrings]*` 2 | 3 | List all `Records` for a given HostedZone. It will select the HostedZone that contains all supplied substrings. -------------------------------------------------------------------------------- /scripts/commands/s3/acl.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/bucket_listing.sh 2 | 3 | awscli s3api get-bucket-acl --bucket "$SELECTED" --output table 4 | -------------------------------------------------------------------------------- /scripts/commands/s3/acl.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 acl [bucket-filter]*` 2 | 3 | Show the Bucket acl configuraton. 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/s3/bucket_listing.sh: -------------------------------------------------------------------------------- 1 | BUCKET_LISTING=$(awscli s3api list-buckets --output text --query "sort_by(Buckets,&Name)[$(auto_filter_joined Name -- "$@")].[Name]") 2 | select_one Bucket "$BUCKET_LISTING" 3 | -------------------------------------------------------------------------------- /scripts/commands/s3/content.bash: -------------------------------------------------------------------------------- 1 | while getopts "p:" opt; do 2 | case "$opt" in 3 | p) PREFIX="--prefix $OPTARG" ;; 4 | esac 5 | done 6 | shift $(($OPTIND-1)) 7 | 8 | split_args "$@" 9 | 10 | BUCKETS=$(awscli s3api list-buckets --output text --query "Buckets[$(auto_filter_joined Name -- "$FIRST_RESOURCE")].[Name]") 11 | 12 | select_one Bucket "$BUCKETS" 13 | 14 | BUCKET=$SELECTED 15 | 16 | KEYS=$(awscli s3api list-objects-v2 --bucket $BUCKET ${PREFIX:-} --output text --query "sort_by(Contents,&Key)[$(auto_filter_joined Key -- "$SECOND_RESOURCE")].[Key]") 17 | 18 | select_one Key "$KEYS" 19 | 20 | awscli s3 cp s3://$BUCKET/$SELECTED - -------------------------------------------------------------------------------- /scripts/commands/s3/content.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 content [first-filters]+ -- [second-filters]*` 2 | 3 | Print the content of an S3 object to stdout. 4 | 5 | ## Options 6 | 7 | * `-p`: Prefix to filter with 8 | 9 | ## First Filter matches against 10 | 11 | * Bucket Name 12 | 13 | ## Second Filter matches against 14 | 15 | * Object Key -------------------------------------------------------------------------------- /scripts/commands/s3/encryption.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/bucket_listing.sh 2 | 3 | awscli s3api get-bucket-encryption --bucket "$SELECTED" --output table 4 | -------------------------------------------------------------------------------- /scripts/commands/s3/encryption.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 encryption [bucket-filter]*` 2 | 3 | Show the Bucket encryption configuraton. 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/s3/index.bash: -------------------------------------------------------------------------------- 1 | awscli s3api list-buckets --output table \ 2 | --query "(Buckets[$(auto_filter_joined Name -- "$@")].{ \ 3 | \"1.Name\":Name, \ 4 | \"2.CreationDate\":CreationDate})" 5 | -------------------------------------------------------------------------------- /scripts/commands/s3/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 [bucket-filter]*` 2 | 3 | List all Buckets 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/s3/lifecycle.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/bucket_listing.sh 2 | 3 | awscli s3api get-bucket-lifecycle-configuration --bucket "$SELECTED" --output table 4 | -------------------------------------------------------------------------------- /scripts/commands/s3/lifecycle.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 lifecycle [bucket-filter]*` 2 | 3 | Show the Bucket lifecycle configuraton. 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/s3/location.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/bucket_listing.sh 2 | 3 | awscli s3api get-bucket-location --bucket "$SELECTED" --output table 4 | -------------------------------------------------------------------------------- /scripts/commands/s3/location.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 location [bucket-filter]*` 2 | 3 | Show the Bucket Location 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/s3/notifications.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/bucket_listing.sh 2 | 3 | awscli s3api get-bucket-notification-configuration --bucket "$SELECTED" --output table 4 | -------------------------------------------------------------------------------- /scripts/commands/s3/notifications.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 notification [bucket-filter]*` 2 | 3 | List all Notification Configurations for the specified bucket 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/s3/objects.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 objects [first-filters]+ -- [second-filters]*` 2 | 3 | List objects in a Bucket. For large buckets use the `-p` option 4 | to limit by prefixes or `-m` to reduce the number of results. 5 | 6 | ## Options 7 | 8 | * `-l`: Sorty by LastModified 9 | * `-m`: Max Items to show 10 | * `-p`: Prefix to filter with 11 | 12 | ## First Filter matches against 13 | 14 | * Bucket Name 15 | 16 | ## Second Filter matches against 17 | 18 | * Object Key -------------------------------------------------------------------------------- /scripts/commands/s3/policy.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/bucket_listing.sh 2 | 3 | awscli s3api get-bucket-policy --bucket "$SELECTED" --output text --query Policy | jq 4 | -------------------------------------------------------------------------------- /scripts/commands/s3/policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 policy [bucket-filter]*` 2 | 3 | Show the S3 bucket policy 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/s3/website.bash: -------------------------------------------------------------------------------- 1 | source $CURRENT_COMMAND_DIR/bucket_listing.sh 2 | 3 | awscli s3api get-bucket-website --bucket "$SELECTED" --output table 4 | -------------------------------------------------------------------------------- /scripts/commands/s3/website.md: -------------------------------------------------------------------------------- 1 | # `awsinfo s3 website [bucket-filter]*` 2 | 3 | Show Website Configuration of the specific Bucket. 4 | 5 | ## Filter matches against 6 | 7 | * Bucket Name 8 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/index.bash: -------------------------------------------------------------------------------- 1 | awscli secretsmanager list-secrets --output table \ 2 | --query "SecretList[$(auto_filter_joined ARN Name -- "$@")].{ \ 3 | \"1.Name\":Name, \ 4 | \"2.ARN\":ARN}" 5 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo secretsmanager [secret-filter]*` 2 | 3 | List all Secrets. 4 | 5 | ## Secret Filter matches against 6 | 7 | * Arn 8 | * Name 9 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/policy.bash: -------------------------------------------------------------------------------- 1 | SECRET_LISTING=$(awscli secretsmanager list-secrets --output text --query "SecretList[$(auto_filter_joined ARN Name -- "$@")].[Name]") 2 | select_one Secret "$SECRET_LISTING" 3 | 4 | awscli secretsmanager get-resource-policy --secret-id "$SELECTED" --output text --query "ResourcePolicy" 5 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo secretsmanager policy [secret-filter]*` 2 | 3 | Show the Secret Policy. 4 | 5 | ## Secret Filter matches against 6 | 7 | * Arn 8 | * Name 9 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/secret.bash: -------------------------------------------------------------------------------- 1 | SECRET_LISTING=$(awscli secretsmanager list-secrets --output text --query "SecretList[$(auto_filter_joined ARN Name -- "$@")].[Name]") 2 | select_one Secret "$SECRET_LISTING" 3 | 4 | awscli secretsmanager describe-secret --secret-id "$SELECTED" --output table 5 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/secret.md: -------------------------------------------------------------------------------- 1 | # `awsinfo secretsmanager secret [secret-filter]*` 2 | 3 | Show all details of a Secret. 4 | 5 | ## Secret Filter matches against 6 | 7 | * Arn 8 | * Name 9 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/value.bash: -------------------------------------------------------------------------------- 1 | SECRET_LISTING=$(awscli secretsmanager list-secrets --output text --query "SecretList[$(auto_filter_joined ARN Name -- "$@")].[Name]") 2 | select_one Secret "$SECRET_LISTING" 3 | 4 | awscli secretsmanager get-secret-value --secret-id "$SELECTED" --output text --query "SecretString" 5 | -------------------------------------------------------------------------------- /scripts/commands/secretsmanager/value.md: -------------------------------------------------------------------------------- 1 | # `awsinfo secretsmanager value [secret-filter]*` 2 | 3 | Get the value of the Secret. 4 | 5 | ## Secret Filter matches against 6 | 7 | * Arn 8 | * Name 9 | -------------------------------------------------------------------------------- /scripts/commands/ses/index.bash: -------------------------------------------------------------------------------- 1 | awscli ses list-identities --output table --query "Identities[$(auto_filter_joined @ -- "$@")]" -------------------------------------------------------------------------------- /scripts/commands/ses/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ses [filters]*` 2 | 3 | List all or filtered SES identities -------------------------------------------------------------------------------- /scripts/commands/sns/index.bash: -------------------------------------------------------------------------------- 1 | awscli sns list-topics --output table --query "Topics[$(auto_filter_joined TopicArn -- "$@")].{\"1.Arn\":TopicArn}" -------------------------------------------------------------------------------- /scripts/commands/sns/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo sns [substrings]*` 2 | 3 | List all SNS Topics by their ARN. If `substrings` is given it will only print Topics where all `substrings` are part of the ARN. -------------------------------------------------------------------------------- /scripts/commands/sns/policy.bash: -------------------------------------------------------------------------------- 1 | TOPICS=$(awscli sns list-topics --output text --query "Topics[$(auto_filter_joined TopicArn -- "$@")].[TopicArn]") 2 | select_one Topic "$TOPICS" 3 | 4 | awscli sns get-topic-attributes --topic-arn "$SELECTED" --query Attributes.Policy --output text | jq -------------------------------------------------------------------------------- /scripts/commands/sns/policy.md: -------------------------------------------------------------------------------- 1 | # `awsinfo sns policy [filters]+` 2 | 3 | Show the SNS Policy of the Topic 4 | 5 | ## Filter matches against 6 | 7 | * TopicARN 8 | -------------------------------------------------------------------------------- /scripts/commands/sns/subscriptions.bash: -------------------------------------------------------------------------------- 1 | TOPICS=$(awscli sns list-topics --output text --query "Topics[$(auto_filter_joined TopicArn -- "$@")].[TopicArn]") 2 | select_one Topic "$TOPICS" 3 | 4 | awscli sns list-subscriptions-by-topic --topic-arn "$SELECTED" --output table --query "Subscriptions" -------------------------------------------------------------------------------- /scripts/commands/sns/subscriptions.md: -------------------------------------------------------------------------------- 1 | # `awsinfo sns subscriptions [substrings]*` 2 | 3 | List all Subscriptions for a specific SNS Topics. Use `substrings` to select which topic you want to see the subscriptions for. -------------------------------------------------------------------------------- /scripts/commands/sqs/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo sqs [substrings]*` 2 | 3 | List all SQS queues and some queue attributes. 4 | If `substrings` are given it will only print sqs queues that contain all `substrings`. -------------------------------------------------------------------------------- /scripts/commands/ssm/index.bash: -------------------------------------------------------------------------------- 1 | awscli ssm describe-instance-information --output table --query "InstanceInformationList[$(auto_filter_joined InstanceId PlatformType PlatformName PlatformVersion AgentVersion PingStatus -- "$@")].{ 2 | \"1.Id\":InstanceId, 3 | \"2.Ping Status/LastPing\":join(':',[PingStatus,to_string(LastPingDateTime)]), 4 | \"3.AgentVersion/Latest\":join('/',[AgentVersion,to_string(IsLatestVersion)]), 5 | \"4.Platform\":join('/',[PlatformType,PlatformName,PlatformVersion]), 6 | \"5.ResourceType\":ResourceType, 7 | \"6.IPAddress\":IPAddress}" -------------------------------------------------------------------------------- /scripts/commands/ssm/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ssm [filters]+` 2 | 3 | List all SSM Managed Instances. 4 | 5 | ## Filter matches against 6 | 7 | * InstanceId 8 | * PlatformType 9 | * PlatformName 10 | * PlatformVersion 11 | * AgentVersion 12 | * PingStatus 13 | -------------------------------------------------------------------------------- /scripts/commands/ssm/instance-associations.md: -------------------------------------------------------------------------------- 1 | # `awsinfo SERVICE COMMAND [first-filters]+ -- [second-filters]*` 2 | 3 | Give an overview description of the command here 4 | 5 | ## First Filter matches against 6 | 7 | * Attribute1 8 | * Attribute2 9 | 10 | ## Second Filter matches against 11 | 12 | * Attribute1 13 | * Attribute2 -------------------------------------------------------------------------------- /scripts/commands/ssm/parameter.bash: -------------------------------------------------------------------------------- 1 | FILTER="" 2 | while getopts "f:" opt; do 3 | case "$opt" in 4 | f) FILTER="--parameter-filters Key=Name,Option=Contains,Values=$OPTARG" ;; 5 | esac 6 | done 7 | shift $(($OPTIND - 1)) 8 | 9 | PARAMETER_LISTING=$(awscli ssm describe-parameters $FILTER --output text --query "sort_by(Parameters,&Name)[$(auto_filter_joined Name LastModifiedUser Type -- "$@")].[Name]") 10 | select_one Parameter "$PARAMETER_LISTING" 11 | 12 | awscli ssm get-parameter --name "$SELECTED" --with-decryption --output table 13 | -------------------------------------------------------------------------------- /scripts/commands/ssm/parameter.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ssm parameter [parameter-filter]*` 2 | 3 | Get details and the value of a SSM Parameter 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * LastModifiedUser 9 | * Type -------------------------------------------------------------------------------- /scripts/commands/ssm/parameters.bash: -------------------------------------------------------------------------------- 1 | FILTER="" 2 | while getopts "f:" opt; do 3 | case "$opt" in 4 | f) FILTER="--parameter-filters Key=Name,Option=Contains,Values=$OPTARG" ;; 5 | esac 6 | done 7 | shift $(($OPTIND - 1)) 8 | 9 | awscli ssm describe-parameters $FILTER --output table --query "sort_by(Parameters,&Name)[$(auto_filter_joined Name LastModifiedUser Type -- "$@")].{ 10 | \"1.Name\":Name, 11 | \"2.Type\":Type, 12 | \"3.Version\":Version, 13 | \"4.LastModifiedUser\":LastModifiedUser}" 14 | -------------------------------------------------------------------------------- /scripts/commands/ssm/parameters.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ssm [parameter-filter]*` 2 | 3 | List all SSM Parameters. 4 | 5 | ## Options 6 | 7 | * `-f`: Will only load Parameters containing the filter. With large number of parameters this is necessary to not have requests throttled. 8 | 9 | ## Filter matches against 10 | 11 | * Name 12 | * LastModifiedUser 13 | * Type -------------------------------------------------------------------------------- /scripts/commands/ssm/session.bash: -------------------------------------------------------------------------------- 1 | EC2_FILTER="--filter Name=instance-state-name,Values=pending,running" 2 | 3 | SECURITY_GROUPS="NetworkInterfaces|length(@)" 4 | FILTER=$(auto_filter_joined "$TAG_NAME" InstanceId InstanceType State.Name Placement.AvailabilityZone "$SECURITY_GROUPS" -- "$@") 5 | 6 | INSTANCE_LISTING=$(awscli ec2 describe-instances --output text $EC2_FILTER --query "sort_by(Reservations,&Instances[0].InstanceId)[].Instances[$FILTER][].[InstanceId]") 7 | 8 | select_one Instance "$INSTANCE_LISTING" 9 | 10 | awscli ssm start-session --target $SELECTED -------------------------------------------------------------------------------- /scripts/commands/ssm/session.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ssm session [filters]*` 2 | 3 | Start an SSM SSH-like Session on an EC2 Instance. 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * Id 9 | * Type 10 | * State 11 | * AvailabilityZone 12 | * SecurityGroups -------------------------------------------------------------------------------- /scripts/commands/vpc/endpoint.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined VpcEndpointId VpcEndpointType VpcId ServiceName "join('',SubnetIds)" -- "$@") 2 | 3 | ENDPOINTS=$(awscli ec2 describe-vpc-endpoints --output text --query "VpcEndpoints[$FILTER].[VpcEndpointId]") 4 | 5 | select_one Endpoint "$ENDPOINTS" 6 | 7 | awscli ec2 describe-vpc-endpoints --vpc-endpoint-ids "$SELECTED" --output table 8 | -------------------------------------------------------------------------------- /scripts/commands/vpc/endpoint.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc endpoint [filters]+` 2 | 3 | Show Details of a VPC Endpoint 4 | 5 | ## Filter matches against 6 | 7 | * VpcEndpointId 8 | * VpcEndpointType 9 | * VpcId 10 | * ServiceName 11 | * SubnetIds 12 | -------------------------------------------------------------------------------- /scripts/commands/vpc/endpoints-available.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined "join('',ServiceType[].ServiceType||[''])" ServiceName Owner "join('',AvailabilityZones||[])" -- "$@") 2 | 3 | awscli ec2 describe-vpc-endpoint-services --output table \ 4 | --query "ServiceDetails[$FILTER].{ \ 5 | \"1.ServiceName\":ServiceName, \ 6 | \"2.ServiceType\":join(', ', ServiceType[].ServiceType), \ 7 | \"3.Owner\":Owner}" 8 | -------------------------------------------------------------------------------- /scripts/commands/vpc/endpoints-available.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 vpc-endpoint-services [services-filter]*` 2 | 3 | List all available VPC Endpoint Services 4 | 5 | ## Filter matches against 6 | 7 | * ServiceType 8 | * ServiceName 9 | * Owner 10 | * AvailabilityZones 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/endpoints.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined VpcEndpointId VpcEndpointType VpcId ServiceName "join('',SubnetIds)" -- "$@") 2 | 3 | awscli ec2 describe-vpc-endpoints --output table \ 4 | --query "VpcEndpoints[$FILTER].{ 5 | \"1.Id\":VpcEndpointId, 6 | \"2.Type\":VpcEndpointType, 7 | \"3.VpcId\":VpcId, 8 | \"4.ServiceName\":ServiceName, 9 | \"4.State\":State}" 10 | -------------------------------------------------------------------------------- /scripts/commands/vpc/endpoints.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc endpoints [first-filters]*` 2 | 3 | Lists all existing VPC Endpoints 4 | 5 | ## Filter matches against 6 | 7 | * VpcEndpointId 8 | * VpcEndpointType 9 | * VpcId 10 | * ServiceName 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/index.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined VpcId "$TAG_NAME" "to_string(IsDefault)" -- "$@") 2 | awscli ec2 describe-vpcs --output table --query "Vpcs[$FILTER].{ \ 3 | \"1.Name\":$TAG_NAME, \ 4 | \"2.Id\": VpcId, \ 5 | \"3.CidrBlock\": join(', ',CidrBlockAssociationSet[].CidrBlock), \ 6 | \"4.State\": State, \ 7 | \"5.InstanceTenancy\":InstanceTenancy, \ 8 | \"6.IsDefault\": IsDefault}" -------------------------------------------------------------------------------- /scripts/commands/vpc/index.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc [filters]*` 2 | 3 | List all VPCs 4 | 5 | ## Filter matches against 6 | 7 | * RouteTableId 8 | * Tag Name 9 | * VpcId -------------------------------------------------------------------------------- /scripts/commands/vpc/internet-gateway.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined InternetGatewayId "join('',Attachments[].VpcId)" "join('',Tags[].Value)" -- "$@") 2 | 3 | INTERNET_GATEWAYS=$(awscli ec2 describe-internet-gateways --output text --query "InternetGateways[$FILTER].[InternetGatewayId]") 4 | select_one InternetGateway "$INTERNET_GATEWAYS" 5 | 6 | awscli ec2 describe-internet-gateways --filter "Name=internet-gateway-id,Values=$SELECTED" --output table -------------------------------------------------------------------------------- /scripts/commands/vpc/internet-gateway.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc internet-gateway [filters]+` 2 | 3 | Describe an Internet Gateways 4 | 5 | ## Filter matches against 6 | 7 | * InternetGatewayId 8 | * VPCIds 9 | * Tag Values 10 | -------------------------------------------------------------------------------- /scripts/commands/vpc/internet-gateways.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined InternetGatewayId "join('',Attachments[].VpcId)" "join('',Tags[].Value)" -- "$@") 2 | 3 | awscli ec2 describe-internet-gateways --output table --query "InternetGateways[$FILTER].{ 4 | \"1.InternetGatewayId\":InternetGatewayId, 5 | \"2.Attachments\":join(',', Attachments[].VpcId), 6 | \"3.OwnerId\": OwnerId}" 7 | -------------------------------------------------------------------------------- /scripts/commands/vpc/internet-gateways.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc internet-gateways [filters]+` 2 | 3 | List all Internet Gateways 4 | 5 | ## Filter matches against 6 | 7 | * InternetGatewayId 8 | * VPCIds 9 | * Tag Values 10 | -------------------------------------------------------------------------------- /scripts/commands/vpc/nat-gateways.bash: -------------------------------------------------------------------------------- 1 | awscli ec2 describe-nat-gateways --output table \ 2 | --query "NatGateways[$(auto_filter_joined NatGatewayId State SubnetId VpcId -- "$@")].{ \ 3 | \"1.Id\":NatGatewayId, \ 4 | \"2.State\":State, \ 5 | \"3.Vpc\":VpcId, \ 6 | \"4.Subnet\":SubnetId, \ 7 | \"5.NetworkInterface\":NatGatewayAddresses[0].NetworkInterfaceId, \ 8 | \"6.PrivateIp\":NatGatewayAddresses[0].PrivateIp, \ 9 | \"7.PublicIp\":NatGatewayAddresses[0].PublicIp}" 10 | -------------------------------------------------------------------------------- /scripts/commands/vpc/nat-gateways.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc nat-gateways [filter]*` 2 | 3 | List all Nat Gateways 4 | 5 | ## Filter matches against 6 | 7 | * NatGatewayId 8 | * State 9 | * SubnetId 10 | * VpcId 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-acl.bash: -------------------------------------------------------------------------------- 1 | SUBNETS="join(',',Associations[].SubnetId)" 2 | 3 | FILTER=$(auto_filter_joined VpcId NetworkAclId $SUBNETS $TAG_NAME -- "$@") 4 | 5 | NETWORK_ACLS=$(awscli ec2 describe-network-acls --output text --query "NetworkAcls[$FILTER].[NetworkAclId]") 6 | select_one NetworkACL "$NETWORK_ACLS" 7 | 8 | awscli ec2 describe-network-acls --output table --filters "Name=network-acl-id,Values=$SELECTED" 9 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-acl.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc network-acl [filter]*` 2 | 3 | Describe a NetworkACL with all its details 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * VpcId 9 | * NetworkAclId 10 | * Subnets 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-acls.bash: -------------------------------------------------------------------------------- 1 | SUBNETS="join(',',Associations[].SubnetId)" 2 | 3 | FILTER=$(auto_filter_joined VpcId NetworkAclId $SUBNETS $TAG_NAME -- "$@") 4 | 5 | awscli ec2 describe-network-acls --output table --query "NetworkAcls[$FILTER].{ 6 | \"1.Name\":$TAG_NAME, 7 | \"2.VpcId\":VpcId, 8 | \"3.NetworkAclId\":NetworkAclId, 9 | \"4.Default\":IsDefault, 10 | \"5.Subnets\":$SUBNETS}" 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-acls.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc network-acls [filter]*` 2 | 3 | List all Network ACLs. 4 | 5 | ## Filter matches against 6 | 7 | * Name 8 | * VpcId 9 | * NetworkAclId 10 | * Subnets 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-interface.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined AvailabilityZone Description NetworkInterfaceId RequesterId SubnetId VpcId PrivateIpAddress PrivateDnsName "join('',Groups[].GroupId)" "$TAG_NAME" -- "$@") 2 | 3 | NETWORK_INTERFACES=$(awscli ec2 describe-network-interfaces --output text --query "NetworkInterfaces[$FILTER].[NetworkInterfaceId]") 4 | select_one NetworkInterface "$NETWORK_INTERFACES" 5 | 6 | awscli ec2 describe-network-interfaces --network-interface-ids "$SELECTED" --output table --query "NetworkInterfaces[0]" 7 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-interface.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 network-interface [filter]* ` 2 | 3 | Describe a Network Interface 4 | 5 | ## Filter matches against 6 | 7 | * AvailabilityZone 8 | * Description 9 | * NetworkInterfaceId 10 | * RequesterId 11 | * SubnetId 12 | * VpcId 13 | * PrivateIpAddress 14 | * PrivateDnsName 15 | * SecuritGroupIds 16 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-interfaces.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined AvailabilityZone Description NetworkInterfaceId SubnetId VpcId PrivateIpAddress PrivateDnsName RequesterId "join('',Groups[].GroupId||[''])" "$TAG_NAME" -- "$@") 2 | 3 | awscli ec2 describe-network-interfaces --output table --query "NetworkInterfaces[$FILTER].{ 4 | \"1.Name\":$TAG_NAME, 5 | \"2.Id\":NetworkInterfaceId, 6 | \"3.IP\":PrivateIpAddress, 7 | \"4.Requester\":RequesterId, 8 | \"5.Subnet\":SubnetId, 9 | \"6.VPC\":VpcId, 10 | \"7.AZ\":AvailabilityZone, 11 | \"8.SecurityGroups\":join(', ',Groups[].GroupId)}" 12 | -------------------------------------------------------------------------------- /scripts/commands/vpc/network-interfaces.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 network-interfaces [filter]*` 2 | 3 | List all Network Interfaces 4 | 5 | ## Filter matches against 6 | 7 | * AvailabilityZone 8 | * Description 9 | * NetworkInterfaceId 10 | * RequesterId 11 | * SubnetId 12 | * VpcId 13 | * PrivateIpAddress 14 | * PrivateDnsName 15 | * SecuritGroupIds 16 | -------------------------------------------------------------------------------- /scripts/commands/vpc/peering-connections.bash: -------------------------------------------------------------------------------- 1 | awscli ec2 describe-vpc-peering-connections --output table --query "VpcPeeringConnections[$(auto_filter_joined AccepterVpcInfo.VpcId AccepterVpcInfo.CidrBlock RequesterVpcInfo.VpcId RequesterVpcInfo.CidrBlock VpcPeeringConnectionId Status.Message -- "$@")].{ 2 | \"1.Id\":VpcPeeringConnectionId, 3 | \"2.Status\":Status.Message, 4 | \"3.RequesterVPC\":RequesterVpcInfo.VpcId, 5 | \"4.RequesterCIDR\":RequesterVpcInfo.CidrBlock, 6 | \"5.AccepeterVPC\":AccepterVpcInfo.VpcId 7 | \"6.AccepeterCIDR\":AccepterVpcInfo.CidrBlock}" -------------------------------------------------------------------------------- /scripts/commands/vpc/peering-connections.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc peering-connections [filters]+` 2 | 3 | Describe all Peering Connections 4 | 5 | ## Filter matches against 6 | 7 | * Requester VpcId 8 | * Requester CidrBlock 9 | * Accepter VpcId 10 | * Accepter CidrBlock 11 | * Id 12 | * Status Message 13 | -------------------------------------------------------------------------------- /scripts/commands/vpc/route-table.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined RouteTableId "$TAG_NAME" VpcId -- "$@") 2 | ROUTE_TABLES_LISTING=$(awscli ec2 describe-route-tables --output text --query "RouteTables[$FILTER].[RouteTableId]") 3 | 4 | select_one RouteTable "$ROUTE_TABLES_LISTING" 5 | 6 | awscli ec2 describe-route-tables --output table --route-table-ids "$SELECTED" --query "RouteTables[0]" -------------------------------------------------------------------------------- /scripts/commands/vpc/route-table.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc route-table [filter]*` 2 | 3 | Show all attributes of a vpc route table. 4 | 5 | ## Filter matches against 6 | 7 | * RouteTableId 8 | * Name 9 | * VPCId 10 | -------------------------------------------------------------------------------- /scripts/commands/vpc/route-tables.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined RouteTableId "$TAG_NAME" VpcId -- "$@") 2 | awscli ec2 describe-route-tables --output table --query "RouteTables[$FILTER].{ \ 3 | \"1.Name\":$TAG_NAME, \ 4 | \"2.Id\": RouteTableId, \ 5 | \"3.VpcId\": VpcId, 6 | \"4.SubnetAssociations\": Associations[].SubnetId||''|length(@)}" -------------------------------------------------------------------------------- /scripts/commands/vpc/route-tables.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc [filters]*` 2 | 3 | List all Route Tables 4 | 5 | ## Filter matches against 6 | 7 | * VpcId 8 | * Tag Name 9 | * IsDefault -------------------------------------------------------------------------------- /scripts/commands/vpc/security-group.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 security-group [filter]* ` 2 | 3 | Describe a Security Group including its Ingress/Egress Configuration. 4 | 5 | ## First filter matches against 6 | 7 | * GroupId 8 | * GroupName 9 | * VpcId 10 | * Description 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/security-groups.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined "$TAG_NAME" GroupId GroupName VpcId Description -- "$@") 2 | 3 | awscli ec2 describe-security-groups --output table --query "SecurityGroups[$FILTER].{\"1.Name\":$TAG_NAME,\"2.GroupId\":GroupId,\"3.GroupName\":GroupName,\"4.VpcId\":VpcId,\"5.Description\":Description}" 4 | -------------------------------------------------------------------------------- /scripts/commands/vpc/security-groups.md: -------------------------------------------------------------------------------- 1 | # `awsinfo ec2 security-groups [filter]*` 2 | 3 | List all Security Groups. 4 | 5 | ## First filter matches against 6 | 7 | * GroupId 8 | * GroupName 9 | * VpcId 10 | * Description 11 | -------------------------------------------------------------------------------- /scripts/commands/vpc/subnet.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined "$TAG_NAME" SubnetId VpcId AvailabilityZone CidrBlock State "to_string(MapPublicIpOnLaunch)" -- "$@") 2 | 3 | SUBNET_LISTING=$(awscli ec2 describe-subnets --output text --query "sort_by(Subnets,&SubnetId)[$FILTER].[SubnetId]") 4 | select_one Subnet "$SUBNET_LISTING" 5 | 6 | awscli ec2 describe-subnets --subnet-ids "$SELECTED" --output table 7 | -------------------------------------------------------------------------------- /scripts/commands/vpc/subnet.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc subnet [filters]*` 2 | 3 | Describe a VPC Subnet 4 | 5 | ## Filter matches against 6 | 7 | * SubnetId 8 | * VpcId 9 | * AvailabilityZone 10 | * CidrBlock 11 | * State 12 | * MapPublicIpOnLaunch -------------------------------------------------------------------------------- /scripts/commands/vpc/subnets.bash: -------------------------------------------------------------------------------- 1 | FILTER=$(auto_filter_joined "$TAG_NAME" SubnetId VpcId AvailabilityZone CidrBlock State "to_string(MapPublicIpOnLaunch)" -- "$@") 2 | 3 | awscli ec2 describe-subnets --output table --query "Subnets[$FILTER].{\"1.Name\":$TAG_NAME,\"2.Id\":SubnetId,\"3.VpcId\":VpcId,\"4.AZ\":AvailabilityZone,\"5.State\":State,\"6.CIDR\":CidrBlock,\"7.AvailableIp\":AvailableIpAddressCount,\"8.PublicIp\":to_string(MapPublicIpOnLaunch),\"9.DefaultForAz\":to_string(DefaultForAz),\"8.Ipv6\":to_string(AssignIpv6AddressOnCreation)}" 4 | -------------------------------------------------------------------------------- /scripts/commands/vpc/subnets.md: -------------------------------------------------------------------------------- 1 | # `awsinfo vpc subnets [filters]*` 2 | 3 | List all EC2 subnets 4 | 5 | ## Filter matches against 6 | 7 | * SubnetId 8 | * VpcId 9 | * AvailabilityZone 10 | * CidrBlock 11 | * State 12 | * MapPublicIpOnLaunch -------------------------------------------------------------------------------- /scripts/helpers/awscli.bash: -------------------------------------------------------------------------------- 1 | function awscli() { 2 | if [[ ! -z "$VERBOSE" ]] 3 | then 4 | command=$(echo aws $@ ${AWS_OPTIONS} | sed 's/\([,{:]\) /\1/g ; s/"/\\"/g ; s/--query \([^ ]*\)/--query \"\1\"/g ') 5 | echoinfomsg $command 6 | fi 7 | aws "$@" ${AWS_OPTIONS} 8 | } 9 | 10 | export -f awscli -------------------------------------------------------------------------------- /scripts/helpers/colors.bash: -------------------------------------------------------------------------------- 1 | export RED='\u001b[00;31m' 2 | export GREEN='\u001b[00;32m' 3 | export YELLOW='\u001b[00;33m' 4 | export BLUE='\u001b[00;34m' 5 | export PURPLE='\u001b[00;35m' 6 | export CYAN='\u001b[00;36m' 7 | export LIGHTGRAY='\u001b[00;37m' 8 | export LRED='\u001b[01;31m' 9 | export LGREEN='\u001b[01;32m' 10 | export LYELLOW='\u001b[01;33m' 11 | export LBLUE='\u001b[01;34m' 12 | export LPURPLE='\u001b[01;35m' 13 | export LCYAN='\u001b[01;36m' 14 | export WHITE='\u001b[01;37m' 15 | export NC='\u001b[0m' 16 | -------------------------------------------------------------------------------- /scripts/helpers/common.bash: -------------------------------------------------------------------------------- 1 | TAG_NAME="Tags[?Key=='Name'].Value|[0]||''" -------------------------------------------------------------------------------- /scripts/helpers/date.bash: -------------------------------------------------------------------------------- 1 | function awsinfo_date() { 2 | if command -v gdate > /dev/null; then 3 | gdate "$@" 4 | else 5 | date "$@" 6 | fi 7 | } 8 | 9 | -------------------------------------------------------------------------------- /stacks/elasticbeanstalk/stack.config.yml: -------------------------------------------------------------------------------- 1 | stack: awsinfo-elasticbeanstalk 2 | capabilities: 3 | - CAPABILITY_IAM -------------------------------------------------------------------------------- /stacks/iam/stack.config.yml: -------------------------------------------------------------------------------- 1 | stack: awsinfo-iam 2 | capabilities: 3 | - CAPABILITY_IAM -------------------------------------------------------------------------------- /stacks/lambda/code.py: -------------------------------------------------------------------------------- 1 | def handler(event, context): 2 | print(event) 3 | -------------------------------------------------------------------------------- /stacks/lambda/stack.config.yml: -------------------------------------------------------------------------------- 1 | stack: awsinfo-lambda 2 | capabilities: 3 | - CAPABILITY_IAM -------------------------------------------------------------------------------- /stacks/rds/rds.template.yml: -------------------------------------------------------------------------------- 1 | Resources: 2 | RDSCluster: 3 | Type: AWS::RDS::DBCluster 4 | Properties: 5 | MasterUsername: user 6 | MasterUserPassword: password 7 | Engine: aurora 8 | 9 | RDSDBInstance1: 10 | Type: AWS::RDS::DBInstance 11 | Properties: 12 | Engine: aurora 13 | PubliclyAccessible: 'false' 14 | DBInstanceClass: db.r4.large 15 | DBClusterIdentifier: 16 | Ref: RDSCluster 17 | 18 | RDSDBInstance2: 19 | Type: AWS::RDS::DBInstance 20 | Properties: 21 | Engine: aurora 22 | PubliclyAccessible: 'false' 23 | DBInstanceClass: db.r4.large 24 | DBClusterIdentifier: 25 | Ref: RDSCluster 26 | -------------------------------------------------------------------------------- /stacks/rds/stack.config.yml: -------------------------------------------------------------------------------- 1 | stack: awsinfo-rds -------------------------------------------------------------------------------- /stacks/route53/stack.config.yml: -------------------------------------------------------------------------------- 1 | stack: awsinfo-route53 -------------------------------------------------------------------------------- /tests/commands/cfn/cfn.template.yml: -------------------------------------------------------------------------------- 1 | Resources: 2 | FirstLogGroup: 3 | Type: "AWS::Logs::LogGroup" 4 | SecondLogGroup: 5 | Type: "AWS::Logs::LogGroup" -------------------------------------------------------------------------------- /tests/commands/logs/groups.bats: -------------------------------------------------------------------------------- 1 | load ../../awsinfo 2 | load ../../test-helpers/bats-support/load 3 | load ../../test-helpers/bats-assert/load 4 | 5 | setup(){ 6 | deploy_stack 7 | } 8 | 9 | @test "listing all or specific log groups " { 10 | run awsinfo logs groups 11 | assert_output -p AWSInfoTestLogGroup 12 | assert_success 13 | 14 | run awsinfo logs groups InfoTestLogGroup 15 | assert_output -p AWSInfoTestLogGroup 16 | assert_success 17 | } 18 | 19 | teardown(){ 20 | remove_stack 21 | } 22 | -------------------------------------------------------------------------------- /tests/commands/logs/logs.template.yml: -------------------------------------------------------------------------------- 1 | Resources: 2 | AWSInfoTestLogGroup: 3 | Type: "AWS::Logs::LogGroup" -------------------------------------------------------------------------------- /tests/stack.config.yaml: -------------------------------------------------------------------------------- 1 | stack: awsinfo-integration-user 2 | region: eu-central-1 3 | capabilities: 4 | - CAPABILITY_IAM 5 | --------------------------------------------------------------------------------