write_aws_credentials: Write AWS credentials to INI file

Description Usage Arguments Details Value See Also Examples

View source: R/write_credentials.R

Description

If you want to orchestrate ScrapeBot on AWS (Amazon Web Services), you need an AWS account. This AWS account then needs an IAM access (via http://console.aws.amazon.com/iam) with an API access key. In addition, launched servers on AWS will be fed your SSH public key to access them. To create a SSH keypair, use the AWS EC2 console (https://console.aws.amazon.com/ec2/) and "Network & Society."

Usage

1
2
3
4
5
6
write_aws_credentials(
  access_key_id,
  secret_access_key,
  ssh_private_pem_file,
  ssh_public_pem_file
)

Arguments

access_key_id

The AWS user's access key ID (via IAM) as character string.

secret_access_key

The corresponding secret as character string.

ssh_private_pem_file

The path/file to your private SSH key in .pem format as character string.

ssh_public_pem_file

The path/file to the corresponding public SSH key in .pem format as character string.

Details

That said, you should not use connection functionality by regularly publishing credentials in the console. While credentials will end up in the console log, you also risk pushing scripts including credentials to any sustainable repositories (e.g., Git). Instead, you should prepare an INI file which will then be read/used by the connection functionality.

This function is a helper function to create this INI file for you. While creating the INI file like so will still end up pushing your credentials to the console log once, but it will not require you to do that ever again, thus keeping credentials off your repositories. The function pushes the credentials into an INI-file section called "AWS".

Alternatively, you can absolutely create this INI file yourself. For this, include a file called .scrapebot.ini (yes, including the leading dot) in your working directory. This file then needs a section which is indicated in its own line, looking like [my section]. Below this line (and thus, within this section) you can specify the following parameters to log into your AWS:

Value

The file name of the newly created credentials file, if successful.

See Also

aws_launch_instance() to use the credential file in practice

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

write_aws_credentials(
  'ABCD0EF1GH2IJ3KL',
  'fkdusbl+sli725imfn26fks9',
  'my_aws_key_private.pem',
  'my_aws_key_public.pem'
)

## End(Not run)

MarHai/ScrapeBotR documentation built on March 10, 2021, 10:10 a.m.