// resourceAwsLambdaAliasRead maps to:
// GetAlias in the API / SDK
resourceAwsLambdaAliasRead maps to:
GetAlias in the API / SDK
// resourceAwsLambdaAliasRead maps to : // GetAlias in the API / SDK
func resourceAwsLambdaAliasRead(d *schema.ResourceData, meta interface{}) error {
	conn := meta.(*AWSClient).lambdaconn
	log.Printf("[DEBUG] Fetching Lambda alias: %s:%s", d.Get("function_name"), d.Get("name"))
	params := &lambda.GetAliasInput{
		FunctionName: aws.String(d.Get("function_name").(string)),
		Name:         aws.String(d.Get("name").(string)),
	}
	aliasConfiguration, err := conn.GetAlias(params)
	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			if awsErr.Code() == "ResourceNotFoundException" && strings.Contains(awsErr.Message(), "Cannot find alias arn") {
				d.SetId("")
				return nil
			}
		}
		return err
	}
	d.Set("description", aliasConfiguration.Description)
	d.Set("function_version", aliasConfiguration.FunctionVersion)
	d.Set("name", aliasConfiguration.Name)
	d.Set("arn", aliasConfiguration.AliasArn)
	d.SetId(*aliasConfiguration.AliasArn)
	invokeArn := lambdaFunctionInvokeArn(*aliasConfiguration.AliasArn, meta)
	d.Set("invoke_arn", invokeArn)
	if err := d.Set("routing_config", flattenLambdaAliasRoutingConfiguration(aliasConfiguration.RoutingConfig)); err != nil {
		return fmt.Errorf("error setting routing_config: %s", err)
	}
	return nil
}
func resourceAwsLambdaAliasRead ( d * schema . ResourceData , meta interface { } ) error { conn := meta . ( * AWSClient ) . lambdaconn log . Printf ( " " , d . Get ( " " ) , d . Get ( " " ) ) params := & lambda . GetAliasInput { FunctionName : aws . String ( d . Get ( " " ) . ( string ) ) , Name : aws . String ( d . Get ( " " ) . ( string ) ) , } aliasConfiguration , err := conn . GetAlias ( params ) if err != nil { if awsErr , ok := err . ( awserr . Error ) ; ok { if awsErr . Code ( ) == " " && strings . Contains ( awsErr . Message ( ) , " " ) { d . SetId ( " " ) return nil } } return err } d . Set ( " " , aliasConfiguration . Description ) d . Set ( " " , aliasConfiguration . FunctionVersion ) d . Set ( " " , aliasConfiguration . Name ) d . Set ( " " , aliasConfiguration . AliasArn ) d . SetId ( * aliasConfiguration . AliasArn ) invokeArn := lambdaFunctionInvokeArn ( * aliasConfiguration . AliasArn , meta ) d . Set ( " " , invokeArn ) if err := d . Set ( " " , flattenLambdaAliasRoutingConfiguration ( aliasConfiguration . RoutingConfig ) ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
resourceAwsLambdaAliasRead maps to:
GetAlias in the API / SDK
resourceAwsLambdaAliasRead maps to : GetAlias in the API / SDK