问题描述
根据guide,我已经指定了IAM用户凭证(访问密钥和秘密访问密钥),并使用如下所示的AWS Signature版本4生成了预签名的URL:
import random
def snakeEyes():
# Simulate dice
# Variables to store integers
diceCount = 0
diceSum = 0
while(diceSum != 2):
dice1 = random.randint(1,6)
dice2 = random.randint(1,6)
diceSum = dice1 + dice2
diceCount = diceCount + 1
# if both 1's - snake eyes
if diceSum == 2:
combo_name = "snake eyes"
# if both 6's - Boxcars
elif diceSum == 12:
combo_name = "Boxcars"
# if 7 --> natural
elif diceSum == 7:
combo_name = "natural"
# if sum % 2 == 0 -- we got an even
# if dice values are same -- "hard"
# else - easy
# turn the sum number into text number
elif diceSum % 2 == 0:
if dice1 == dice2:
combo_name = "hard " + str(diceSum)
else:
combo_name = "easy " + str(diceSum)
# else - have an odd number
# figure out which odd name we are using
else:
if diceSum == 3:
combo_name = "ace deuce"
elif diceSum == 5:
combo_name = "fever five"
elif diceSum == 9:
combo_name = "nina"
elif diceSum == 11:
combo_name = "yo-leven"
# Print line with dice values and names
print("Dice1: " + str(dice1) + " Dice 2: " + str(dice2) + " " + combo_name)
print("The dice rolled " + str(diceCount) + " times before it got snake eyes.")
snakeEyes()
但是,该网址在6小时后仍然过期。我的代码有什么错误吗?或者我使用的证书不属于IAM用户吗?如何检查凭证类型(IAM用户或AWS IAM实例配置文件)?我只是遵循the steps来获取我的访问密钥和秘密访问密钥
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)