def get_aws_options(parser, rw=False):
	"""Provide options that are needed to authenticate, etc. as a top-level
	feature of k.aws as opposed to being useful for a specific module.

	:type parser: optparse.OptionParser
	:param parser: This OptionParser object will be used to add options to.

	:type rw: bool
	:param rw: If this is set to True, the "--ro" option will be added, and if
	           it is False, then the "--rw" option will be added.
	"""
	parser.add_option(
		"-A", "--access-key", dest="access_key",
		help=' '.join(["Amazon Access Key (Defaults to AWS_ACCESS_KEY_ID",
			"environment variable if not set)"]))
	parser.add_option(
		"-S", "--secret-key", dest="secret_key",
		help=' '.join(["Amazon Secret Key (uses AWS_SECRET_ACCESS_KEY",
			"environment variable if not set)"]))
	parser.add_option(
		"-e", "--env", dest="aws_env",
		help=' '.join(["Use passed in AWS environment (account) to connect",
			"(production, staging, stack_iam, etc)"]))
	if rw:
		parser.add_option(
			"--ro", dest="readwrite",
			help="Force use of a read only key (Default: readwrite)",
			default=True,
			action="store_false")
	else:
		parser.add_option(
			"--rw", dest="readwrite",
			help="Force use of a read write key (Default: readonly)",
			default=False,
			action="store_true")
	parser.add_option(
		"--iam", "--forceiam", dest="forceiam",
		help="Force use of box IAM (Default: False)",
		default=False,
		action="store_true")
	parser.add_option(
		"--file", "--forcefile", dest="forcefile",
		help="Force use of files in k.config (Default: False)",
		default=False,
		action="store_true")
	parser.add_option(
		"--duration", dest="duration", default=3600,
		help=' '.join(["Duration for Kerberos ticket. (Default: 3600, ",
			"range=3600-129600)"]))
	return parser